com.plexobject.mail.facade
Interface IAntispamService

All Superinterfaces:
IRemoteAntispamService, java.rmi.Remote

public interface IAntispamService
extends IRemoteAntispamService


Field Summary
 
Fields inherited from interface com.plexobject.mail.facade.IRemoteAntispamService
POLICY_AGGRESSIVE, POLICY_CONSERVATIVE, POLICY_NORMAL
 
Method Summary
 boolean bayesianCheck(javax.mail.Message m, java.lang.StringBuffer top)
          bayesianCheck determines if given message is SPAM based on Bayesian algorithm.
 boolean containsVirus(javax.mail.Message msg)
          containsVirus checks if given message has email-worm.
 java.lang.String createAnalysis(javax.mail.Message msg)
          createAnalysis creates XML based analysis of messags, checks authenticity of message and finds administrator's email addresses for the host where message was originated or any embedded URLs and emails.
 java.util.ArrayList findMatchingRules(javax.mail.Message msg)
          findMatchingRules returns an array of rules that match with the given message
 java.lang.String[] getAdminAddresses(javax.mail.Message msg)
          getAdminAddresses finds administrator's email addresses for the hosts where message was originated.
 java.lang.String getOriginatingIp(javax.mail.Message msg)
          getOriginatingIp finds address of host where message was created.
 java.lang.String[] getRouteIPs(javax.mail.Message msg, java.util.List fakeRoutes, java.util.List natRoutes, java.util.List ignoreRoutes)
          getRouteIPs finds addresses of hosts where message was routed.
 void initalizeBayesian(javax.mail.Folder[] good, javax.mail.Folder[] spam)
          initializeBayesian - initializes tokens based on Bayesian's algorithm.
 void initalizeBayesian(java.lang.String[] good, java.lang.String[] spam)
          initializeBayesian - initializes tokens based on Bayesian's algorithm.
 boolean isSpam(javax.mail.Message msg, int policy, java.lang.StringBuffer reason)
          isSpam checks if given message is SPAM
 boolean razorCheck(javax.mail.Message msg)
          razorCheck checks if message exists in SpamNet/Vipul's Razor
 void razorReport(java.lang.String user, java.lang.String pass, javax.mail.Message msg)
          razorReport reports message to SpamNet/Vipul's Razor
 void razorRevoke(java.lang.String user, java.lang.String pass, javax.mail.Message msg)
          razorRevoke revoke message from SpamNet/Vipul's Razor
 java.lang.String[][] razorSignatures(javax.mail.Message msg)
          razorSignatures returns vr1, vr2, vr3 and vr4 signatures for Vipul's Razor
 void resetBayesian()
          resetBayesian - resets all tokens used by Bayesian's algorithm.
 
Methods inherited from interface com.plexobject.mail.facade.IRemoteAntispamService
bayesianCheck, containsVirus, createAnalysis, findMatchingRules, getAdminAddresses, getHostAdmins, getOriginatingIp, getRouteIPs, isNatAddress, isSpam, razorCheck, razorRegister, razorReport, razorRevoke, razorSignatures, reportOrbs
 

Method Detail

getAdminAddresses

public java.lang.String[] getAdminAddresses(javax.mail.Message 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 - - Message containing email
Returns:
- list of email addresses
javax.mail.MessagingException
java.rmi.RemoteException

getOriginatingIp

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

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

getRouteIPs

public java.lang.String[] getRouteIPs(javax.mail.Message 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 - - message to check
fakeRoutes - - if message contains fake routes, this will contain list of host names.
natRoutes - - if message contains NAT routes, this will contain list of host names.
ignoreRoutes - - this will store list of "Received" route entries that do not start with valid "from " line.
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

isSpam

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

Parameters:
msg - - 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(javax.mail.Message msg)
                      throws javax.mail.MessagingException,
                             java.rmi.RemoteException
containsVirus checks if given message has email-worm.

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

createAnalysis

public java.lang.String createAnalysis(javax.mail.Message msg)
                                throws javax.mail.MessagingException,
                                       java.rmi.RemoteException
createAnalysis creates XML based analysis of messags, checks authenticity of message and finds administrator's email addresses for the host where message was originated or any embedded URLs and emails.

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

razorCheck

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

Parameters:
msg - - message to analyze
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,
                        javax.mail.Message msg)
                 throws javax.mail.MessagingException,
                        java.io.IOException,
                        java.rmi.RemoteException
razorReport reports message to SpamNet/Vipul's Razor

Parameters:
user - - user id as registered with Vipul's Razor
pass - - plain password as registered with Vipul's Razor
msg - - message to analyze
javax.mail.MessagingException
java.io.IOException
java.rmi.RemoteException

razorRevoke

public void razorRevoke(java.lang.String user,
                        java.lang.String pass,
                        javax.mail.Message 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 - - message to analyze
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(javax.mail.Message 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 - - message to analyze
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(javax.mail.Message 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

initalizeBayesian

public void initalizeBayesian(java.lang.String[] good,
                              java.lang.String[] spam)
                       throws java.io.IOException,
                              javax.mail.MessagingException,
                              java.rmi.RemoteException
initializeBayesian - initializes tokens based on Bayesian's algorithm. User needs to initialize Bayesian filter with a few thousand good and spam emails before using this filter.

java.io.IOException
javax.mail.MessagingException
java.rmi.RemoteException
See Also:

initalizeBayesian

public void initalizeBayesian(javax.mail.Folder[] good,
                              javax.mail.Folder[] spam)
                       throws java.io.IOException,
                              javax.mail.MessagingException,
                              java.rmi.RemoteException
initializeBayesian - initializes tokens based on Bayesian's algorithm. User needs to initialize Bayesian filter with a few thousand good and spam emails before using this filter.

java.io.IOException
javax.mail.MessagingException
java.rmi.RemoteException
See Also:

bayesianCheck

public boolean bayesianCheck(javax.mail.Message 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:

resetBayesian

public void resetBayesian()
                   throws java.io.IOException,
                          java.rmi.RemoteException
resetBayesian - resets all tokens used by Bayesian's algorithm.

java.io.IOException
java.rmi.RemoteException
See Also: