Book Image

Qmail Quickstarter: Install, Set Up and Run your own Email Server

Book Image

Qmail Quickstarter: Install, Set Up and Run your own Email Server

Overview of this book

This book starts with setting up a qmail server and takes you through virtualization, filtering, and other advanced features like hosting multiple domains, mailing lists, and SSL Encryption. Finally, it discusses the log files and how to make qmail work faster. Qmail is a secure, reliable, efficient, simple message transfer agent. It is designed for typical Internet-connected UNIX hosts. Qmail is the second most common SMTP server on the Internet, and has by far the fastest growth of any SMTP server. Qmail's straight-paper-path philosophy guarantees that a message, once accepted into the system, will never be lost. Qmail also optionally supports maildir, a new, super-reliable user mailbox format.
Table of Contents (13 chapters)

qmail-smtpd and the QMAILQUEUE Patch


Receiving email from the network via the SMTP protocol is perhaps the most common use of qmail. As described before, qmail-smtpd is run by another program that handles all the networking details. The behavior of qmail-smtpd is affected by environment variables. For the purpose of this book, discussion is limited to using tcpserver with qmail-smtpd, but the basic techniques discussed here apply to whatever software is used in its stead.

Accepting or Rejecting Email

When a remote machine connects and talks to qmail-smtpd, qmail-smtpd has two primary responsibilities: determining whether the message should be accepted, and if it should, then handing the message to qmail-queue for injection into the on-disk queue. qmail-smtpd uses four key pieces of information to decide whether to accept each message and hand it to qmail-queue:

  1. 1. The recipients of the message

  2. 2. The existence of the RELAYCLIENT environment variable

  3. 3. The size of the message

  4. 4. The message...