Simple Mail Transfer Protocol (SMTP)
Electronic mail (email) enables a person to compose a message and send it to another user on their own network (intranet) or anywhere in the world via the Internet.
- Email uses separate mail transfer and mailbox access protocols:

The Simple Mail Transfer Protocol (SMTP) specifies how email is delivered from one system to another.
- sender SMTP server discovers the IP address of the recipient SMTP server using the domain name part of the recipients email address
- SMTP servers for the domain are registered in DNS using MX and host records
- does not queue messages indefinitely
- if there is a communication problem,
- server retries at regular intervals before timing out and returning a non-delivery report (NDR) to the sender
- contains an error code indicating the reason the item could not be delivered
- server retries at regular intervals before timing out and returning a non-delivery report (NDR) to the sender
- if there is a communication problem,
- provides no mechanism for persistent storage of messages
Securing SMTP
- communications can be secured using TLS
- works like HTTPS
- certificate on the SMTP server
- negotiation between client and server about which cipher to use
- two ways for SMTP to use TLS:
- STARTTLS
- command that upgrades an existing insecure connection to use TLS
- referred to as explicit TLS or opportunistic TLS
- deprecated but still in wide use
- SMTPS
- aka implicit TLS
- establishes the secure connection before any SMTP commands are exchanged
- e.g., HELO
- preferred method
- STARTTLS
- works like HTTPS
Configuration
- SMTP configuration ports and services:
- Port 25
- used for message relay between SMTP servers or message transfer agents (MTAs)
- STARTTLS command can be used to setup secure connection
- Port 465
- used for SMTP Submission with implicit TLS
- is a subset of SMTP that allows the message submission agent (MSA) part of a mail client to transfer messages for delivery by a server
- now deprecated in standards documentation
- used for SMTP Submission with implicit TLS
- Port 587
- used by mail clients for SMTP Submission with explicit TLS
- servers should use STARTTLS and require authentication before message submission
- Port 25
Info
- mail clients can use port 25 to submit messages to the server for delivery
- not best practice
- typically reserved for relay between servers