Yesup
 

Free Anti-Spam solutions for Windows and Linux

How to incorporate SpamAssassin Engine to e-Mail Servers 

I. What is SpamAssassin

SpamAssassin is the powerful #1 Open-Source Spam Filter. It can be natively installed on various flavors of Linux, and  then integrated into SendMail/ProcMail. With some additional efforts, it can be used with Windows SMTP Services too.

You can configure SpamAssassin to take different actions to the SPAM e-mails. You can drop them outright, put them into a special SPAM folder, or mark some thing like "[SPAM]" in the Subject line and let the end users make the final decision of how to dispose them. The last approach is recommended as it is more flexible, and safer. We will focus on this approach only.

We also assume the e-mails are scanned by SpamAssassin at the server, not at the client, such that it is easier to maintain (fewer machines to install) and more efficient (actions taken closer to the SPAM source). The Clients who are receiving scanned e-mails can be:

  • POP3/IMAP Client, like Outlook Express, Eudora, Etc.
  • Microsoft Outlook Client
  • Web Mail Client, like SquirellMail Client, or YamaMail

Once the e-Mail clients receive the mails marked with [SPAM] in the subject line, they can setup some e-mail rules to filter them to a  special folder, or delete them outright. It is recommended to put them to a SPAM folder for a few days just in case.

Your Ad Here

II. SpamAssassin on Windows SMTP Services

If you are Windows People, you can setup simple e-mail systems without buying heavy-duty e-Mail Servers like Microsoft Exchange Server. Since all Window Servers (2000 and 2003) have SMTP Services available. With SMTP Service plus either built-in POP3 service (Server 2003), or 3rd party free POP3 Service like Baby POP3, or a Free Web based e-mail Service like YamaMail, you are all set. We are not going to discuss how to setup "Vanilla Windows Server" based e-mail service here. We are focusing on anti-spamming.

The idea behind the Windows SMTP Service based SpamAssassin setup is called Transport Event Sink.  When Windows SMTP receives an e-mail, if will pass it to the registered Event Sink to do further process before it conduct the normal receiving process. If the Event Sink can invoke SpamAssassin to get the e-mail scanned before passing it back to normal route, then we have seamlessly integrate Windows SMTP Services with SpamAssassin.

So there are two things need to be done:

  1. Install SpamAssassin on Windows. Described here or here .
  2. Install the Event Sink to trap the event OnArrival. Instructed here .

Well, we are almost there after these steps.

In order to allow [SPAM] marked at the beginning of the subject line, we will need to do the following: Let's assume the Perl processsor is installed on c:\Perl, the we will need to edit the file c:\Perl\Site\etc\mail\spamassassin\Local.cf

Make sure the line:

rewrite_header Subject [SPAM]

is uncommented.

Also, for Windows 2000 Server only, if you are going to send e-mails from this server too, via Web Based e-mail. You may want to consider modifying the rule in the file Install_ESA_Sink.bat under your ESA folder from:

"mail from= *"

to

"rcpt to=*@yourdomain.com" (where yourdomain.com is your domain name)

The reason is, the sent mail will also seem to trigger OnArrival event if we do not qualify the recipients.  The rule: rcpt=*@yourdomain.com will let the EventSink to be triggered only when the recipients are on your domain. With this rule, the outgoing e-mails will not be scanned and altered.

It is not the perfect solution, but seems to work for me so far.

Anti-Spam is great, but Windows SMTP service has a weakness of not doing filter recipients at the protocol level. It receives the e-mail to whatever on this domain, without checking if this person exists.

If POP3 service is installed, the e-mails recipietns who do not have the internal POP3 mailbox will be sent back to the senders, to notify the sender that the users do not exist. In most cases, as you know, the e-mails get rejected, as most of them are non-replyable ones.

So the Windows SMTP Services receives mails, send back mails, then get rejected, then re-try several times before it finally put them into BadMail folder. What a waste of CPU and internet bandwidth!

To cure this, we have developed yet another Event Sink to reject the e-mail right at the front, without even let the e-mails in, if the e-mail users is not in a XML file called SMTPUsers.xml in Windows System folder. It works fine if you only use this server to receive e-mails. If you also send e-mails via this server, the recipient names will also be filtered by this Event Sink. Please also note that the user names in SMTPUsers.xml will need to be lower case only. This Event Sink works under .Net Framework 1.1, you can download it from here . For more information about this product, please contact us.

Your Ad Here

III. SpamAssassin on Linux Sendmail Server

With Sendmail, SpamAssassin can be called for every user by editing /etc/procmailrc . More details at  http://www.stearns.org/doc/spamassassin-setup.current.html#sitewide

 

IV. How about Anti-Phishing

SA Spoof Guard, a SpamAssassin Plugin for Phishing email filtering, can be plug into the existing SpamAssassin to filter the potential Phishing Mails.

BrotherSoft
Anti Spam WinASP Web2Image Skype Gateway Dashboard Chart OE6 COM/ActiveX