The Rules of E-mail Protocols
Learn the behind-the-scenes rules that allow emails to be sent and received.
Knowledge of Computers › Internet and E-mail · 20 min read
The Illusion of Instant Mail
In the previous chapter, we mastered the art of writing and sending e-mails. You type out your message, attach a file, add a recipient to the "To" field, and click "Send." Within seconds, your friend on the other side of the country—or the other side of the world—gets a notification on their phone.
It feels like magic. It feels like your computer simply threw a digital paper airplane directly into their computer.
But behind that single click of the "Send" button lies a massive, highly orchestrated relay race. Your email does not travel directly from your laptop to your friend's phone. Instead, it gets handed off through a series of specialized servers, much like a physical letter moving from a red street mailbox, to a local post office, to a sorting facility, onto an airplane, and finally into the recipient's mailbox.
To make this complex relay race work flawlessly millions of times a second, computers need strict rules. They need to know exactly how to say "I have a message for you," how to verify who the message is from, and how to hand it over. In the world of computers, these strict sets of rules are called protocols.
In this chapter, we are going to pull back the curtain on the internet's postal service. We will learn the three major protocols that make email possible: one for sending (SMTP), and two for receiving (POP3 and IMAP). By the end of this reading, you will understand exactly how email routing works, why your email app asks for "Port numbers," and why setting up your inbox the right way can save you a massive headache when you buy a new phone.
What Exactly is a Protocol?
Before we dive into the specific rules of email, we need to understand what a protocol is in a general sense.
Imagine you are calling a busy customer service helpline. When the agent picks up, you don't just start shouting your home address and your problem. There is an unspoken social protocol:
- 1The agent says, "Hello, how can I help you?"
- 2You say, "Hi, I have a problem with my bill."
- 3The agent says, "May I have your account number?"
- 4You provide the number.
If you break this sequence—if you just start shouting numbers the second the phone connects—the agent will be confused, and the communication will fail.
Computers are exactly the same, but they are entirely literal. They have no intuition. If one computer wants to send a file to another, they must follow a rigid, pre-programmed script.
For email, we need protocols to handle two completely different jobs:
- 1Pushing the email away from the sender and routing it across the internet to the correct destination.
- 2Pulling the email down from the destination server so the recipient can read it.
Let's meet the cast of characters that use these protocols.
The Cast of Characters: MUAs, MTAs, and MDAs
To understand email protocols, you first need to know who is doing the talking. When you send an email, three different types of software programs work together. They have technical-sounding names, but their jobs are very simple.
1. The MUA (Mail User Agent)
This is simply your email app. It is the software you interact with directly. Microsoft Outlook, Mozilla Thunderbird, the Apple Mail app on your iPhone, and the Gmail interface on your web browser are all MUAs.
- Its job: To let you read, write, and organize emails. It acts as your personal assistant.
2. The MTA (Mail Transfer Agent)
This is the heavy lifter of the internet. An MTA is software running on a powerful server computer owned by your email provider (like Google, Yahoo, or your company's IT department).
- Its job: To act as the post office. It receives the email from your MUA, looks at the destination address, figures out how to get it there, and transports it across the internet to the recipient's post office.
3. The MDA (Mail Delivery Agent)
Once the receiving MTA gets the email, it hands it off to the MDA.
- Its job: To act as the final sorting clerk. It takes the incoming email and drops it into the specific digital inbox of the recipient, waiting for them to log in and read it.
Now that we know the players, let's look at the language they speak to each other.
SMTP: The Delivery Truck (How Emails are Sent)
When you click "Send" in your email app (your MUA), your app needs to push that message up to your email provider's server (the MTA). The protocol used for this is SMTP.
Think of SMTP as the delivery truck. It only drives goods out of the warehouse and delivers them to their destination.
How SMTP Works: The Conversation
When your email app connects to the outgoing mail server, they have a very specific, text-based conversation using SMTP rules. It looks surprisingly like human conversation. If you could eavesdrop on the computers, here is exactly what you would hear:
- 1The Handshake: Your app connects and says `HELO` (Hello). The server replies with a code, usually `250 OK`, meaning "I hear you, let's talk."
- 2The Sender: Your app says `MAIL FROM: <[email protected]>`. The server checks if you are allowed to send, and replies `250 OK`.
- 3The Recipient: Your app says `RCPT TO: <[email protected]>`. The server verifies it can reach that destination and replies `250 OK`.
- 4The Message: Your app says `DATA`. The server says "Go ahead, give me the message, and end it with a single period on a blank line." Your app sends the subject line, the text, and the attachments, ending with that period.
- 5The Goodbye: The server says `250 Message accepted for delivery`. Your app says `QUIT`, and the connection closes.
Once your server has the message, it uses SMTP again to talk to the Yahoo server (in this example) and repeats the exact same conversation to hand the message over.
Understanding Ports (The Internet's Apartment Numbers)
To fully understand email protocols, we must briefly talk about "Ports."
Imagine an IP address (like `192.168.1.5`) is the street address of a large apartment building. If you send a package to that building, it arrives at the front door. But the building has many different businesses inside: a bakery in apartment 80, a post office in apartment 25, and a bank in apartment 443.
If you don't specify the apartment number, the package gets lost. In computer networking, these "apartment numbers" are called Ports. They are numbered from 1 to 65,535. When your computer sends data to a server, it must specify the Port number so the server knows which specific software should handle the data.
SMTP uses specific ports to do its job:
- Port 25: This is the original, historical port for SMTP. It was created in the early days of the internet when security wasn't a concern. Because it is unencrypted (meaning anyone can intercept and read the data), and because spammers heavily abuse it to send junk mail, almost all modern Internet Service Providers (ISPs) block Port 25 for regular users.
- Port 465: This was introduced later to provide a secure, encrypted tunnel (using SSL/TLS) for sending emails.
- Port 587: This is the modern gold standard for sending emails. When you set up an email app today, it will almost always use Port 587. It requires the user to securely log in with a username and password before it allows any mail to be sent, which stops spammers in their tracks.
The Problem of Receiving: Why SMTP Isn't Enough
If SMTP is so great at delivering mail, why can't we use it to receive mail too? Why can't the Yahoo server just use SMTP to push the email directly into your friend's laptop?
The answer is the "Always-On" problem.
For a computer to receive an SMTP push, it must be turned on, connected to the internet, and actively listening 24 hours a day, 7 days a week. Your email provider's massive servers in their data centers do exactly this. But your personal laptop or smartphone does not. You turn your laptop off at night. Your phone loses signal in a tunnel.
If the Yahoo server tried to use SMTP to push the email to your friend's phone while they were in a tunnel, the connection would fail, and the email would bounce back as undeliverable.
Therefore, the email must wait patiently on the Yahoo server (in the MDA's sorting bin) until your friend's phone connects to the internet and says, "Do I have any new messages?"
To do this, the phone needs a pull protocol. It needs a set of rules designed specifically for fetching mail that is waiting on a server. Today, there are two main protocols used for this: POP3 and IMAP.
POP3: The "Download and Delete" Pioneer
POP3 stands for Post Office Protocol version 3. It is the older of the two receiving protocols, designed in the early days of the internet.
To understand why POP3 works the way it does, you have to remember what the internet was like in the 1990s. People connected using dial-up modems over their landline telephones. You paid for the internet by the minute, and it was incredibly slow. Furthermore, email servers had very small hard drives; they could not afford to store thousands of emails for millions of users.
Because of these limitations, POP3 was designed with a very specific philosophy: Download and Delete.
How POP3 Works
When your email app uses POP3 to check your mail, it follows this sequence:
- 1It connects to the mail server.
- 2It downloads a complete copy of every new email to your local device's hard drive.
- 3Crucially, it then deletes the original emails from the server.
- 4It disconnects from the internet.
Think of POP3 like visiting a physical Post Office Box. You unlock the box, take all your letters out, put them in your bag, and leave the box completely empty for the next day's mail.
The Pros and Cons of POP3
Because POP3 deletes mail from the server, it is fantastic for saving storage space on the server. It is also great if you want to read your emails offline, because all the data is saved locally on your computer's hard drive. Furthermore, some highly secure corporate environments prefer POP3 because it ensures no sensitive emails are left sitting on a cloud server where they could be hacked.
However, in the modern world, POP3 has a massive, fatal flaw: It is terrible for multiple devices.
Imagine you have a laptop and a smartphone.
- At 9:00 AM, your phone checks your email using POP3. It downloads a new message from your boss and deletes it from the server.
- At 10:00 AM, you open your laptop and check your email. Your laptop connects to the server, but the server is empty. The email from your boss is trapped on your phone. Your laptop will never see it.
If you use POP3 across multiple devices, your emails become scattered and fragmented. Your sent items on your phone won't match the sent items on your laptop. If you lose your phone, all the emails downloaded to it are gone forever, because there is no backup on the server.
POP3 Ports
- Port 110: The default, unencrypted port for POP3.
- Port 995: The secure, encrypted port for POP3 (often called POP3S).
IMAP: The Modern "Sync and Share" Standard
To solve the multi-device nightmare created by POP3, engineers created IMAP, which stands for Internet Message Access Protocol.
If POP3 is like taking your mail out of a physical P.O. Box, IMAP is like looking at your mail through a magic, two-way window.
How IMAP Works
IMAP was designed for the modern era of broadband internet, massive cloud storage, and users who own multiple devices. Its core philosophy is Synchronization.
When your email app uses IMAP to check your mail, it follows this sequence:
- 1It connects to the mail server.
- 2It downloads a copy of the emails to show you on your screen, but it leaves the original emails safely on the server.
- 3It constantly syncs your actions back to the server.
Because the master copy of your inbox lives on the server, all your devices are simply looking at the same central source.
If you read an email on your phone while riding the bus, your phone tells the server, "Mark this as read." When you get to the office and open your laptop, the laptop asks the server for the latest status, and the server says, "That email is already read." The bold text disappears on your laptop instantly.
If you create a new folder called "Taxes 2026" on your laptop and move an email into it, that folder will instantly appear on your phone, and the email will be inside it. If you accidentally drop your phone in a lake, you haven't lost a single email. You just buy a new phone, log in with IMAP, and your entire inbox, with all its folders and read/unread statuses, downloads perfectly.
The Pros and Cons of IMAP
IMAP is the standard choice for almost everyone today. It provides a seamless experience across phones, tablets, and computers.
The only real downside to IMAP is that because it leaves everything on the server, your server inbox will eventually fill up. If you have a free email account with a 15 GB storage limit, years of IMAP usage with large attachments will eventually force you to buy more cloud storage or manually delete old emails.
IMAP Ports
- Port 143: The default, unencrypted port for IMAP.
- Port 993: The secure, encrypted port for IMAP (often called IMAPS).
Head-to-Head: POP3 vs. IMAP
To ensure you have absolute clarity for the exam, here is a direct comparison of the two receiving protocols:
- Where the mail lives:
- POP3: Mail is stored locally on your specific device's hard drive.
- IMAP: Mail is stored centrally on the email server.
- Multi-device support:
- POP3: Poor. Emails downloaded on one device cannot be seen on another.
- IMAP: Excellent. All devices sync perfectly with the server.
- Folder synchronization:
- POP3: Does not sync folders. It only downloads the main Inbox. If you make a folder on your computer, the server doesn't know about it.
- IMAP: Fully syncs all folders (Sent, Drafts, Trash, custom folders) across all devices.
- Server storage space:
- POP3: Saves server space because it deletes messages after downloading.
- IMAP: Consumes server space because all messages and attachments remain on the server forever (until you manually delete them).
- Offline access:
- POP3: Excellent. Since everything is downloaded, you can search and read all your old emails without an internet connection.
- IMAP: Limited. While most apps cache (temporarily save) recent emails for offline reading, you usually need an internet connection to search your entire archive or download old attachments.
Worked Example: The Complete Journey of an Email
Let's put everything we've learned together and trace the exact, step-by-step journey of an email from start to finish.
Imagine Arjun (using a laptop with Microsoft Outlook) wants to send a PDF report to Priya (who checks her mail on her iPhone). Arjun uses Gmail, and Priya uses Yahoo.
Here is the sequence of protocols in action:
The Protocol Relay Race
- 1Arjun clicks "Send" in Microsoft Outlook (his MUA).
- 2Outlook uses SMTP (Port 587) to push the email up to the Gmail Server (Arjun's MTA).
- 3The Gmail Server looks at the address ([email protected]) and finds the Yahoo Server.
- 4The Gmail Server uses SMTP to push the email across the internet to the Yahoo Server (Priya's MTA).
- 5The Yahoo Server accepts the email and hands it to the MDA, which drops it into Priya's digital inbox.
- 6The email waits patiently on the Yahoo server.
- 7Priya wakes up and opens the Apple Mail app on her iPhone (her MUA).
- 8Her iPhone uses IMAP (Port 993) to connect to the Yahoo Server.
- 9IMAP syncs the inbox, downloading a copy of Arjun's email to Priya's screen while leaving the original on the server.
Notice that SMTP was used twice (once by the user, once by the server) to push the mail forward. But IMAP was only used once, at the very end, by the recipient to pull the mail down.
Quick Revision
If you are reviewing this chapter the night before your exam, focus on these high-yield points:
- Protocol: A standardized set of rules that allows computers to communicate.
- MUA (Mail User Agent): The email app you use (Outlook, Gmail app, Apple Mail).
- MTA (Mail Transfer Agent): The server software that routes and transfers the email across the internet.
- SMTP (Simple Mail Transfer Protocol): The protocol used exclusively for sending and routing outgoing emails. It pushes mail.
- SMTP Ports: Port 25 (historical/unencrypted), Port 465 (secure), Port 587 (modern secure standard).
- POP3 (Post Office Protocol v3): A receiving protocol that downloads and deletes emails from the server. Best for single devices and saving server storage.
- POP3 Ports: Port 110 (unencrypted), Port 995 (secure).
- IMAP (Internet Message Access Protocol): A receiving protocol that syncs emails across multiple devices, leaving the master copy on the server.
- IMAP Ports: Port 143 (unencrypted), Port 993 (secure).
- The Golden Rule: SMTP sends. POP3 and IMAP receive.
Related notes
- The World Wide Web and Browsers
Learn the difference between the internet and the web, and how browsers and search engines work.
- What is the Internet?
Understand the basic concept of the internet, its brief history, and how we connect to it.
- Web Addresses and Domain Names
Learn how computers find each other online using IP addresses and URLs.
- Writing and Sending E-mails
Master the practical features of an email inbox, including CC, BCC, and attachments.