Using procmail

Using Procmail

If you are running a mail server, particularly in a Linux/UNIX environment, procmail can be a very useful tool.

Procmail is one method of implementing spam and anti-virus controls.  The anti-spam package Spamassassin, and the anti-virus package ClamAV, can both be incorporated into your mail server via procmail.  Many times it is left at that, but procmail is capable of much more.  With the ability to analyze mail based on just about anything, in both the message header and body, there are a myriad of possibilities for processing mail.

At CCS, we launch Spamassassin and ClamAV, and then pass mail on or drop it based on the results of those packages.  In addition, we do various filtering based on the message headers.  A common one is checking for common addresses that spam is sent to in our domains.  These are email addresses that we do not use, but that many spam programs will generate.  Via procmail, if these addresses are used, they are fed to Spamassassin as known spam.  Spamassassin is setup to learn these messages as spam, and therefore it keeps getting better at filtering.

There are several spam tracking databases that we have referenced automatically.  The maintainers of these sites do the work to keep our filtering and checking up to date.  We use some of the following and others: BotScout, Project Honey Pot, Spamhaus, etc.  

There are other emails that we want to unconditionally accept.  These are messages sent from specific servers, or with very specific subject lines, that procmail is configured to always accept.  These rules are setup before the anti-spam rules, so that if a message matches here, it is immediately delivered.  That reduces the load on the mail server, as well as ensuring that there is no chance of the message being dropped.

Additionally, we have used procmail for vacation replies, routing support mail to different users based on dates and times, and many more situations.  It really is possible to do just about anything relating to mail filtering and processing that you can think of.

Dave.

 

Leave a Reply