Wess Bechard wrote:
I have modified procmail to check for .spamcheck in the user's home dir. If this file is found, spamc is called. Seems to work so far.
I would still rather use a managable file that lists users.
Would anyone out there know how to make procmail check a list for a username?
The following setup works for me. It's a bit of a kludge, but it's held up well under heavy use. I tried to ensure that failure of anything allong the line results in processing through SA.
FWIW: all spam to has issues in this application in the case of multiple recipients. I believe the issue was having an "all_spam_to" person along with a regular person in the To: header didn't do the right thing. This was my solution after a couple of angry calls.
--Rich
#/etc/procmailrc setup: ################# # # # SpamAssassin # # # ################# :0fw # skip passing to spamc/spamd if user is on # exempt list, or if message is really big. # all_spam_to has problems, and why burden # the server w/large messages if we can # catch them here! * < 500000 * ! ? /usr/local/bin/nospam.pl $LOGNAME |/usr/bin/spamc -s 100000 -d <SPAMD SERVERNAME> -p 783
The script:
#!/usr/bin/perl # # nospam.pl -- accept username as option, # check a list of names, see if # user wants spam scanning or not # 0 = skip scanning # nonzero = scan (fail "safe" so that # majority of users are scanned) # [EMAIL PROTECTED]
$userfile="/etc/spamassassin/exempt"; $found="false";
$user=$ARGV[0];
open USERS,$userfile or die "unable to open $userfile $!\n";
while (<USERS>) {
next if ( /^#/ );
if ( /^$user$/ ) {
$found="true";
last;
};
};close USERS;
if ( $found eq "true" ){
exit 0;
};#print "exiting w/spam checking!\n"; exit 1;
