Email Protocols — SMTP, POP3, IMAP4
Email looks simple from the outside — type a message, press send, it arrives. Underneath, it is a relay race between four different roles and three different protocols. This lesson gives you the canonical names (MUA, MTA, MDA), the exact port numbers, and the one decision that changes everything: POP3 downloads and deletes, IMAP4 leaves mail on the server and keeps every device in sync.
The three email roles
Email is a store-and-forward system, and it is built from three canonical roles. Learn these names exactly — the exam uses them, and they never change between vendors.
MTA (Mail Transfer Agent) — the relay. It moves messages from one mail server to another using SMTP. This is the “post office” of email.
MDA (Mail Delivery Agent) — the local delivery agent. It places the incoming message into the recipient’s mailbox on the server.
The MUA never talks directly to the recipient’s mailbox. It hands the message to a server, and servers hand it along a chain of relays until an MDA files it away. That separation is what lets a message cross networks that know nothing about each other.
The journey of a sent email
Here is the full path of a message from Alice to Bob, using the canonical roles. Two separate protocol families are in play: sending (SMTP) and retrieving (POP3 or IMAP4).
- Alice composes the message in her MUA and presses Send.
- The MUA submits the message to Alice’s server MTA (the MSA role), usually on TCP 587.
- Alice’s MTA looks up Bob’s domain and relays the message over SMTP on TCP 25.
- Bob’s MTA receives the message and, if it is also the final server, hands it to the MDA.
- The MDA delivers the message into Bob’s mailbox on the server, where it waits.
- Bob’s MUA retrieves the message with POP3 (110/995) or IMAP4 (143/993).
SMTP: sending and relaying
SMTP (Simple Mail Transfer Protocol) is the application-layer protocol that sends and relays email. It is defined in RFC 5321. SMTP is a push protocol: the sender initiates the connection and pushes the message toward its destination.
SMTP is text-based. A session is a short conversation of commands and replies. The key commands are EHLO (identify yourself, extended mode), MAIL FROM (the sender), RCPT TO (a recipient), and DATA (the message body). A typical relay looks like this:
S: 220 mail.example.com ESMTP ready C: EHLO client.example.net S: 250-mail.example.com greets you C: MAIL FROM:<alice@example.net> S: 250 OK C: RCPT TO:<bob@example.com> S: 250 OK C: DATA S: 354 Start mail input; end with <CRLF>.<CRLF> ! ...message headers and body... C: QUIT S: 221 Bye
Notice that SMTP only transfers the message. It has no concept of folders, read receipts, or “leave a copy on the server”. Those are decisions made later, by whichever retrieval protocol the recipient chooses.
Message submission (587)
The port an MUA uses to hand a new message to its own server is not the same as the port two servers use to relay to each other. That distinction is a favourite exam topic.
| Path | Role | Port | Notes |
|---|---|---|---|
| Client → server | MUA → MSA/MTA | 587 | Message submission; requires authentication; usually STARTTLS. |
| Server → server | MTA → MTA | 25 | Server relay; the classic SMTP port. |
Port 587 is reserved by IANA for submission. Because it expects the user to authenticate, it is the correct port for mail clients sending through a provider. Many ISPs and corporate networks block outbound port 25 from client devices (to stop spam and malware) while leaving 587 open for legitimate submission. Internet mail servers still use 25 to talk to one another.
POP3 vs IMAP4
POP3 (Post Office Protocol version 3) is defined in RFC 1939. Its model is simple: the client connects to the server, downloads the messages, and by default deletes them from the server. Mail lives in one place — the device that downloaded it.
- Download-and-delete — the default behaviour. Great for a single device and for saving server storage.
- Lightweight and offline — once downloaded, the messages are on the client and readable without a connection.
- No server-side folders — POP3 manages a single inbox on the server, not a folder tree.
IMAP4 (Internet Message Access Protocol version 4) is defined in RFC 3501. Its model is the opposite of POP3: the messages stay on the server, and the client keeps a synchronised view of them. Folders, read/unread flags, and deletions are all reflected back to the server.
- Leave-on-server — the authoritative copy of the mailbox is the server, not the client.
- Sync across devices — laptop, phone and webmail all see the same folders and the same read state.
- Server-side folders — you can organise mail into folders on the server, and the client mirrors them.
| Behaviour | POP3 | IMAP4 |
|---|---|---|
| Mail location | Downloaded to the client | Kept on the server |
| Default action | Download and delete | Leave on server, sync |
| Multi-device | No — each device is separate | Yes — all devices share one mailbox |
| Folders | Client-side only | Server-side, mirrored to clients |
| Plaintext port | TCP 110 | TCP 143 |
| TLS port | TCP 995 (POP3S) | TCP 993 (IMAPS) |
| Storage | Low server use | Higher server use |
| Best for | A single device, offline reading | Multiple devices, webmail, sync |
Implicit TLS vs STARTTLS
None of the mail protocols were originally encrypted, so there are two ways to add TLS. Watch the handshake for each.
- Implicit TLS — the client connects and TLS is negotiated from the very first byte, on a dedicated port. Examples: SMTPS 465, POP3S 995, IMAPS 993. The “S” stands for secure.
- Explicit TLS (STARTTLS) — the client connects in cleartext to the normal port, then issues a
STARTTLScommand to upgrade the connection to TLS. Used on SMTP 25/587, POP3 110, IMAP4 143. This keeps one port able to serve both encrypted and unencrypted clients.
Review
Check what you have learned with these review questions.
Sources & references
- Klensin, J. RFC 5321: Simple Mail Transfer Protocol (2008). rfc-editor.org/rfc/rfc5321.
- Crispin, M. RFC 3501: Internet Message Access Protocol — Version 4rev1 (2003). rfc-editor.org/rfc/rfc3501.
- Myers, J. & Rose, M. RFC 1939: Post Office Protocol — Version 3 (1996). rfc-editor.org/rfc/rfc1939.
- IANA. Service Name and Transport Protocol Port Number Registry. iana.org.
- Cisco. CCNA (200-301) Exam Topics, IP Services. cisco.com.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.