Guide · SMTP and headers

EHLO vs. HELO: what the SMTP greeting actually tells you

When a mail log shows 250 after EHLO, the server has accepted the greeting. It has not checked a recipient or accepted a message. One SMTP conversation can contain several replies with the same code, each answering a different command. To read a log correctly, pair each reply with the command that led to it, and note whether it came before or after TLS.

Reading time
6 min

What EHLO and HELO tell a receiver

On a plain SMTP connection, the receiving server first sends a 220 greeting. Then the client introduces itself. Both EHLO and HELO carry the client's identity, normally its fully qualified domain name. EHLO also asks the server to list the SMTP service extensions it supports (RFC 5321, sections 3.2 and 4.1.1.1). This extension-capable form is often called ESMTP, or Extended SMTP. HELO is the older introduction, with no extension negotiation.

The identity in the greeting is what the client presents. A 250 reply does not authenticate the message's author, sign anyone in, or confirm the address of a recipient. At that point the client may not have named a sender, a recipient or a message at all. So "EHLO succeeded" helps when you look for a negotiation problem, but says little about why a particular message did not arrive. The name a sending server uses here also matters for its reputation (reverse DNS and the HELO name).

Read a multiline EHLO reply

Here is the start of a fictional SMTP session. C marks the client, S the server, and all host names are examples:

S: 220 mx.example.net ESMTP ready
C: EHLO outbound.example.com
S: 250-mx.example.net
S: 250-SIZE 5242880
S: 250-STARTTLS
S: 250 SMTPUTF8

The first 250 line names the receiving server. The next lines advertise extensions:

The punctuation tells the client when the list is complete. A hyphen straight after the code means more lines follow; the last line has a space after the code (RFC 5321, section 4.1.1.1). Because some servers send a bare code without text, section 4.2 asks clients to be prepared to process the code alone, with or without a trailing space. So test for the continuation hyphen rather than expecting a word on every last line.

Treat the list as a snapshot of that session. A capability seen yesterday, on another mail server or in another connection state does not show that this server offered it on this connection.

What you lose when a client falls back to HELO

If the server answers EHLO with "command not recognized", RFC 5321 (section 3.2) says the client should be able to fall back to HELO. A successful HELO establishes a basic SMTP greeting, but negotiates no extensions: servers must not return the extended EHLO-style reply to HELO. Capabilities the client expected are not negotiated.

A temporary failure, a timeout and an explicit refusal of the presented identity are different cases from a command the server does not understand. Record the exact reply before you decide what to fix. If the client requires encryption and the route cannot provide it, fix the endpoint or the TLS settings. Never take a HELO fallback as a reason to send credentials or mail in plain text.

Why a 250 reply depends on the command

Here is a later excerpt from a different fictional session. It starts after the greeting and is here only to read the replies:

C: MAIL FROM:<billing@example.com>
S: 250 Sender accepted
C: RCPT TO:<customer@example.org>
S: 250 Recipient accepted
C: DATA
S: 354 Ready for message content
C: [message header and body, omitted]
C: .
S: 250 Message queued as EX42

These replies mark four different points:

Why STARTTLS requires a new look at the greeting

After a successful STARTTLS handshake, the SMTP session is reset to its initial state. RFC 3207 (section 4.2) requires both sides to discard what they learned before TLS that did not come from the TLS negotiation itself, including the client's EHLO argument and the server's extension list. The client should send EHLO as its first command in the protected session.

The new list may differ. RFC 3207's own example is a server that offers a particular SASL authentication mechanism only after the client presented a suitable certificate. And a server must not advertise STARTTLS again once a TLS handshake has completed.

If a feature seems to be missing, look for the second EHLO before you change any mail or account settings. Confirm that the handshake finished and that the feature was missing from the session after it, rather than reading the earlier plain-text greeting.

The plain-text greeting also has a security weakness: RFC 3207 (section 6) notes that an attacker in the path can delete the 250 STARTTLS line, so the client never tries TLS. Seeing STARTTLS missing from one session can mean exactly that. Between mail servers, MTA-STS and DANE let a sender refuse such a downgrade (MTA-STS and TLS reporting).

What to save in a troubleshooting note

Write down the timestamp, each command with its full reply, and whether TLS was active. For a missing message, note whether the server accepted responsibility at the end of DATA, then follow that handoff with the receiving service's trace. Keep real addresses, credentials and message content out of public examples. To read a specific SMTP failure once you have found the stage that produced it, look up its code in the bounce code dictionary.

Questions

Should a client use EHLO or HELO?

EHLO. RFC 5321 says a client should start a session with EHLO (section 4.1.1.1). Section 3.2 says it should be able to fall back to HELO when the server answers "command not recognized".

Does a 250 reply to RCPT TO mean the mailbox exists?

No. It means the server accepted that recipient for this transaction. It can still reject the message after DATA, and some domains accept every recipient (catch-all emails).

Why did the extension list change after STARTTLS?

The session restarts after the TLS handshake, and the server may offer a different list in the protected session. It must no longer list STARTTLS.

Try it

See which mail servers a domain publishes with the MX lookup, or check an address with the free email checker.

Sources

How we wrote this: drafted by the email-validation.org team with the help of AI writing tools, from our product documentation and the sources linked in the text.

Get up to 500 free credits. No card needed.

New accounts get 500 free credits (100 when you sign up with a free email provider such as Gmail, Outlook or Yahoo, another personal mailbox such as a paid one like Fastmail or one from your internet provider, or an address from a relay or alias service). Try it on your own list before you buy.

Updated · Maintained by: Email Validation LLC