Extension discovery mechanism Clients learn a server's supported options by using the EHLO greeting, as exemplified below, instead of the original HELO. Clients fall back to HELO only if the server does not support EHLO greeting. Modern clients may use the ESMTP extension keyword SIZE to query the server for the maximum message size that will be accepted. Older clients and servers may try to transfer excessively sized messages that will be rejected after consuming network resources, including connect time to network links that is paid by the minute. Users can manually determine in advance the maximum size accepted by ESMTP servers. The client replaces the HELO command with the EHLO command. S: 220 smtp2.example.com ESMTP Postfix C: EHLO bob.example.org S: 250-smtp2.example.com Hello bob.example.org [192.0.2.201] S: 250-SIZE 14680064 S: 250-PIPELINING S: 250 HELP Thus
smtp2.example.com declares that it can accept a fixed maximum message size no larger than 14,680,064
octets (8-bit bytes). In the simplest case, an ESMTP server declares a maximum SIZE immediately after receiving an EHLO. According to , however, the numeric parameter to the SIZE extension in the EHLO response is optional. Clients may instead, when issuing a MAIL FROM command, include a numeric estimate of the size of the message they are transferring, so that the server can refuse receipt of overly-large messages.
Binary data transfer Original SMTP supports only a single body of ASCII text, therefore any binary data needs to be encoded as text into that body of the message before transfer, and then decoded by the recipient.
Binary-to-text encodings, such as
uuencode and
BinHex were typically used. The 8BITMIME command was developed to address this. It was standardized in 1994 as It facilitates the
transparent exchange of
e-mail messages containing octets outside the seven-bit
ASCII character set by encoding them as
MIME content parts, typically encoded with
Base64.
On-Demand Mail Relay On-Demand Mail Relay (
ODMR) is an SMTP extension standardized in that allows an intermittently-connected SMTP server to receive email queued for it when it is connected.
Internationalization extension Original SMTP supports email addresses composed of
ASCII characters only, which is inconvenient for users whose native script is not Latin based, or who use
diacritic not in the ASCII character set. This limitation was alleviated via extensions enabling UTF-8 in address names. introduced experimental Current support is limited, but there is strong interest in broad adoption of and the related RFCs in countries like
China that have a large user base where Latin (ASCII) is a foreign script.
Extensions Like SMTP, ESMTP is a protocol used to transport Internet mail. It is used as both an inter-server transport protocol and (with restricted behavior enforced) a mail submission protocol. The main identification feature for ESMTP clients is to open a transmission with the command EHLO (Extended HELLO), rather than HELO (Hello, the original standard). A server will respond with success (code 250), failure (code 550) or error (code 500, 501, 502, 504, or 421), depending on its configuration. An ESMTP server returns the code 250 OK in a multi-line reply with its domain and a list of keywords to indicate supported extensions. A RFC 821 compliant server returns error code 500, allowing ESMTP clients to try either HELO or QUIT. Each service extension is defined in an approved format in subsequent RFCs and registered with the
Internet Assigned Numbers Authority (IANA). The first definitions were the RFC 821 optional services: SEND, SOML (Send or Mail), SAML (Send and Mail), EXPN, HELP, and TURN. The format of additional SMTP verbs was set and for new parameters in MAIL and RCPT. Some relatively common keywords (not all of them corresponding to commands) used today are: • 8BITMIME – 8 bit data transmission, • ATRN – Authenticated TURN for
On-Demand Mail Relay, • AUTH – Authenticated SMTP, • CHUNKING – Chunking, • DSN – Delivery status notification, (See
Variable envelope return path) • ETRN – Extended version of remote message queue starting command TURN, • HELP – Supply helpful information, • PIPELINING – Command pipelining, • SIZE – Message size declaration, •
STARTTLS –
Transport Layer Security, (2002) • SMTPUTF8 – Allow
UTF-8 encoding in mailbox names and header fields, • UTF8SMTP – Allow
UTF-8 encoding in mailbox names and header fields, (deprecated) The ESMTP format was restated in (superseding RFC 821) and updated to the latest definition in in 2008. Support for the EHLO command in servers became mandatory, and HELO designated a required fallback. Non-standard, unregistered, service extensions can be used by bilateral agreement, these services are indicated by an EHLO message keyword starting with "X", and with any additional parameters or verbs similarly marked. SMTP commands are case-insensitive. They are presented here in capitalized form for emphasis only. An SMTP server that requires a specific capitalization method is a violation of the standard.
8BITMIME At least the following servers advertise the 8BITMIME extension: •
Apache James (since 2.3.0a1) •
Citadel (since 7.30) •
Courier Mail Server •
Gmail •
IceWarp •
IIS SMTP Service •
Kerio Connect •
Lotus Domino •
Microsoft Exchange Server (as of Exchange Server 2000) •
Novell GroupWise •
OpenSMTPD •
Oracle Communications Messaging Server •
Postfix •
Sendmail (since 6.57) •
ZMailer (since 2.95 940901) The following servers can be configured to advertise 8BITMIME, but do not perform conversion of 8-bit data to 7-bit when connecting to non-8BITMIME relays: •
Exim and
qmail do not translate eight-bit messages to seven-bit when making an attempt to relay 8-bit data to non-8BITMIME peers, as is required by the RFC. This does not cause problems in practice, since virtually all modern mail relays are
8-bit clean. •
Microsoft Exchange Server 2003 advertises 8BITMIME by default, but relaying to a non-8BITMIME peer results in a bounce. This is allowed by .
SMTP-AUTH The SMTP-AUTH extension provides an access control mechanism. It consists of an
authentication step through which the client effectively logs into the
mail server during the process of sending mail. Servers that support SMTP-AUTH can usually be configured to require clients to use this extension, ensuring the true identity of the sender is known. The SMTP-AUTH extension is defined in . SMTP-AUTH can be used to allow legitimate users to relay mail while denying relay service to unauthorized users, such as
spammers. It does not necessarily guarantee the authenticity of either the SMTP
envelope sender or the "From:" header. For example,
spoofing, in which one sender masquerades as someone else, is still possible with SMTP-AUTH unless the server is configured to limit message from-addresses to addresses this AUTHed user is authorized for. The SMTP-AUTH extension also allows one mail server to indicate to another that the sender has been authenticated when relaying mail. In general this requires the recipient server to trust the sending server, meaning that this aspect of SMTP-AUTH is rarely used on the Internet.
SMTPUTF8 Supporting servers include: •
Postfix (version 3.0 and later) • Momentum (versions 4.1 and 3.6.5, and later) •
Sendmail (experimental support in 8.17.1) •
Exim (experimental as of the 4.86 release, quite mature in 4.96) •
CommuniGate Pro as of version 6.2.2 •
Courier-MTA as of version 1.0 • Halon as of version 4.0 •
Microsoft Exchange Server as of protocol revision 14.0 •
Haraka and other servers. •
Oracle Communications Messaging Server as of release 8.0.2.
Security extensions Mail delivery can occur both over plain text and encrypted connections, however the communicating parties might not know in advance of other party's ability to use secure channel.
STARTTLS or "Opportunistic TLS" The STARTTLS extensions enables supporting SMTP servers to notify connecting clients that it supports
TLS encrypted communication and offers the opportunity for clients to upgrade their connection by sending the STARTTLS command. Servers supporting the extension do not inherently gain any security benefits from its implementation on its own, as upgrading to a
TLS encrypted session is dependent on the connecting client deciding to exercise this option, hence the term
opportunistic TLS. STARTTLS is effective only against passive observation attacks, since the STARTTLS negotiation happens in plain text and an active attacker can trivially remove STARTTLS commands. This type of
man-in-the-middle attack is sometimes referred to as
STRIPTLS, where the encryption negotiation information sent from one end never reaches the other. In this scenario both parties take the invalid or unexpected responses as indication that the other does not properly support STARTTLS, defaulting to traditional plain-text mail transfer. Note that STARTTLS is also defined for
IMAP and
POP3 in other RFCs, but these protocols serve different purposes: SMTP is used for communication between message transfer agents, while IMAP and POP3 are for end clients and message transfer agents. In 2014 the
Electronic Frontier Foundation began "STARTTLS Everywhere" project that, similarly to "
HTTPS Everywhere" list, allowed relying parties to discover others supporting secure communication without prior communication. The project stopped accepting submissions on 29 April 2021, and EFF recommended switching to
DANE and MTA-STS for discovering information on peers' TLS support. officially declared plain text obsolete and recommend always using TLS for mail submission and access, adding ports with implicit TLS.
DANE for SMTP introduced the ability for DNS records to declare the encryption capabilities of a mail server. Utilising
DNSSEC, mail server operators are able to publish a hash of their TLS certificate, thereby mitigating the possibility of unencrypted communications. Microsoft expects to enable full SMTP DANE support for Exchange Online customers by the end of 2024.
SMTP MTA Strict Transport Security A newer 2018 called "SMTP MTA Strict Transport Security (MTA-STS)" aims to address the problem of active adversaries by defining a protocol for mail servers to declare their ability to use secure channels in specific files on the server and specific
DNS TXT records. The relying party would regularly check existence of such record, and cache it for the amount of time specified in the record and never communicate over insecure channels until record expires.
SMTP TLS Reporting Protocols designed to securely deliver messages can fail due to misconfigurations or deliberate active interference, leading to undelivered messages or delivery over unencrypted or unauthenticated channels. "SMTP TLS Reporting" describes a reporting mechanism and format for sharing statistics and specific information about potential failures with recipient domains. Recipient domains can then use this information to both detect potential attacks and diagnose unintentional misconfigurations. In April 2019
Gmail announced support for SMTP TLS Reporting. ==Spoofing and spamming==