How a message actually travels
A user types an address and presses send. The sending server looks up the recipient domain in DNS, the system that turns a name into an address, and asks one question: who accepts mail for this domain? The answer is the domain's MX records, short for mail exchanger, a list of mail servers with a preference number on each. Lowest number is tried first, and if none of them answer, the message sits in the sending server's queue and is retried for a few days before it gives up.
nslookup -type=mx company.comThe two servers then talk SMTP, the protocol for moving a message from one server to another. Server to server that is usually port 25; a mail client submitting a new message to its own provider uses port 587 with authentication. SMTP only ever pushes mail outward. Reading an inbox is a separate protocol: IMAP, or POP3 on an older setup, or a vendor protocol like MAPI or ActiveSync. Mixing those two jobs up is the single most common confusion on a mail ticket.
Which means a "cannot send" fault and a "cannot receive" fault are usually two different systems failing, even though the user describes both as "my email is broken".
One message, sender to mailbox
Received: header on top, so the headers read bottom to top are the route it took with a timestamp on each handover. A long unexplained gap between two of them is where the delay happened.- Message ID
- A unique string the originating server assigns, written like an address in angle brackets. Every log entry on every hop refers to the same message by that ID, so when two systems disagree about whether something was delivered, it is how you prove they are talking about the same email.
- Received header
- One line per hop, added at the top, so the oldest is at the bottom. Gives you the sending IP, the receiving host and the time.
- Envelope sender
- The address the servers actually negotiate with, also called the return path. It can differ from the
From:address a user sees, which is exactly how spoofing works.