About
SMTP is a network protocol from the application layer that transmits mail (message) between:
The SMTP protocol works via a series of SMTP command between the server and the client.
Each command has:
- a name
- optional arguments
- and terminate with the windows end of line (ie CRLF)
The server will then respond with a reply code and a human text that defines if the command was successful.
Example
For an example on how to transmit a message with the SMTP protocol, see this howto:
How to send an email at the command line with SMTP? Email transaction explained
Note on transmission
You can transmit (ie transport) an email:
- for reception: ie to the final destination SMTP server known as the MDA (Mail Delivery Agent)
- for sending/relay: ie to the MTA (Mail Transmission Agent) SMTP server that will deliver it to the MDA (Mail Delivery Agent)
Command
- HELP - Get the lists of command
- HELO, - same as EHLO (deprecated)
- EHLO - Extended Helo - identify the SMTP client to the SMTP server with the the fully-qualified domain name as argument
of the SMTP client, if one is available.
- ETRN,
- MAIL FROM, Identifies the return address (not the sender, the sender is in the message)
- RCPT TO, Identifies the recipients
- VRFY, verify the username exists on the servers
- STARTTLS is a StartTLS m to secure the connection with TLS. It takes no parameters. For PostFix, see How to configure Postfix for TLS / SSL and StartTLS?). With mta-sts, you can define your policy publicly.
- DATA (identified start of the message ie followed by a the body email
- BDAT: send the data in chunk, not line by line as DATA does.
- RSET - Reset, abort transaction and discard info
- NOOP - No operations, only elicits an OK from the server used to check the connection.
Other:
- SEND - send message to terminal
- TURN
Generally forbidden (postconf.5.html)
- CONNECT,
- GET,
- POST
Login:
- AUTH LOGIN (then username password)