com.plexobject.mail.facade
Interface IRemoteAntispamService

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
IAntispamService

public interface IRemoteAntispamService
extends java.rmi.Remote


Field Summary
static int POLICY_AGGRESSIVE
           
static int POLICY_CONSERVATIVE
           
static int POLICY_NORMAL
           
 
Method Summary
 boolean bayesianCheck(java.lang.String m, java.lang.StringBuffer top)
          bayesianCheck determines if given message is SPAM based on Bayesian algorithm.
 boolean containsVirus(java.lang.String msg)
          containsVirus checks if given message has email-worm.
 java.lang.String createAnalysis(java.lang.String msg)
          createAnalysis checks if given message has email-worm.
 java.util.ArrayList findMatchingRules(java.lang.String msg)
          findMatchingRules returns an array of rules that match with the given message
 java.lang.String[] getAdminAddresses(java.lang.String msg)
          getAdminAddresses finds administrator's email addresses for the hosts where message was originated.
 java.lang.String[] getHostAdmins(java.lang.String[] hosts)
          getHostAdmins finds administrator's email addresses for the given hosts.
 java.lang.String getOriginatingIp(java.lang.String msg)
          getOriginatingIp finds address of host where message was created.
 java.lang.String[] getRouteIPs(java.lang.String msg, java.util.List fakeRoutes, java.util.List natRoutes, java.util.List ignoreRoutes)
          getRouteIPs finds addresses of hosts where message was routed.
 boolean isNatAddress(java.lang.String ip)
          isNatAddress checks if ip address is NAT address.
 boolean isSpam(java.lang.String msg, int policy, java.lang.StringBuffer reason)
          isSpam checks if given message is SPAM
 boolean razorCheck(java.lang.String msg)
          razorCheck checks if message exists in SpamNet/Vipul's Razor
 java.lang.String[] razorRegister(java.lang.String user, java.lang.String pass)
          razorRegister registers with SpamNet/Vipul's Razor
 void razorReport(java.lang.String user, java.lang.String pass, java.lang.String msg)
          razorReport checks if message exists in SpamNet/Vipul's Razor
 void razorRevoke(java.lang.String user, java.lang.String pass, java.lang.String msg)
          razorRevoke revoke message from SpamNet/Vipul's Razor
 java.lang.String[][] razorSignatures(java.lang.String msg)
          razorSignatures returns vr1, vr2, vr3 and vr4 signatures for Vipul's Razor
 void reportOrbs(java.lang.String ip)
          reportOrbs reports an IP address to ORBs
 

Field Detail

POLICY_AGGRESSIVE

public static final int POLICY_AGGRESSIVE
See Also:
Constant Field Values

POLICY_NORMAL

public static final int POLICY_NORMAL
See Also:
Constant Field Values

POLICY_CONSERVATIVE

public static final int POLICY_CONSERVATIVE
See Also:
Constant Field Values
Method Detail

getAdminAddresses

public java.lang.String[] getAdminAddresses(java.lang.String msg)
                                     throws javax.mail.MessagingException,
                                            java.rmi.RemoteException
getAdminAddresses finds administrator's email addresses for the hosts where message was originated. In addition, it also finds administrator's email addresses for any embedded email addresses or URLs.

Parameters:
msg - - stringified message containing email
Returns:
- list of email addresses
javax.mail.MessagingException
java.rmi.RemoteException

getHostAdmins

public java.lang.String[] getHostAdmins(java.lang.String[] hosts)
                                 throws javax.mail.MessagingException,
                                        java.rmi.RemoteException
getHostAdmins finds administrator's email addresses for the given hosts.

Parameters:
hosts - - list of hosts
Returns:
- list of administrator's email addresses for the given hosts or null if not found.
javax.mail.MessagingException
java.rmi.RemoteException

getOriginatingIp

public java.lang.String getOriginatingIp(java.lang.String msg)
                                  throws javax.mail.MessagingException,
                                         java.rmi.RemoteException
getOriginatingIp finds address of host where message was created.

Parameters:
msg - - stringified message to check
Returns:
- host address
javax.mail.MessagingException
java.rmi.RemoteException

getRouteIPs

public java.lang.String[] getRouteIPs(java.lang.String msg,
                                      java.util.List fakeRoutes,
                                      java.util.List natRoutes,
                                      java.util.List ignoreRoutes)
                               throws javax.mail.MessagingException,
                                      java.rmi.RemoteException
getRouteIPs finds addresses of hosts where message was routed.

Parameters:
msg - - stringified message to check
fakeRoutes - - if message contains fake routes, this will contain list of host names. Each element of this vector will of type String.
natRoutes - - if message contains NAT routes, this will contain list of host names. Each element of this vector will of type String.
ignoreRoutes - - this will store list of "Received" route entries that do not start with valid "from " line. Each element of this vector will of type String.
Returns:
- list of host address, where last host will be at offset 0 and host where message was created will be at offset N-1.
javax.mail.MessagingException
java.rmi.RemoteException

isNatAddress

public boolean isNatAddress(java.lang.String ip)
                     throws java.rmi.RemoteException
isNatAddress checks if ip address is NAT address.

Parameters:
ip - - IP address to check
Returns:
- true if ip address is NAT address, false otherwise.
java.rmi.RemoteException

isSpam

