New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
SMTP and APIUpdated 26 Oct 2026

The SMTP Banner and Greeting: What to Show, What to Hide and How It Affects Delivery

What the 220 SMTP banner should contain, how the host name relates to PTR and HELO, whether to hide software versions, custom banners, delays, banner checks by receivers, testing and common mistakes.

SM
Written by Sofia Marino
Technical Support Lead
Reviewed by Kwame Mensah
  • Published23 Jan 2025
  • Read time6 min
  • Length1,250 words
Share this guide

The first thing a mail server says when you connect is a single line: the banner. It begins with the code 220, followed by a host name and, usually, some text about the software. It looks like decoration, yet receivers and security scanners read it carefully. A banner with the wrong host name can contribute to spam points; a banner that reveals exact software and version helps attackers pick exploits; an empty or odd banner can look like a bot. Administrators also change banners for branding, which carries its own small risks. This guide explains what the standard requires, what a good banner contains, whether to hide version information, how banners relate to HELO and reverse DNS, how to configure them in common servers and how to test the result. It builds on an SMTP conversation step by step, FCrDNS and VRFY and EXPN.

Format220 followed by the fully qualified host name, then optional free text
MatchUse the same name as your PTR record, A record and EHLO name
HideAvoid exact software and version strings; keep the text short and neutral
AvoidHumour, marketing text, internal names and anything that looks like a different server

What the standard says

RFC 5321 requires the server to start the session with a 220 greeting that includes its fully qualified domain name. Free text after the name is permitted but not required. The server speaks first on a normal SMTP port; a server that sends nothing, or sends a malformed line, breaks clients. A multi-line banner is allowed (each line except the last uses 220-), but many clients and scanners expect one line, so keep it single.

220 mail1.example.com ESMTP ready
220 mail1.example.com ESMTP Postfix
220-mail1.example.com ESMTP
220 Authorized use only

All four lines are valid SMTP, but their quality differs. The first is neutral and good. The second names the software, which is common and not forbidden but unnecessary. The last two show a multi-line banner; the final line should still begin with 220 followed by a space. A greeting with no host name violates the requirement and is penalised by some receivers.

What a good banner contains

ElementRecommendationReason
Code220Required greeting code
Host nameYour public fully qualified name, the same as PTR and EHLOReceivers compare banner, PTR and HELO for consistency. See FCrDNS
Protocol wordESMTPSignals support for extensions
Software name and versionOmit, or give a generic termVersion strings help scanners and attackers map known vulnerabilities
Operator textShort, optional, non-promotionalBanners are not a place for marketing or jokes
Legal noticePut on submission login banners if required by policy, not on public port 25 textSome auditors ask for notices; they have no legal effect on a public MX and clutter the greeting
Line countOne lineCompatibility with simple scanners and clients

To hide the version or not

Hiding the exact version is a minor hardening step, not a security control. An attacker can fingerprint a server in other ways (behaviour of commands, extension lists, error text), and defenders gain the most from patching, not from secrecy. The cost of removing the version is almost zero, though, and it reduces trivial scanning noise. Many administrators therefore configure the banner to state only the host name and the ESMTP word. Do not go further and forge the banner to claim a different product: it serves no purpose, confuses your own troubleshooting and can look suspicious to filters that compare the banner with observed behaviour.

Configuration examples

ServerSettingResult
Postfixsmtpd_banner = $myhostname ESMTP220 mail1.example.com ESMTP (the default includes the software name)
Eximsmtp_banner = "${primary_hostname} ESMTP"220 mail1.example.com ESMTP
SendmailSet SmtpGreetingMessage with the macro for the host nameControls the text after the host name
Microsoft ExchangeSet the connector banner with Set-ReceiveConnector -BannerAlso set the FQDN of the connector to the public name
Haraka and other modern MTAsPlugin or configuration option for the greeting textCheck the documentation for the exact key
Gateways and cloud filtersOften fixed; verify what they showEnsure the gateway name matches PTR if it is the public endpoint
# Postfix
postconf -e 'myhostname = mail1.example.com'
postconf -e 'smtpd_banner = $myhostname ESMTP'
postfix reload

