← RFC Reference

RFC 3207 – SMTP STARTTLS Extension

Proposed Standard Transport Security Obsoletes RFC 2487 Published February 2002
ELI5: Imagine you’re having a conversation in a crowded room. Anyone can listen in. STARTTLS is like saying “let’s step into a private room” mid-conversation. You start the SMTP session in plaintext, then both sides agree to switch to encrypted communication before any sensitive content is exchanged. After that, nobody can eavesdrop on the email being transferred.

Why This RFC Exists

When SMTP was designed in 1982, encryption wasn't a consideration. Messages traveled across the internet in plaintext, and anyone with access to the network path could read them. As the internet became more hostile, encrypting email in transit became essential.

RFC 3207 defines the STARTTLS extension for SMTP, allowing a plaintext SMTP connection to be upgraded to an encrypted TLS connection. Published in 2002, it replaced RFC 2487 with clarifications on security considerations and server behavior.

STARTTLS is the dominant mechanism for encrypting server-to-server (MTA-to-MTA) email traffic on port 25. For client-to-server submission, RFC 8314 now recommends implicit TLS on port 465, but STARTTLS on port 587 remains widely used.

How It Works

STARTTLS works as an SMTP extension, negotiated during the EHLO exchange:

  1. The client connects to the server on port 25 (or 587) in plaintext.
  2. The client sends EHLO. The server responds with its capabilities, including 250-STARTTLS if it supports encryption.
  3. The client sends STARTTLS.
  4. The server responds with 220 Ready to start TLS.
  5. Both sides perform a TLS handshake, establishing an encrypted channel.
  6. The client sends a new EHLO over the encrypted connection. The server's capability list may change (e.g., AUTH is now advertised).
  7. The SMTP session continues normally, but all traffic is now encrypted.

SMTP Example

STARTTLS negotiation during a server-to-server transfer:

# Plaintext connection established on port 25 S: 220 mx.example.com ESMTP C: EHLO sender.example.net S: 250-mx.example.com S: 250-SIZE 52428800 S: 250-STARTTLS S: 250 ENHANCEDSTATUSCODES # Client sees STARTTLS is available, requests upgrade C: STARTTLS S: 220 2.0.0 Ready to start TLS # --- TLS handshake occurs here --- # All subsequent traffic is encrypted # Client MUST re-issue EHLO after TLS C: EHLO sender.example.net S: 250-mx.example.com S: 250-SIZE 52428800 S: 250-AUTH PLAIN LOGIN S: 250 ENHANCEDSTATUSCODES # Note: STARTTLS no longer advertised (already active) # Note: AUTH now advertised (only available after TLS) C: MAIL FROM:<alice@sender.example.net> S: 250 2.1.0 OK C: RCPT TO:<bob@example.com> S: 250 2.1.5 OK C: DATA S: 354 Start mail input C: [message content...] C: . S: 250 2.0.0 OK

Key Technical Details

Opportunistic vs. Mandatory TLS

The critical limitation of STARTTLS as defined in RFC 3207 is that it's opportunistic by default:

Opportunistic TLS is vulnerable to downgrade attacks: a network attacker can strip the STARTTLS capability from the EHLO response, forcing the connection to remain in plaintext. The client has no way to know the server supports TLS because the initial negotiation happens in plaintext.

Certificate Verification

RFC 3207 does not require strict certificate verification for MTA-to-MTA connections. In practice, many servers use self-signed certificates or certificates that don't match the MX hostname. The rationale: opportunistic encryption with no verification is still better than no encryption at all. It protects against passive surveillance even if it doesn't prevent active man-in-the-middle attacks.

For stronger guarantees, use:

Re-EHLO After STARTTLS

After the TLS handshake completes, the client MUST issue a new EHLO command. The server's capability list from before TLS must be discarded. This is important because:

STARTTLS on Different Ports

Port Protocol TLS Behavior
25 SMTP relay STARTTLS (opportunistic for MTA-to-MTA)
587 Submission STARTTLS (effectively mandatory — AUTH requires it)
465 Submission Implicit TLS (TLS handshake before any SMTP commands)

TLS Reporting

RFC 8460 defines SMTP TLS Reporting (TLSRPT), which allows domain owners to receive reports about TLS connection failures. This is the STARTTLS equivalent of DMARC aggregate reports — it tells you when connections to your servers are failing TLS negotiation.

_smtp._tls.example.com. IN TXT "v=TLSRPTv1; rua=mailto:tls-reports@example.com"

Common Mistakes

Deliverability Impact

Related RFCs