Peter Clark wrote: > We run an in house contacts program, I've exported every email > address in it to a text file - My intention is to white list every > individual email, what's the easiest way to do this? Ideally I'd be > able to point the config to "look" at a text file that contains all > these emails, and it'll auto white list them all. Failing that, I was > going to add "whitelist_from" to the beginning of every line and > append it to the local.cf! > There are over 3000 individual email addresses - if each was added > individually to the local.cf - huge config! :)
I have implemented this by using maildrop and calling spamc from it's /etc/maildroprc maildrop has a C like scripting language and has a lookup() function which takes a look into a text file and tries to find the address from it. A snippet from my /etc/maildroprc: ------------------------------------------------------------------------------ SCAN_SPAM=1 if ( /^From:\s*(.*)/ && lookup( $MATCH1, "/usr/etc/maildrop_sender_whitelist", "D" )) { xfilter "reformail -a'X-Whitelisted: $MATCH1 in /usr/etc/maildrop_sender_whitelist'" SCAN_SPAM=0 } if ( $SCAN_SPAM > 0 ) { xfilter "spamc -H -x -d spamd -u spam" } else { xfilter "reformail -a'X-Whitelisted: because some reason earlier in /etc/maildroprc'" } ------------------------------------------------------------------------------ The script has variable SCAN_SPAM which is set to 0 (false) by several checks and the system calls SpamAssassin only when necessary. The script as shown works with maildrop 2.x, it has to be altered a bit when used with older versions. Maildrop replaces the more usual procmail in the mail delivery chain. The file maildrop_sender_whitelist contains email addresses (or regexp) one on a line, it would be ideal for your purpose.