Skip to content

Scan your domain with 35 DNS and email security checks at zerohook.org.

What is / Full version

SMTP

RFC 5321 specifies commands, reply codes, and the envelope separate from message content.

Short answerAll topics in What is

The envelope

MAIL FROM establishes the reverse-path used for bounces. RCPT TO lists forward-path recipients. DATA transfers the message, which includes its own header fields such as From, To, and Subject.

Authentication mechanisms run during or after the envelope stage. SPF uses the session identity. DKIM signs the message header and body after the message is formed.

Reply codes

Permanent failures use 5xx codes. Temporary failures use 4xx codes. Enhanced status codes append machine-readable detail when both sides support them.

This reference quotes Google's public SMTP error list for Gmail-specific rows. The numeric patterns themselves come from the enhanced status code registry used with SMTP.

Submission ports

RFC 5321 focuses on relay between MTAs on port 25. Client submission often uses port 587 with STARTTLS and authentication extensions defined in other documents. The envelope semantics are the same once the session is established.

Session flow

A typical session opens with EHLO, optionally negotiates extensions such as STARTTLS from RFC 3207, then issues MAIL FROM, one or more RCPT TO, and DATA with the message content.

Reply codes in the 4xx range signal temporary failure; 5xx signal permanent failure for that command or recipient. Enhanced status codes add a structured x.y.z suffix when both peers support them.

The message transferred by DATA includes its own header section. Authentication mechanisms may inspect those headers after the DATA phase completes, which is why DKIM verification happens later than SPF in many pipelines.