Processing Outbound Mail

Being the MTA, Postfix is responsible as well for processing outbound mail. Basically, all outbound messages are placed in the incoming queue first. From there, the mail is picked up by the queue manager (qmgr) and placed in the active queue as soon as there are no other mails in that. Next, the trivial rewrite daemon determines where the mail should go: it can be for a local user, for a user on the Internet, or for a Unix user who uses UUCP to come get the mail (the latter is somewhat primitive, so I don't discuss it here). If the mail is for a local user, the queue manager orders the local delivery service /usr/lib/postfix/local to put it in the mailbox of the local user. Before doing that, it takes into account all the aliases and forwarding rules that apply to the mail. Next, the decision is up to the local daemon; this daemon has to decide where to send the mail next. It can, for example, send it to the Procmail system that analyzes the mail and puts it in the right folder. Figure 16-4 summarizes this procedure of processing mail for a local user.

Figure 16-4. Mail is processed for a local user.

When the mail is for a user on a remote system, the queue manager also fetches the mail from the incoming queue and copies it to the active queue as soon as it is empty. Next, the trivial-rewrite daemon checks to see whether the mail is for a local or a remote user. By using the lookup table, it concludes the mail must be sent somewhere else, and therefore, the queue manager activates the SMTP service that delivers the e-mail on the other server. The smtpd process next uses DNS to find the MTA for the target host and delivers it there. Figure 16-5 summarizes this procedure.

Figure 16-5. Mail is delivered to remote users.

Finally, the possibility exists that the queue manager cannot deliver an e-mail to either a local user or a remote user. If that's the case, it will be put in the deferred queue. When it is in there, the queue manager copies it to the active queue at regular intervals and tries again to deliver it, until a defined threshold is reached or the mail is delivered successfully.

Was this article helpful?

0 0

Post a comment