Dan Abernathy wrote:
> I have a lot of users here who don't want their mail filtered at all. I have
>all_spam_to whitelist entries for these people set in the site-wide local.cf file.
>
> Occasionally, SA will flag something anyway, and I guess it has to do with how the
>header is formatted. Below is an example header (with domain names and mail/IP
>addresses changed). The message triggered enough points to be ruled spam, which is
>fine, except this user is whitelisted, so SA should have let it alone regardless of
>the content. Can someone explain why SA is grabbing these, and whether or not I can
>fix it?
>
> Just FYI, the mail format warning about non-rfc compliant headers appears on EVERY
>message SA catches here. The few messages intended for whitelisted users that get
>caught all have one thing in common, the user's address ([EMAIL PROTECTED]) is
>never in the To: field. I would rather SA treat all_spam_to people completely hands
>off, no matter what the header looks like.
>
SA can only look at the headers of the message that's passed to it. If
someone gets a BCC, or if you're playing around with virtusertable or
alias entries, you're 'otta luck.
As another side effect, you'll notice that all_spam_to will cause
non-whitelisted recipients to get spam if a "all_spam_to" user is in the
To: header.
My solution was a procmail rule and an external program to decide which
messages get sent to spamassassin in the first place. I maintain a local
list of POP3 logins that are exempt from spam processing. The script is
setup so that a nonzero exit results in the message being passed to SA.
I figured that having it fail-save (processing spam) was preferable,
since less than 1% of our users want to be exempt from SA.
Procmail rule:
: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.server.name -p 783
perl 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)
$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;
};
exit 1;
--
_________________________________________________________
Rich Puhek
ETN Systems Inc.
2125 1st Ave East
Hibbing MN 55746
tel: 218.262.1130
email: [EMAIL PROTECTED]
_________________________________________________________
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk