# Email protocols

> The shared rules, SMTP, IMAP and POP3, that carry an email from one inbox to another.

- Level: Intermediate
- Topics: Networks
- URL: https://tidbit.legios.com.ar/email-protocols/
- In Spanish: [Protocolos de correo](https://tidbit.legios.com.ar/es/email-protocols/)

Email works between any two providers because they all follow the same open rules. Sending and receiving are separate jobs with separate protocols. **SMTP** (Simple Mail Transfer Protocol) moves a message forward, from your app to your provider's **mail server** and from there to the recipient's. **IMAP** and **POP3** are how the recipient's app later picks it up.

The trip goes like this. You hit send, and your app hands the message over SMTP to your provider. Your provider looks at the part after the `@`, say `b.com`, and asks DNS for that domain's **MX record**, which names the server that accepts mail for it. It connects to that server, again with SMTP, and delivers. The message now sits in the recipient's mailbox, on their provider's server, until they open their app. Usually this takes seconds; if the other server is down, yours keeps retrying for a while before bouncing it back to you.

Reading is where IMAP and POP3 differ. **IMAP** leaves the mail on the server and keeps every device in sync: read it on the phone and it shows as read on the laptop, delete it anywhere and it is gone everywhere. **POP3** is older and simpler: it downloads messages to one device, often removing them from the server. Today IMAP, or a provider's own app, is the normal choice.

SMTP comes from the early 1980s and originally trusted whatever 'From' address a sender claimed, which is why spam and phishing are so easy to send. Extra checks added later, called **SPF**, **DKIM** and **DMARC**, let a receiving server verify that a message really comes from the domain it claims. Connections between servers are usually encrypted with TLS, but that is not end-to-end encryption: each provider can read the mail it stores.

## An analogy

SMTP is the postal service carrying letters between post offices; IMAP is a PO box you can check from any branch, and POP3 is taking the letters home and emptying the box.

## Keep in mind

- SMTP sends and relays; IMAP and POP3 are for reading.
- DNS MX records tell servers where to deliver mail for a domain.
- IMAP keeps all devices in sync; POP3 downloads to one.
- SPF, DKIM and DMARC help prove a message really comes from its domain.

## Go deeper

- [Simple Mail Transfer Protocol on Wikipedia](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol)
- [Internet Message Access Protocol on Wikipedia](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol)
- [POP, IMAP and SMTP settings for Outlook.com (Microsoft Support)](https://support.microsoft.com/en-us/outlook/pop-imap-and-smtp-settings-for-outlook-com)

## Related terms

- [DNS](https://tidbit.legios.com.ar/dns/): The internet's phone book: it turns names like wikipedia.org into IP addresses.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
- [Spam](https://tidbit.legios.com.ar/spam/): Unwanted messages sent in bulk: ads, scams and junk you never asked for.
- [Phishing](https://tidbit.legios.com.ar/phishing/): A fake message that tricks you into handing over a password or a payment.
- [Encryption](https://tidbit.legios.com.ar/encryption/): Scrambling data so that only someone with the key can read it.
- [End-to-end encryption](https://tidbit.legios.com.ar/end-to-end-encryption/): Only the sender and the recipient can read a message; the service in between cannot.
