What Is an SMTP Server?
An SMTP server is any server that uses the Simple Mail Transfer Protocol (SMTP) to send, receive, or relay email messages. Defined in RFC 5321, SMTP is the foundational protocol for email delivery on the internet. Every email you send passes through at least one SMTP server on its way to the recipient.
SMTP Protocol Basics
SMTP is a text-based, command-response protocol. A typical SMTP transaction follows this sequence:
- Connection. The sending server opens a TCP connection to the receiving server (typically on port 25 for server-to-server delivery).
- EHLO/HELO. The sender identifies itself with an EHLO (Extended HELO) or HELO command, announcing its hostname. EHLO also negotiates supported extensions like STARTTLS and AUTH.
- MAIL FROM. The sender specifies the envelope sender (return-path) address.
- RCPT TO. The sender specifies one or more envelope recipients.
- DATA. The sender transmits the message content (headers and body), ending with a line containing only a period (
.). - QUIT. The session is closed.
The receiving server responds to each command with a three-digit status code (e.g., 250 OK, 550 Mailbox Not Found).
MTA, MSA, and MDA
SMTP servers perform different roles depending on their position in the delivery chain:
- MSA (Mail Submission Agent). Accepts email from a user's mail client (MUA) on port 587 with authentication (SMTP AUTH) and STARTTLS encryption. Your email client (Outlook, Thunderbird, Apple Mail) connects to the MSA when you hit Send.
- MTA (Mail Transfer Agent). Relays email between servers. The MTA looks up the recipient domain's MX records and connects to the destination server on port 25. A message may pass through multiple MTAs.
- MDA (Mail Delivery Agent). Delivers the message to the recipient's mailbox. The MDA is often a separate process (like Dovecot or procmail) that stores the message for retrieval via IMAP or POP3.
Envelope vs. Header
SMTP distinguishes between two layers of addressing:
- Envelope addresses (MAIL FROM and RCPT TO) are used for routing and delivery. They are set during the SMTP transaction and are not visible to the end user by default.
- Header addresses (From, To, Cc) are part of the message content and are what the recipient sees in their mail client.
These can differ legitimately (e.g., mailing lists, forwarding) or maliciously (spoofing). SPF checks the envelope sender domain, while DMARC ensures alignment between the envelope and the visible From header.
Hop-by-Hop Delivery
Email delivery is not a single direct connection. A message may traverse multiple MTAs:
- Your mail client submits to your provider's MSA (port 587).
- The MSA hands off to the outbound MTA.
- The outbound MTA queries DNS for the recipient's MX records and connects to the destination MTA (port 25).
- The destination MTA may relay to an internal MTA or deliver directly to the MDA.
Each hop adds a Received header to the message, creating a traceable path. Analyze these headers with our header analysis tool.
Verifying Your SMTP Configuration
A misconfigured SMTP server can cause delivery failures, authentication problems, or relay vulnerabilities. Check your domain's MX records with our MX lookup tool and run a full analysis to verify that your sending infrastructure is correctly authenticated.
Stay on top of your email infrastructure. Sign up for the InboxTooling newsletter for deliverability tips, tool updates, and best practices.