# Check what is shown from outside
printf 'QUIT\r\n' | nc -w 5 mail1.example.com 25
  • Host name consistency. The name in the banner (inbound) and the name in your EHLO (outbound) both matter. On outbound connections your server speaks as client with its EHLO name; the banner matters when others connect to you, and the same name should be used for both. See HELO and EHLO errors.
  • Generic or dynamic names. A banner such as 220 localhost or 220 ubuntu shows the server was never configured and is sometimes treated as an unmanaged or compromised host.
  • Internal names. Showing srv-db-04.corp.local leaks structure and gives scanners targets. Use the public name.
  • Greeting delay (greet pause). Some servers wait a few seconds before sending the banner and reject clients that talk before it arrives, a cheap way to stop spam bots. See tarpitting.
  • Load balancers. If a load balancer terminates connections, make sure it forwards the real server banner or presents a correct one of its own; a blank or immediate close breaks monitoring.
  • Implicit TLS ports. On port 465 the banner appears only after the TLS handshake, so a plain-text scan of that port shows nothing.

Security scanning and banner grabbing

Security scanners connect, read the banner and match it against databases of known software. Because the match is based on text, accurate-looking banners can trigger alarms for old vulnerabilities even in patched software, and hidden banners can make an audit report "unknown service". If your auditors require a particular style, agree on one neutral banner and document that the version is deliberately hidden. For real assurance, rely on patch management and on configuration checks, not on the banner. Also remember that banners are sent to anyone who connects, including bots; a rate limit on connections and a firewall policy for management ports matter more than the text.

Testing

  1. Connect from outside your network with netcat, telnet or openssl s_client -starttls smtp and read the first line.
  2. Confirm that the host name in the banner is a fully qualified public name.
  3. Look up the PTR record of the server IP and the A record of the banner name; they should agree. See FCrDNS.
  4. Send EHLO and verify that the name you announce as a client (for outbound connections) is the same name.
  5. Check that the banner has one line and ends with a normal 220 line.
  6. Repeat the test through any load balancer, VPN or cloud gateway in front of the server.
  7. Re-test after upgrades, because package updates sometimes restore default banners.

Common mistakes

MistakeEffectFix
Default banner with software and version left in placeNeedless disclosureSet a neutral banner
Banner shows localhost or an internal nameLooks misconfigured; leaks structureUse the public FQDN
Banner does not match PTRReputation and filter penaltiesAlign PTR, A record and banner
Jokes, ASCII art or marketing textUnprofessional; may confuse scanners and monitoringKeep it short
Multiple banner lines with a wrong final lineClients hang or failEnd with a single "220 " line
Forging another productMisleads your own team and breaks troubleshootingDo not do it
Long banner delayLegitimate clients time outKeep greet pause to a few seconds and allowlist known senders

The SMTP banner is tiny but visible to everyone who connects. Give it your real public name, keep the text short and neutral, make sure the name matches your reverse DNS and EHLO and test it from outside after every change. It is one of the cheapest ways to look like a well-run mail server.

Check your mail server from outside See whether your IP appears on any blocklist.

Open the blocklist check

References and further reading

Frequently asked questions

What is the SMTP banner?

The first line a server sends after a connection, starting with 220 and containing its host name and optional text.

Should the banner match the PTR record?

Yes. Using the same fully qualified name in the banner, PTR record and EHLO avoids consistency penalties.

Should I hide the software version?

It is a minor hardening step with little cost, so most administrators show only the host name and ESMTP.

Can I put a legal notice in the banner?

You can, but on a public MX it has no legal value and clutters the greeting; use login banners for submission services if policy requires.

How do I test my banner?

Connect with netcat or openssl s_client from outside your network and read the first line.

Topics#banner#greeting#hardening#ptr#postfix
Was this guide helpful?Your answer helps us improve our documentation.

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales