< Previous | Contents | Next >
5. Mail Filtering
One of the largest issues with email today is the problem of Unsolicited Bulk Email (UBE). Also known as SPAM, such messages may also carry viruses and other forms of malware. According to some reports these messages make up the bulk of all email traffic on the Internet.
This section will cover integrating Amavisd-new, Spamassassin, and ClamAV with the Postfix Mail Transport Agent (MTA). Postfix can also check email validity by passing it through external content filters. These filters can sometimes determine if a message is spam without needing to process it with more resource intensive applications. Two common filters are opendkim and python-policyd-spf.
• Amavisd-new is a wrapper program that can call any number of content filtering programs for spam detection, antivirus, etc.
• Spamassassin uses a variety of mechanisms to filter email based on the message content.
• ClamAV is an open source antivirus application.
• opendkim implements a Sendmail Mail Filter (Milter) for the DomainKeys Identified Mail (DKIM) standard.
• python-policyd-spf enables Sender Policy Framework (SPF) checking with Postfix.
This is how the pieces fit together:
• An email message is accepted by Postfix.
• The message is passed through any external filters opendkim and python-policyd-spf in this case.
• Amavisd-new then processes the message.
• ClamAV is used to scan the message. If the message contains a virus Postfix will reject the message.
• Clean messages will then be analyzed by Spamassassin to find out if the message is spam. Spamassassin will then add X-Header lines allowing Amavisd-new to further manipulate the message.
For example, if a message has a Spam score of over fifty the message could be automatically dropped from the queue without the recipient ever having to be bothered. Another, way to handle flagged messages is to deliver them to the Mail User Agent (MUA) allowing the user to deal with the message as they see fit.