|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.mailet.GenericMailet org.apache.james.transport.mailets.WhiteListManager
public class WhiteListManager
Manages for each local user a "white list" of remote addresses whose messages should never be blocked as spam.
The normal behaviour is to check, for a local sender, if a remote recipient is already in the list: if not, it will be automatically inserted. This is under the interpretation that if a local sender X sends a message to a remote recipient Y, then later on if a message is sent by Y to X it should be considered always valid and never blocked; hence Y should be in the white list of X.
Another mode of operations is when a local sender sends a message to whitelistManagerAddress with one of three specific values in the subject, to (i) send back a message displaying a list of the addresses in his own list; (ii) insert some new addresses in his own list; (iii) remove some addresses from his own list. In all this cases the message will be ghosted and the postmaster will reply to the sender.
The sender name is always converted to its primary name (handling aliases).
Sample configuration:
<mailet match="SMTPAuthSuccessful" class="WhiteListManager">
<repositoryPath> db://maildb </repositoryPath>
<!--
If true automatically inserts the local sender to remote recipients entries in the whitelist (default is false).
-->
<automaticInsert>true</automaticInsert>
<!--
Set this to an email address of the "whitelist manager" to send commands to (default is null).
-->
<whitelistManagerAddress>whitelist.manager@xxx.yyy</whitelistManagerAddress>
<!--
Set this to a unique text that you can use (by sending a message to the "whitelist manager" above)
to tell the mailet to send back the contents of the white list (default is null).
-->
<displayFlag>display whitelist</displayFlag>
<!--
Set this to a unique text that you can use (by sending a message to the "whitelist manager" above)
to tell the mailet to insert some new remote recipients to the white list (default is null).
-->
<insertFlag>insert whitelist</insertFlag>
<!--
Set this to a unique text that you can use (by sending a message to the "whitelist manager" above)
to tell the mailet to remove some remote recipients from the white list (default is null).
-->
<removeFlag>remove whitelist</removeFlag>
</mailet>
IsInWhiteList
Constructor Summary | |
---|---|
WhiteListManager()
|
Method Summary | |
---|---|
java.lang.String |
getMailetInfo()
Returns a string describing this mailet. |
void |
init()
Initializes the mailet. |
void |
initSqlQueries(java.sql.Connection conn,
MailetContext mailetContext)
Initializes the sql query environment from the SqlResources file. |
void |
service(Mail mail)
Services the mailet. |
Methods inherited from class org.apache.mailet.GenericMailet |
---|
destroy, getInitParameter, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WhiteListManager()
Method Detail |
---|
public void init() throws javax.mail.MessagingException
init
in class GenericMailet
javax.mail.MessagingException
- if an exception occurs that interrupts the mailet's normal operationpublic void service(Mail mail) throws javax.mail.MessagingException
service
in interface Mailet
service
in class GenericMailet
mail
- - the Mail object that contains the MimeMessage and
routing information
javax.mail.MessagingException
- - if an exception occurs that interferes with the mailet's normal operationpublic java.lang.String getMailetInfo()
getMailetInfo
in interface Mailet
getMailetInfo
in class GenericMailet
public void initSqlQueries(java.sql.Connection conn, MailetContext mailetContext) throws java.lang.Exception
conn
- The connection for accessing the databasemailetContext
- The current mailet context,
for finding the conf/sqlResources.xml file
java.lang.Exception
- If any error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |