Webiano Digital & Marketing Agency
Webiano Digital & Marketing Agency
  • Home
  • About Us
  • Services
    • Strategy
    • Digital Platforms
    • Performance
    • Communication
    • Infrastructure
    • Consulting
    • Education
    • All Services
  • Clients
  • Insights
    • Agency Journal
    • AI Search & Discoverability
    • Artificial Intelligence
    • Brand Positioning & Authority
    • Digital Platforms
    • Infrastructure & Security
    • Performance & Digital Marketing
    • Linux & Open Source
    • Visual Content & Production
    • Digital Work & Society
    • Web Radar
    • Robotics & Embodied AI
    • All Insights
  • FAQ
  • Knowledge base
  • Contact
Menu
  • Home
  • About Us
  • Services
    • Strategy
    • Digital Platforms
    • Performance
    • Communication
    • Infrastructure
    • Consulting
    • Education
    • All Services
  • Clients
  • Insights
    • Agency Journal
    • AI Search & Discoverability
    • Artificial Intelligence
    • Brand Positioning & Authority
    • Digital Platforms
    • Infrastructure & Security
    • Performance & Digital Marketing
    • Linux & Open Source
    • Visual Content & Production
    • Digital Work & Society
    • Web Radar
    • Robotics & Embodied AI
    • All Insights
  • FAQ
  • Knowledge base
  • Contact
Home » Knowledge base » Internet » Email infrastructure » STARTTLS

STARTTLS

5 min read · 6 sections

In short

STARTTLS is a protocol command that upgrades an existing plaintext SMTP, IMAP or POP3 connection to an encrypted TLS session on the same port.

On this page 6
  1. How the STARTTLS upgrade works
  2. Ports and the difference between STARTTLS and implicit TLS
  3. Opportunistic versus enforced STARTTLS
  4. Known weaknesses and attacks on STARTTLS
  5. The short version
  6. Where it makes a difference

STARTTLS is a protocol extension command that upgrades an already open plaintext connection to an encrypted TLS session on the same port, without opening a new connection. In email infrastructure across the Internet, it is the standard way SMTP servers encrypt mail in transit between each other, and it is also used by IMAP, POP3 and several non-mail protocols such as XMPP and LDAP.

The approach is known as opportunistic or explicit TLS, in contrast to implicit TLS, where encryption starts immediately on a dedicated port. STARTTLS made it possible to add encryption to protocols designed in the 1980s without breaking older servers, but that backward compatibility is also the source of its best-known weaknesses.

How the STARTTLS upgrade works

The STARTTLS upgrade follows a fixed sequence: the client connects in plaintext, learns that the server supports encryption, issues the STARTTLS command, performs a TLS handshake, and then restarts the protocol session inside the encrypted channel. For SMTP this behavior is defined in RFC 3207, and for IMAP and POP3 in RFC 2595.

In an SMTP session, the server advertises the capability in its reply to EHLO. The client sends STARTTLS, the server answers 220 Ready to start TLS, and both sides negotiate keys and certificates. After the handshake, the client must discard all earlier state and send EHLO again, because anything learned in plaintext could have been altered.

The steps below summarize a typical server-to-server exchange.

StepSender actionReceiver response
1. ConnectOpens TCP to port 25Sends a 220 greeting
2. Capability querySends EHLOLists extensions including STARTTLS
3. Upgrade requestSends STARTTLSReplies 220 ready to start TLS
4. TLS handshakeNegotiates cipher and keysPresents its certificate
5. Session restartSends EHLO again over TLSLists extensions afresh
6. Mail transferSends MAIL FROM, RCPT TO, DATAAccepts or rejects the message
Sequence of an SMTP session using STARTTLS

Ports and the difference between STARTTLS and implicit TLS

STARTTLS and implicit TLS both produce an encrypted session, but they differ in when encryption begins and which port is used. With implicit TLS, the TLS handshake is the first thing that happens on the connection, so no protocol command is ever exchanged in plaintext.

Current guidance in RFC 8314 recommends implicit TLS for mail submission and retrieval by users, while server-to-server relay on port 25 continues to depend on STARTTLS because there is no widely adopted implicit-TLS alternative for MX delivery. A receiving MX host has no way to know in advance whether a sender expects encryption, so the single shared port 25 must serve both encrypted and unencrypted peers.

PortProtocol useEncryption method
25SMTP relay between serversSTARTTLS, usually opportunistic
587Mail submission by clientsSTARTTLS, normally required
465Mail submission by clientsImplicit TLS
143IMAP accessSTARTTLS
993IMAP accessImplicit TLS
110 and 995POP3 accessSTARTTLS and implicit TLS respectively
Common email ports and their encryption method

Opportunistic versus enforced STARTTLS

Most mail servers use opportunistic STARTTLS: they encrypt when the receiving server advertises support and fall back to plaintext when it does not. They also typically accept any certificate, including self-signed or expired ones, because rejecting mail over certificate problems would cause widespread delivery failures.

Opportunistic encryption defends well against passive eavesdropping but offers little protection against an active attacker positioned on the network path. Several mechanisms in the same topic area exist to turn STARTTLS from a best-effort measure into an enforced policy.

MechanismHow it worksMain requirement
MTA-STSPublishes a policy over HTTPS requiring valid TLSWeb server and DNS record
DANE for SMTPPins certificates in DNS TLSA recordsDNSSEC-signed zone
TLS-RPTSends reports about TLS delivery failuresReporting address in DNS
Local enforcementRequires TLS for chosen destinationsManual MTA configuration
Mechanisms that harden STARTTLS for mail delivery

MTA-STS and DANE both instruct sending servers to refuse delivery rather than downgrade to plaintext. TLS-RPT complements them by giving domain owners visibility into failures before an enforced policy blocks legitimate mail.

Known weaknesses and attacks on STARTTLS

The central weakness of STARTTLS is that the negotiation happens in plaintext, so an attacker who can modify traffic can interfere before encryption starts. The classic example is a STARTTLS stripping attack, in which a middlebox removes the STARTTLS capability from the server’s EHLO reply, causing the client to continue unencrypted.

A second class is command injection, where an attacker appends plaintext commands after the STARTTLS command in the same TCP packet. A vulnerable server buffers those commands and executes them inside the TLS session as if they were authentic. Research published in 2021 found such buffering flaws in numerous mail clients and servers, which is one reason RFC 8314 favors implicit TLS for client access.

  • Stripping: the capability is removed, and opportunistic clients silently use plaintext.
  • Buffer injection: pre-handshake data is processed after encryption begins.
  • Certificate laxity: unchecked certificates allow interception with a forged identity.
  • Hop-by-hop scope: each relay decrypts mail, so STARTTLS never provides end-to-end confidentiality.

Correct implementations flush the input buffer at the moment of the upgrade, require TLS on submission ports, and validate certificates wherever a policy such as MTA-STS applies. For message-level confidentiality, organizations still need S/MIME or OpenPGP, because STARTTLS protects only the transport between two servers.

The short version

STARTTLS is like two people beginning a phone call in the open and then agreeing to switch to a private, scrambled line before discussing anything sensitive. The call continues on the same number, but from that moment outsiders can no longer understand it.

Email servers use it to protect messages while they travel from one server to the next. Its weak spot is the brief open moment at the start: someone listening in can try to prevent the switch. Extra rules such as MTA-STS tell servers to refuse to talk openly instead of quietly continuing without protection.

Where it makes a difference

A regional health clinic exchanges patient referrals by email with roughly 30 partner hospitals. Its mail server already offered opportunistic STARTTLS, but a review of TLS-RPT reports showed that about 2 percent of inbound sessions from one network path arrived in plaintext, a pattern consistent with STARTTLS stripping by a misconfigured or hostile middlebox.

The IT team obtained a publicly trusted certificate for the MX host, published an MTA-STS policy in testing mode for four weeks, reviewed the reports, and then switched the policy to enforce. They also moved staff mail clients from port 587 to implicit TLS on port 465 and disabled plaintext IMAP on port 143.

After the change, partner servers that honor MTA-STS refused to deliver without valid encryption, plaintext sessions on the monitored path dropped to zero, and the clinic could document enforced transport encryption for its compliance audit.

Published November 22, 2026

Filed under

  • Internet

    Subject

  • Email infrastructure

    Topic

Growth is engineered, not improvised.

All rights reserved © 2002–2026 | Webiano Digital & Marketing Agency

Social Media

  • Facebook
  • LinkedIn
  • YouTube

GDPR, Privacy and Cookies Policy

Copyright and Content Use Policy

Webiano Code of Ethics

  • Slovakia
  • Czechia
  • Europe
  • Global

Daily News & Insights via RSS