Patch for Qmail.
In many cases we dont need to scan messages for authenticated users. If user IP is in CBL or in RBL
spamassasin increase score and the message is mark as spam or is not send. I asume all authenticated users are clean.
Now, how do we know that the user is SMTP authenticated? Simply by checking if TCPREMOTEINFO environment variable is set.
The fix turned to be quite simple. It adds another debug log messages, skips mail scanning if TCPREMOTEINFO is set except if QS_SPAMASSASSIN forces scanning:
-----------------------------------------------------------------------------------------------
--- qmail-scanner-queue.pl.bak 2010-05-17 11:28:21.000000000 +0300 +++ /usr/local/bin/qmail-scanner-queue.pl 2010-05-15 16:35:52.000000000 +0300 @@ -2599,11 +2605,17 @@ #Don't bother if this is going to be quarantined return if ($quarantine_event); - #Only run SA if mail is from a "remote" SMTP client, or QS_SPAMASSASSIN + #Only run SA if mail is from a "remote" SMTP client which is not SMTP athenticated, or QS_SPAMASSASSIN #is defined via tcpserver... - if ($QS_RELAYCLIENT && !$ENV{'QS_SPAMASSASSIN'}) { - &debug("spamassassin: don't scan as RELAYCLIENT implies this was sent by a local user"); - return; + if (!$ENV{'QS_SPAMASSASSIN'}) { + if ($QS_RELAYCLIENT){ + &debug("spamassassin: don't scan as RELAYCLIENT implies this was sent by a local user"); + return; + } + if ($ENV{'TCPREMOTEINFO'}){ + &debug("spamassassin: don't scan as TCPREMOTEINFO implies this was sent by a SMTP AUTHenticated user"); + return; + } } #SpamAssassin client scanner my ($spamassassin_found,$spamassassin_status);
--------------------------------------------------------------------------------------------------------------------------------------
source
Niciun comentariu:
Trimiteți un comentariu