public boolean isSpam(java.lang.String msg,
                      int policy,
                      java.lang.StringBuffer reason)
               throws javax.mail.MessagingException,
                      java.rmi.RemoteException
isSpam checks if given message is SPAM

Parameters:
msg - - stringified message to check
policy - can be either POLICY_AGGRESSIVE, POLICY_NORMAL or POLICY_CONSERVATIVE. Some blackhole lists are more aggressive than others and this determines which lists to use.
reason - -- returns reason why message was considered SPAM
Returns:
- If message is found in any of the blacklists, it will return true, otherwise it will reutrn false
javax.mail.MessagingException
java.rmi.RemoteException

containsVirus

public boolean containsVirus(java.lang.String msg)
                      throws javax.mail.MessagingException,
                             java.rmi.RemoteException
containsVirus checks if given message has email-worm.

Parameters:
msg - - stringified message to check
Returns:
- true if message contains worm, false otherwise.
javax.mail.MessagingException
java.rmi.RemoteException

reportOrbs

public void reportOrbs(java.lang.String ip)
                throws java.rmi.RemoteException
reportOrbs reports an IP address to ORBs

Parameters:
ip - - host address
java.rmi.RemoteException

createAnalysis

public java.lang.String createAnalysis(java.lang.String msg)
                                throws javax.mail.MessagingException,
                                       java.rmi.RemoteException
createAnalysis checks if given message has email-worm.

Parameters:
msg - - stringified message to check
Returns:
- xml-based-analysis
javax.mail.MessagingException
java.rmi.RemoteException

razorCheck

public boolean razorCheck(java.lang.String msg)
                   throws javax.mail.MessagingException,
                          java.io.IOException,
                          java.rmi.RemoteException
razorCheck checks if message exists in SpamNet/Vipul's Razor

Parameters:
msg - - stringified message to check
Returns:
- true if message is known spam according to Vipul's Razor false otherwise
javax.mail.MessagingException
java.io.IOException
java.rmi.RemoteException

razorReport

public void razorReport(java.lang.String user,
                        java.lang.String pass,
                        java.lang.String msg)
                 throws javax.mail.MessagingException,
                        java.io.IOException,
                        java.rmi.RemoteException
razorReport checks if message exists in SpamNet/Vipul's Razor

Parameters:
user - - user id as registered with Vipul's Razor
pass - - plain password as registered with Vipul's Razor
msg - - stringified message to check
Throws:
java.io.IOException - if message cannot be parsed or failed to communicate with SpamNet servers.
MessaingException - if message cannot be parsed
javax.mail.MessagingException
java.rmi.RemoteException

razorRevoke

public void razorRevoke(java.lang.String user,
                        java.lang.String pass,
                        java.lang.String msg)
                 throws javax.mail.MessagingException,
                        java.io.IOException,
                        java.rmi.RemoteException
razorRevoke revoke message from SpamNet/Vipul's Razor

Parameters:
user - - user id as registered with Vipul's Razor
pass - - plain password as registered with Vipul's Razor
msg - - stringified message to check
Throws:
java.io.IOException - if message cannot be parsed or failed to communicate with SpamNet servers.
MessaingException - if message cannot be parsed
javax.mail.MessagingException
java.rmi.RemoteException

razorRegister

public java.lang.String[] razorRegister(java.lang.String user,
                                        java.lang.String pass)
                                 throws javax.mail.MessagingException,
                                        java.io.IOException,
                                        java.rmi.RemoteException
razorRegister registers with SpamNet/Vipul's Razor

Parameters:
user - - user id to register or null if to be selected by Vipul's razor.
pass - - plain password to register or null if to be selected by Vipul's razor.
Returns:
user/password from Vipul's Razor server
Throws:
java.io.IOException - if message cannot be parsed or failed to communicate with SpamNet servers.
MessaingException - if message cannot be parsed
javax.mail.MessagingException
java.rmi.RemoteException

razorSignatures

public java.lang.String[][] razorSignatures(java.lang.String msg)
                                     throws javax.mail.MessagingException,
                                            java.io.IOException,
                                            java.rmi.RemoteException
razorSignatures returns vr1, vr2, vr3 and vr4 signatures for Vipul's Razor

Parameters:
msg - - stringified message to check
Returns:
- array of array of strings, where first array stores V1 signatures, second array stores V2 signatures, third array stores V3 signatures and fourth array stores V4 signatures
Throws:
java.io.IOException - if message cannot be parsed or failed to communicate with SpamNet servers.
MessaingException - if message cannot be parsed
javax.mail.MessagingException
java.rmi.RemoteException

findMatchingRules

public java.util.ArrayList findMatchingRules(java.lang.String msg)
                                      throws javax.mail.MessagingException,
                                             java.rmi.RemoteException
findMatchingRules returns an array of rules that match with the given message

Parameters:
msg - - message to analyze
Returns:
- array of rules
javax.mail.MessagingException
java.rmi.RemoteException
See Also:
Rule

bayesianCheck

public boolean bayesianCheck(java.lang.String m,
                             java.lang.StringBuffer top)
                      throws java.io.IOException,
                             javax.mail.MessagingException,
                             java.rmi.RemoteException
bayesianCheck determines if given message is SPAM based on Bayesian algorithm.

Returns:
true if message is spam, otherwise false
java.io.IOException
javax.mail.MessagingException
java.rmi.RemoteException
See Also: