Posted by ugob on Wed 29 Jun 2005 at 20:46
Despite the fact that I have more experience with RedHat, I configured a Spam/Virus filtering system on Debian recently and I thought I should share some knowledge with the community.
My package of choice is MailScanner (and its friends) and I thought I could offer some guidance to people who whish to configure a similar system. MailScanner is a very powerful, scalable and robust, open-source e-mail security package. It processes more than 500 million e-mail messages every day, and is used in more than 20,000 sites around the world.
MailScanner scans all e-mail for viruses, spam and attacks against security vulnerabilities. It is not tied to any particular virus scanner, but can be used with any combination of 14 different virus scanners, allowing sites to choose the "best of breed" virus scanner. (http://www.mailscanner.info)
I'll base this article on Sarge, as it was just released and include a rather recent version of the tools we need. The server was running Postfix, so this is the MTA I'll use here as well.
The first thing to do is to make sure your system is up to date, using apt or aptitude. Then, the fun begins:
For the curious, this tells postfix to accept incoming mail and put it in the hold queue. Then, MailScanner takes the messages there, process them, and then put it back into the incoming queue, so that postfix can deliver them to the recipients .
There, you now have a mail filtering system. Every e-mail is scanned by 2 virus engines, by MailScanner for HTML and other vulnerabilities, and by SpamAssassin to filter out spam.
Is it finished yet?
Not really. MailScanner is very powerfull and complex, so you have to learn about what you can do with it and how. The first step is to read MailScanner.conf and do some tests. Also, e-mail security is an ever-evolving topic so you must update your system often, and try to find the more recent version of software. Debian Volatile can help with that, or sometimes you may be better compiling from source.
Then, there is a wiki where you can get a lot of information. I suggest you start by reading the MAQ page (which I inciendally created and maintain), and then go in the documentation section for more in-depth tricks.
BTW, MailScanner can work with Exim, Sendmail, Qmail and Zmailer as well.
If you have any questions, you'll find that the MailScanner mailing list is very helpfull.
Finally, please let me know if you find an error in this procedure and I'd appreciate to have any feedback on this article.
Ugo
This article can be found online at the Debian Administration website at the following bookmarkable URL (along with associated comments):
This article is copyright 2005 ugob - please ask for permission to republish or translate.