You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Kenneth Andresen <ke...@cancun.net> on 2005/02/24 00:54:09 UTC

Outgoing spam filter

Hello all,

I have made a bash script for scanning outgoing mail from all
the Squirrelmail users on my server using procmail. It is based
upon a script I got from Andrzej Adam Filip from the the 
spamassassin mailing list. 

It is possible to modify it to take care of all mails sendt by 
the sendmail binary, and some of you might know how to intercept
messages sent from a mail client program as well. 

I am currently sending all the squirrelmail outgoing mails to a 
specially designed procmail filter, which will run a new script 
for actually sending the mail, or block the mail/punish the 
user who sent the spam. 

The filter to point to with either ./config/config.php (in the
squirrelmail folder) or point to by /usr/sbin/sendmail, followed
by my outgoing procmail filter, which with spamassassin and YAVR
from <http://agriroot.aua.gr/~nikant/nkvir/>.

The block sender script is virtually identical to the 
acceptedmailtodeliver.sh script, except that extracts the
username and ip of the person who sent the mail, lock the user
account with passwd -l $spammingaccount, and put the ip in a 
quarantine file which will block the ip if a second spam is 
tried sent within *short* time from the same ip. 

The script must be viewed as a beta, and I would like some 
feedback from others who are interested in such a script, have
improvements to the code, or know of better ways to accomplish
what am trying to do. 

My own longer term idea is to make it a more general filter
for being able to automatically enforce outgoing mail policies. 


Best regards,
Kenneth Andresen