Anti-Spam-PHP

Anti-Spam-PHP version

posted Jan 11, 2010, 3:48 PM by Chris Franklin

What Anti-spam does is scan every incoming email with Spamassassin. 
And if it scores high enough as spam (score setup by you!). then it 
will return a "550 I'm Sorry but your email was classified as SPAM by our
Server." Error During the smtp transaction.
The other server / senders program will then interpret the 550 as a 
mailbox unevailble Or user does exist. and not try to send that person 
that email again. And the sender will get and email from his server 
letting him know that the email couldn't be delivered due to the 
fallowing error :).

I will say that this has really reduced to amount of spam that even trys to
come into my domains. I believe this is to the programs that spammers are
using now a days. I think they record witch address where deemed undeliverable
and after so many trys it removed that address from it's records :)

Installing:
1. edit your filter.post-data.tab and enter in this line:
"!aex" "/var/MailRoot/filters/anti-spam.php" @@FILE" "@@REMOTEADDR" "@@USERAUTH" "DELETE_SCORE" "MAX_FILESIZE" "SA_HOST" "SA_PORT" "REJECT_ON_SA_GONE"
(Those are TAB's that are between thoses vars)


DELETE_SCORE : This the sore at which the emails will be deleted 
MAX_FILESIZE : Files this size or bigger won't be sent to SA
SA_HOST : This is hostname or IP of the SA deamon (setting this to just NULL or just "" will set it to 127.0.0.1 )
SA_PORT : Port SA is running on (setting this to just NULL or just "" will set it to 781 )
REJECT_ON_SA_GONE : Setting this to anything other then NULL or "" will cause filter to ask the remote server to try to the the email again later due to SA not being ALIVE 

2. download the anti-spam.phps and put it into your /var/MailRoot/filters dir.
3. rename anti-spam.phps TO anti-spam.php
3. make sure your anti-spam.php is chmod'ed at least 111


Requiremnts:
1. php
2. SA (Spamassassin) deamon
3. SA conigured to add the "X-Spam-Level:" AND / OR "X-Spam-Score:"headers.


Pros:
1. helps filter out spam (go figure)
2. Doesn't scan outgoing mail only incoming (aka and mail not coming from a
Authed person or localhost)
3. Won't scan email of Max_size or bigger (in megs. default id 1.4)
4. It's FASTER then just running spamc 

Cons:
1. Slows down smtp transaction (no where near enough to cause time outs)
2. ...?

1-1 of 1