I think that I'm almost there in my Auto-Whitelist implementation:

1. For each message sent from an authenticated user, I log the recipient address(es) in a DBM file, indexed by sender address.
2. For each message coming from an un-authenticated user/address, I check to see if that user/address was had previously been sent a message by the recipient address.
3. In my system-wide maildroprc script, I then check to see if the message has passed my 'autowhitelist' test, and if it has, I bypass the spam filter steps, deliverying the message directly to the user's inbox. (An alternative would be to still process the message through spam filters, but tell the filters to be less stringent in some way).


The first two steps are implemented as Courier::Filter::Modules (AuthoWhitelist.pm, CheckWhitelist.pm). I chose to use courierfilters because it gives me access to useful control information, such as the list of recipients for each message, and most importantly, whether it comes from an authenticated user or not.

The problem I am now having is: How do I communicate the results of the 'CheckWhitelist.pm' C::F::Module so that my maildrop script can determine if it has passed the autowhitelist test?

My initial attempt was to add a header to the message in the CheckWhitelist.pm filter, but I've now learned that modifying messages from within a Courierfilter is a big No-No and results in corrupted messages.

I could move all of the functionality from 'CheckWhitelist.pm' from a courierfilter to a simple perl script that is executed with 'xfilter' from maildrop, using the predefined 'FROM' and 'LOGNAME/DEFAULT' variables to perform the DBM lookup, adding the header as I stream the message back to STDOUT.

The only problem I see with this approach: In the C::F::Module, I get the sender/recipient information as full email addresses. This is the information that is used to build the DBM file of known sender-recipient relationships. In a maildrop scripts, the recipient information is only presented as a login-name (LOGNAME), home dir (HOME) or mailbox location (DEFAULT). I don't have any reliable way to convert that back into a full email address, and thus no reliable way to lookup the sender-recipient relationship information without hard-coding a domain name into the script ([EMAIL PROTECTED]).

Thanks for any advice. And when this is working, I will post a full HOWTO, sample scripts, and recipe.

-jason




------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND _______________________________________________ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to