Introduction

Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail to various destinations. Postfix consists of a combination of server programs that run in the background, and client programs that are invoked by user programs or by system administrators (See Figure 1).

The Postfix core consists of several dozen server programs that run in the background, each handling one specific aspect of email delivery. Examples are the SMTP server, the scheduler, the address rewriter, and the local delivery server. For damage-control purposes, most server programs run with fixed reduced privileges, and terminate voluntarily after processing a limited number of requests. To conserve system resources, most server programs terminate when they become idle.

Client programs run outside the Postfix core. They interact with Postfix server programs through mail delivery instructions in the user's ~/.forward file, and through small "gate" programs to submit mail or to request queue status information.

Other programs provide administrative support to start or stop Postfix, query status information, manipulate the queue, or to examine or update its configuration files.

Figure 1 : The Postfix mail server architecture

Postfix manages pipelines of processes that pass the responsibility for message delivery and error notification from one process to the next. All message and notification "state" information is persisted in the file system. The processes in a pipeline operate mostly without centralized control; this relative autonomy simplifies error recovery. When a process fails before completing its part of a file or protocol transaction, its predecessor in the pipeline backs off and retries the request later, and its successor in the pipeline discards unfinished work. This approach makes Postfix highly resilient, as long as the operating system or hardware don't fail catastrophically.

Figure 2 : The layer model of Postfix

Each layer of Figure 2 is mapped to a variety of tests each of which report a wealth of metrics related to the queues of the Postfix mail server. Using these metrics administrators can find quick and accurate answers to the following queries:

  • What is the total size of the active queue?
  • In which time duration, the number of messages in the active queue were the highest - is it less than 5 minutes? between 5 and 10 minutes? between 10 and 20 minutes? between 20 and 40 minutes? between 40 and 80 minutes? between 80 and 160 minutes? between 160 and 320 minutes? between 320 and 640 minutes? between 640 and 1280 minutes? or is it above 1280 minutes?
  • What is the total size of the incoming queue?
  • In which time duration, the number of messages in the incoming queue were the highest - is it less than 5 minutes? between 5 and 10 minutes? between 10 and 20 minutes? between 20 and 40 minutes? between 40 and 80 minutes? between 80 and 160 minutes? between 160 and 320 minutes? between 320 and 640 minutes? between 640 and 1280 minutes? or is it above 1280 minutes?
  • What is the total size of the hold/deferred/maildrop queues?
  • In which time duration the number of messages in the hold/deferred/maildrop queues were the highest - is it less than 5 minutes? between 5 and 10 minutes? between 10 and 20 minutes? between 20 and 40 minutes? between 40 and 80 minutes? between 80 and 160 minutes? between 160 and 320 minutes? between 320 and 640 minutes? between 640 and 1280 minutes? or is it above 1280 minutes?