This chapter covers the output end of the qmail mail system, or how email is delivered by qmail and how it leaves the message queue. The following figure describes this part of the overall structure of qmail described in Chapter 1.
The primary function of the on-disk queue is to serve as a reliable storage and signaling mechanism for the qmail-send
program, which is the heart of the qmail queuing system. The qmail-send
program's most fundamental task is to make the primary routing decision: whether a given email should be delivered locally or remotely. This decision is made exactly once per recipient, and is stored in the queue with the email.
The qmail-send
program can be thought of as a military general, commanding the qmail delivery army. As a general, it has two sergeants: qmail-lspawn
and qmail-rspawn
. Depending on whether a given email should be delivered locally or remotely, delivery commands for that email...