Future articles in this series will detail how to implement the system within your existing network. In upcoming articles, this email system will come together with topics covering:
- SMTP and IMAP with MySQL
- Procmail, Bogofilter, and Amavis
- SquirrelMail and Web configuration
- Mailing lists
- Remote email access
The heart of email is Simple Mail Transfer protocol (SMTP). E-mail travels from server to server across the Internet through message transfer agents (MTAs) speaking SMTP to each other. The granddaddy of all MTAs is a program called Sendmail, which has grown organically over the years to become a powerful, confusing, easy-to-mismanage beast. Sendmail is not for the faint hearted. Fortunately for us mortals, several alternative MTAs are now available. Three of the most popular newer MTAs are Postfix, Exim, and Qmail. I prefer Postfix because of its reputation for stability, security, ease of administration, and high performance. Postfix can deliver directly to a standard Unix mailbox (one file with new emails appended) or to a Maildir folder (one directory for each mail "folder," with a single file for each email). Procmail
Valid email eventually ends up at the receiving MTA. That MTA must know what to do with the email. The MTA hands the email off to a local delivery agent (LDA), which is responsible for storing the email until the user retrieves it. Postfix has its own basic LDA built in, but by configuring it to hand email off to Procmail, you can continue processing it through spam filters and user rules. Procmail is much more than a mail delivery agent. It distributes mail based on "recipes." For this system, Procmail routes incoming messages through SpamAssassin and then through user-defined recipes. Maildrop is a similar, newer LDA with what may be a more familiar-looking configuration -- but Procmail is ubiquitous and works well. SpamAssassin
The spam arms race grows ever more sophisticated. The latest technology available is Bayesian spam filtering. Rev. Thomas Bayes, an amateur mathematician in England in the mid-1700s, developed a formula for calculating probabilities based on statistics about contributing factors. Paul Graham, in a now-famous essay "A Plan for Spam," outlined a method using Bayesian statistics for collecting data about the frequency of words in a body of email to create an effective content filter. Bayesian spam filters promise more accurate spam detection, with fewer false positives (email that gets classified as spam that isn't). The downside of these "intelligent" filters is that they must be "trained" with email guaranteed to be either spam or not spam before they become effective. SpamAssassin is becoming a de-facto standard for fighting spam based on specific phrases, headers, and other recognisable patterns in the email. In version 2.5, SpamAssassin added Bayesian filtering to its arsenal. Since it comes preconfigured with hundreds of existing rules, it can train the Bayesian filter on known spam, and block much of the spam out there with little attention by the user.






