Postfix/flow
About
There are multiple stages inside Postfix, and each stage can be affected by configuration parameters. I have not yet found a clear documentation of the data flow, but it seems to go like this (only much more complicated) under normal circumstances:
- SMTP → Postfix delivery queue → user alias mappings → local delivery (MDA, e.g. Dovecot)
However, when using virtual (non-system) users, internally-generated emails (e.g. mail from cron or PHP's mail() function) seem to bypass the alias mappings, which the MDA then rejects if they are addressed to an alias instead of a user.
A table from the official documentation is more detailed (the "-<" between the last two boxes in the original document is apparently intended to indicate rightward movement with a fan-out, i.e. the message may go through any of the 3 sub-boxes on the right; it has been replaced with "->" here).
trivial- rewrite(8) (std form) |
trivial- rewrite(8) (resolve) |
|||||||||||||
|
| |||||||||||||
smtpd(8) | >- | cleanup(8) | -> | incoming | -> | active | -> | qmgr(8) | -> | smtp(8) | ||||
qmqpd(8) | lmtp(8) | |||||||||||||
pickup(8) | local(8) | |||||||||||||
^ | |
| |||||||||||||
bounces forwarding notices |
deferred |
There are two more diagrams here; the first shows the input stage in a bit more detail, and the second shows the delivery stage. There are two more diagrams here, showing where filtering takes place.