Vol. I · No. 46The protocol sectionSat, 10 Oct 2026
Layer 7 · Mail · how a message gets delivered

SMTP

Simple Mail Transfer Protocol

SMTP is the postal service of email. It is a push protocol — it moves a message from your client to your provider, then from server to server, until it lands in the recipient’s mailbox. Reading that mail is another protocol’s job; SMTP only ever carries it forward.

SMTP only ever pushes mail forward — retrieving it from the mailbox is IMAP’s and POP3’s job.

You can run this one

Open the MAIL lab →

One email from Alice’s laptop to Bob’s phone: SMTP hands it off twice and stops at a mailbox, then IMAP reads it in place—or POP3 downloads it, with optional deletion demonstrated clearly.

Beginner
Operates at
Layer 7
a text command dialog
Ports
587 · 25
submit · relay · 465
Direction
Push only
sends, never fetches
Secured by
STARTTLS
+ SPF · DKIM · DMARC

How it works

A message’s journey — and the SMTP dialog that carries it
Your client
MUA
587
Your server
MSA / MTA
25
Their server
MX / MTA
IMAP
Recipient
MUA
The envelope conversation
C →HELO / EHLO mail.example.com
C →MAIL FROM:<me@example.com>
C →RCPT TO:<you@other.net>
C →DATA … headers, body, then “.”
S ←250 OK — message queued for delivery

The envelope (MAIL FROM / RCPT TO) decides delivery — separately from the From: header you see. If the next hop is down, the server queues and retries rather than losing the mail.

The main points

What SMTP does, step by step

1
Submit

Your client hands the message to its server on port 587, authenticated and over TLS.

2
Find the MX

The server looks up the recipient domain’s MX record in DNS to learn which host accepts its mail.

3
Relay server to server

It connects to that MX on port 25 and runs the same envelope dialog to hand the message over.

4
Queue, retry, or bounce

Accepted mail lands in the mailbox; a temporary failure is retried, a permanent one bounces back.

The anti-forgery trio
SPF — which servers may send for a domain
DKIM — a signature proving nothing changed
DMARC — the policy tying the two together

In cybersecurity

SMTP was built for a trusting network where any server would relay for anyone — so almost every layer of email security since has been about proving a message is really from who it claims.

Spoofing

The From: header is free text; SPF, DKIM and DMARC exist because SMTP alone can’t vouch for a sender.

Open relays

A server that relays for anyone becomes a spam cannon — authenticated submission closed that door.

Phishing & BEC

Look-alike domains and forged display names carry most business email compromise — DMARC blunts it.

Opportunistic TLS

STARTTLS encrypts server-to-server hops, but a downgrade is possible — MTA-STS enforces it.

Reputation & blocklists

A sending IP’s history decides whether mail is trusted, greylisted or dropped before content is even read.

Harvesting & enumeration

VRFY and verbose RCPT errors leak valid addresses; hardened servers give nothing away.

Rides in the stack

IPTCPTLSSMTP

A reliable TCP session carries the text dialog; STARTTLS upgrades it to encryption mid-conversation.

Works with

IMAPPOP3TLS

Ports & verbs

Ports
587submission
25relay
465implicit TLS
2525alt submit
Key verbs
EHLOgreet
MAIL FROMsender
RCPT TOrecipient
DATAthe message