Mapping the end-to-end email architecture: the roles of MUA, MTA, MDA, and the mailbox server, how messages flow from sender to recipient, the ports and protocols involved, and where Postfix, Dovecot, and Roundcube stand within that flow.

Episode 1 explained why our components exist. Episode 2 answers how they work together. This is the architecture map: who does what, where messages flow, and which port each service listens on.
This map matters because every configuration in episodes 3 through 22 only makes sense if you know where it fits in the flow. You don't need to memorize every parameter — just understand the architecture, and the rest follows the pattern.
We'll cover the email flow from sender to recipient, the roles of MTA and MDA, the main components on your server, and the ports and protocols involved.
Email flows through several "stations". Imagine sending a package through the post: you write the letter (client), drop it at the nearest post office (sending server), the post office ships it to the destination post office (relay), and then a courier delivers it to the recipient's house (mailbox). Here's the full picture:
MUA (client) -> MTA (send) -> MTA/relay (internet) -> MDA/LDA -> Mailbox -> MUA (read via IMAP/POP3)
| | ^
+--- SMTP 587 ---+ |
MX record points to
recipient server on port 25 In sequence:
Two different servers handle the two directions: the sending server transmits via SMTP, the receiving server stores via MDA and serves reads via IMAP.
The terms MTA and MDA are often confused. The difference is clear-cut:
Postfix itself can act as an MDA for system mailboxes (for example via mailbox_command), but for a modern architecture we hand delivery over to Dovecot LMTP — exactly what you'll assemble in episode 9.
The three core components of this series occupy different positions in the flow:
Beyond these, there are supporting components we'll install throughout the series: MariaDB/PostgreSQL for virtual users, OpenDKIM for signing, SpamAssassin, and ClamAV + Amavis for filtering.
Each service listens on a specific port. This is the table you'll refer to constantly:
| Port | Protocol | Used for | Encryption |
|---|---|---|---|
| 25 | SMTP | MTA to MTA (internet) | STARTTLS |
| 465 | SMTPS | Client submission (legacy) | TLS direct |
| 587 | Submission | Client sends email | STARTTLS |
| 143 | IMAP | Client reads mailbox | STARTTLS |
| 993 | IMAPS | Client reads mailbox | TLS direct |
| 110 | POP3 | Client downloads email | STARTTLS |
| 995 | POP3S | Client downloads email | TLS direct |
The golden rule: port 25 is only for server-to-server traffic. Your clients (Roundcube, Thunderbird, mobile apps) must use 587 to send and 993 to read. In episodes 6 and 16, this rule becomes part of both configuration and firewall policy. To see which services are listening on which ports, run ss -tlnp on the server.
Two networking concepts determine where messages go:
Checking MX records with dig becomes a habit that will stay with you throughout the series:
dig MX example.com +shortIf the output is empty, add the record in your DNS panel — episode 5 covers this in full along with SPF, DKIM, and DMARC.
One important nuance: when Postfix finds the MX record for a domain, it resolves it to a list of hosts, then tries to connect to each host according to priority. That's why a lower MX priority (for example 10) is always tried before 20. Understanding this explains a lot of seemingly mysterious "server busy" behavior in Postfix logs.
Before moving on to episode 3, take this mental map with you:
Every subsequent episode simply fills in the details at a different station — Postfix in episodes 3 and 4, DNS in 5, TLS in 6, the database in 7, webmail in 8, and so on.
Episode 2 is done. Key takeaways:
Now the map is drawn. In episode 3 we start real practice: Postfix installation and basic configuration — installing the package, understanding main.cf, and getting to know the myhostname, myorigin, mydestination, and mynetworks parameters. See you in episode 3!