Email Messaging Protocols
Email messaging protocols are crucial for sending and receiving emails over a network. This guide explains the roles of SMTP, POP, and IMAP in email communication, focusing on their functions, ports, and interactions with email clients and servers.
Key Points
- Understand how emails are sent and received
- Identify the roles of SMTP, POP, and IMAP
- Learn the interaction between email clients and mail servers
- Know the ports and transport protocols used
- Distinguish between sending and retrieving emails
Key Concepts
A system for storing, sending, and receiving electronic messages over a network.
Email Client (Mail User Agent – MUA)
Software installed on a computer that allows users to send, receive, and read emails. Examples include Outlook and Thunderbird.
Mail Server
A server responsible for storing, forwarding, and delivering emails.
SMTP (Simple Mail Transfer Protocol)
An application-layer protocol used to send and relay emails between clients and mail servers.
POP (Post Office Protocol)
A protocol used by clients to retrieve emails from a mail server, typically downloading them locally.
IMAP (Internet Message Access Protocol)
A protocol used to access emails directly on the server, keeping them synchronized across devices.
Detailed Explanations
Role of SMTP
SMTP is responsible for sending emails. It is used:
- When a user sends an email from an email client
- When mail servers transfer emails between themselves
SMTP works at:
- OSI Layer 7 (Application)
- Uses TCP at OSI Layer 4
- Default port: TCP 25
Email Message Structure
An SMTP message is composed of two main parts:
| Part | Description |
|---|---|
| Header | Metadata: sender address, recipient address, subject |
| Body | The actual content of the email |
Both sender and recipient email addresses must be valid for the transfer to succeed.
Sending an Email (SMTP Flow)
- The user writes an email in an email client.
- The client sends the email using SMTP.
- The email is transmitted to the sender’s mail server.
- The sender’s mail server forwards the email to the recipient’s mail server.
- The recipient’s mail server stores the email.
SMTP is not used to read emails, only to send and relay them.
Receiving Emails: POP vs IMAP
Once the email is stored on the recipient’s mail server, the recipient must retrieve it. This is done using POP or IMAP, not SMTP.
POP (Post Office Protocol)
- Purpose: Download emails from the server
- Transport protocol: TCP
- Default port: TCP 110
- Behavior:
- Emails are typically downloaded to the local computer.
- Messages may be deleted from the server after retrieval.
POP is simple but not well-suited for multiple devices.
IMAP (Internet Message Access Protocol)
- Purpose: Access and manage emails directly on the server
- Transport protocol: TCP
- Default port: TCP 143
- Behavior:
- Emails remain on the server.
- Clients synchronize message state (read, unread, folders).
IMAP is preferred when using multiple devices.
Important Distinction: Webmail vs Email Client
Webmail services (e.g., Gmail via a browser):
- Do not require an installed email client.
- Access emails via HTTP/HTTPS, not POP or IMAP.
Email clients:
- Use SMTP to send emails.
- Use POP or IMAP to retrieve emails.
Schemas / Explanatory Diagrams
Email Sending and Receiving Flow
Sender Client
|
| SMTP (TCP 25)
v
Sender Mail Server
|
| SMTP
v
Recipient Mail Server
|
| POP (110) or IMAP (143)
v
Recipient Client
Protocol Roles Summary
| Protocol | Function | Direction |
|---|---|---|
| SMTP | Send / relay emails | Client → Server, Server → Server |
| POP | Download emails | Server → Client |
| IMAP | Access emails | Server ↔ Client |
Common Pitfalls and Misconceptions
- Thinking SMTP is used to receive emails (it is not).
- Confusing email clients with webmail.
- Forgetting that POP and IMAP are client-side retrieval protocols.
- Assuming emails move directly from sender to recipient computer.
- Mixing up application-layer protocols and transport-layer ports.
Practical Example
Corporate Email Scenario
- An employee sends an email using Outlook.
- Outlook sends the message via SMTP.
- The company mail server relays the email to the recipient’s mail server.
- The recipient opens Outlook.
- Outlook retrieves the email using IMAP.
- The email appears in the inbox.
Key Takeaways (Quick Summary)
- Email protocols operate at OSI Layer 7.
- SMTP is used to send and relay emails.
- POP and IMAP are used to retrieve emails.
- SMTP uses TCP port 25.
- POP uses TCP port 110.
- IMAP uses TCP port 143.
- Email clients rely on multiple protocols.
- Webmail works differently from installed email clients.
Learn More
- RFC 5321 – Simple Mail Transfer Protocol (SMTP)
- RFC 1939 – Post Office Protocol Version 3 (POP3)
- RFC 3501 – Internet Message Access Protocol (IMAP)
- ISO/IEC 7498-1 – OSI Model
- Cisco Email and Messaging Fundamentals
- IETF Protocol Documentation