Concepts / Network services

Network services

SMTP

Also called email, mail server, MX, relay, open relay, envelope, Received header, postfix

How mail moves: from a client to its own mail server, then from server to server, found by the domain's MX record.

Relayed by MX, steered by the envelope
Relayed by MX, steered by the envelope

The sender's server asks DNS for the recipient domain's MX record and relays the message there. Delivery follows the envelope addresses; the From: line people read is separate, and SMTP does not make the two agree.

SMTP moves mail: from a client to its own server, then server to server on TCP 25. The sending server looks up the recipient domain's MX record and relays the message there. Its commands: EHLO, MAIL FROM, RCPT TO, DATA. The envelope (MAIL FROM, RCPT TO) steers delivery; the headers (From:, To:) are what people read; nothing makes them agree. A server that relays for anyone is an open relay.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab