What does RFC 5321 say about MAIL FROM and HELO names?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

Every time you send an email, your server introduces itself twice before the message even arrives. RFC 5321 is the specification that defines how those introductions have to work, and getting them wrong is one of the quieter ways senders accidentally hurt their own deliverability.

The first introduction is the HELO or EHLO command. This is your sending server announcing its hostname. RFC 5321 requires that name to be a fully qualified domain name (FQDN) that actually resolves in DNS. If you hand over an IP literal, a generic hostname like "localhost", or something that doesn't resolve, you've technically violated the spec. Many receiving servers will treat that as a red flag and either reject the connection or score it negatively.

The second introduction is the MAIL FROM address (also called the envelope sender or Return-Path). This is the address that receives bounce notifications when delivery fails. RFC 5321 doesn't require it to match the "From" address your recipient sees in their inbox, but it does need to be real and monitored. Using a fake or unmonitored address here means you'll never know when mail is bouncing, which quietly damages your sender reputation over time.

Here's what each field needs in practice:

  • HELO/EHLO: a real, resolvable hostname that belongs to your sending server. Something like mail.harborpost.net, not localhost or a bare IP.
  • MAIL FROM: a valid email address at a domain you control, ideally something like bounces@harborpost.net that you actually monitor or route to a bounce processor.

Most reputable ESPs handle both of these correctly on your behalf. But if you're managing your own mail server, or if you've set up a custom return path, it's worth double-checking. A misconfigured HELO name or a broken bounce address won't always cause immediate failures. It just quietly makes your mail look less legitimate to every receiver evaluating your session.

If you want to see how your sending infrastructure actually presents itself, our free Email Header Analyzer can show you exactly what your server is announcing. Or if something's broken and you need a second pair of eyes, the SOS hotline is free.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Paste your setup details and get a plain-language read on whether your HELO and MAIL FROM meet the spec.

I send email from my own domain and I want to check whether my HELO name and MAIL FROM address meet RFC 5321 requirements. Here's my current setup: [describe your sending server hostname, return-path domain, and any bounce handling you have in place]. Can you tell me: (1) whether my HELO name looks valid and resolvable, (2) whether my MAIL FROM setup will correctly receive and process bounces, and (3) anything in my configuration that receiving servers might flag as non-compliant?

Edit the yellow boxes, then send to the AI of your choice.