SMTP Commands
SMTP is a text protocol. After the server greeting, a client normally sends EHLO; the server’s multiline response advertises supported extensions. A basic mail transaction then uses MAIL FROM, one or more RCPT TO commands, and DATA.[1]
Core commands[1]
EHLO <domain>: Identifies an Extended SMTP client and requests the server’s extension list.HELO <domain>: Legacy greeting used when ESMTP is unavailable.MAIL FROM:<reverse-path>: Starts a transaction and sets its envelope sender. This is not the message’sFrom:header.RCPT TO:<forward-path>: Adds one envelope recipient; repeat it for additional recipients.DATA: Requests permission to transmit the message headers and body. A354reply means the client may send the content, terminated by a line containing only a dot.RSET: Aborts the current transaction and clears its sender, recipients, and data without closing the SMTP connection.VRFY <string>: Requests confirmation that a string identifies a user or mailbox. Servers commonly disable useful responses to reduce enumeration.EXPN <string>: Requests expansion of a mailing list. Servers may disable it.HELP [command]: Requests general or command-specific help.NOOP: Requests a successful reply without changing transaction state.QUIT: Ends the SMTP session.
Common extensions
SIZE [bytes]: The server advertises its maximum accepted message size; the client may declare the planned message size onMAIL FROM.[2]AUTH <mechanism>: Starts SMTP authentication using a mechanism advertised in theEHLOresponse. Credentials are not necessarily encrypted, so negotiate TLS first unless the selected mechanism provides adequate protection.[3]STARTTLS: Requests an upgrade of the connection to TLS. After a successful TLS negotiation, the client sendsEHLOagain because the advertised extensions can change.[4]
The obsolete TURN command from RFC 821 reversed the client and server roles on an existing connection. RFC 5321 no longer defines it, so do not expect current servers to support it.[1][5]
For a shorter operator-oriented catalog of these commands, the original page used ServerSMTP’s command overview.[6]
References
- [1] RFC 5321 - Simple Mail Transfer Protocol
- [2] RFC 1870 - SMTP Service Extension for Message Size Declaration
- [3] RFC 4954 - SMTP Service Extension for Authentication
- [4] RFC 3207 - SMTP Service Extension for Secure SMTP over TLS
- [5] RFC 821 - Simple Mail Transfer Protocol (obsolete)
- [6] ServerSMTP - SMTP commands overview