Work the E-mail, Part I

When it comes to e-mail, what do small organizations need? Why? And, how do you make it happen?
General Considerations and Warnings

The advantage of a centralized e-mail environment is that there is very little that can be done from a graphical interface or messed up by end users. The whole point of going through this hassle is to have e-mail configured and working always as you prefer—no matter how often you or other group members change, test or mix different clients, operating systems and locations (home, office, Internet kiosks and so on). The right way to make this happen, however, is to have as much as possible done on one server, with tools that often are controllable only by text configuration files. This task is absolutely possible without programming, as long as one is willing to spend some time tweaking configuration files and reading the right documentation.

The hardware can be an old computer stored in a closet or a Virtual Private Server (VPS) in a data center. The first solution saves both money and the environment (hardware pollutes!). The second solution is much more reliable, as downtime due to blackouts or broken hardware almost disappears. Because the configuration and tips described in this series are the same for both cases, I simply ignore that issue when dealing with setup.

To make things easier, only configuration of binary packages available for your chosen distribution are considered. You may not get the latest-and-greatest version of everything, but the convenience of not compiling anything and having automatic updates is too great to be refused, unless you are a full-time paid administrator. Therefore, I assume you already have a Linux box and know how to install binary packages on it.

The Architecture

The system requires the components shown in Figure 1. Only the desktop e-mail client runs on a computer other than the e-mail server.

Figure 1. System Requirements

The SMTP server is the piece that uses the Simple Mail Transport Protocol to accept legitimate e-mail from the outside world or to ship all the messages from authorized users, no matter how they were sent, to their final destinations. This server is assisted by several dæmons that help block spam, viruses or otherwise unwanted connections. Outgoing messages from external clients are accepted and relayed only after an authentication procedure.

After it has accepted a message, the SMTP server hands it to a local delivery agent (LDA) that places it into one or more mailboxes, according to predefined filtering criteria. The single messages are then passed to Webmail or desktop clients by an IMAP (Internet Mail Access Protocol) server. I focus on IMAP because it works the same way for both classes of clients, and it also is possible to move messages from the server to your personal computer with the POP3 protocol. Most IMAP servers also support POP3. Please note that any Webmail software requires a Web server (usually Apache) and PHP in order to run.

Our example e-mail box will serve about ten users in two different domains: and The actual applications used in this series are Postfix (SMTP), Dovecot (IMAP/POP3), Squirrelmail (Webmail) and procmail (LDA). They are not the only FOSS products suited for this task, of course, but I have found them to be an excellent combination in terms of features, documentation, great on-line support and ease of installation and configuration. Most of the concepts and tricks can be ported to other products easily, however.

Basic Postfix Concepts: Processes, Variables and Maps

Let's start looking inside our chosen SMTP server, Postfix. The anatomy of Postfix already has been described in another Linux Journal article (see Resources), so I summarize only the main points here. Postfix is actually a suite of many programs, some interacting with user processes, some running as dæmons, all controlled by a master dæmon. Usage of all the dæmons is specified, one logical line per dæmon, in a file called Logical lines can extend on more lines of the file. Local e-mail delivery, for example, can be handled by a Postfix dæmon that can write to mbox and Maildir mailboxes directly or by an external local delivery agent, such as procmail. Listing 1 shows a snippet of a typical file.


Articles about Digital Rights and more at CV, talks and bio at