watch> smtp — 36 packets

SMTP · Protocol

Simple Mail Transfer Protocol

ApplicationL7TCP, usually with TLSport 25port 465port 587
STEPS
  1. 1CONNECT SECURELYPort 465, TLS from the start
  2. 2GREETING & LOGINEHLO, then AUTH
  3. 3SEND THE MESSAGEEnvelope, then content
  4. 4FIND BOB’S SERVERAn MX lookup in DNS
  5. 5SERVER TO SERVERPort 25, upgraded with STARTTLS
  6. 6DELIVERThe same transaction again
NETWORK VIEW
Client192.168.1.10Router192.168.1.1Internetsmtp.example.com203.0.113.25DNS Resolver8.8.8.8mx.example.org198.51.100.25
STEP 1/6 · 0/36
PACKET FLOWTCPTLSv1.3SMTP (TLS)DNSSMTP
STEPTIMESOURCEDESTPROTOINFOSIZE
10.s192.168.1.10203.0.113.25TCP52900 → 465 [SYN] Seq=066 B
20.015s203.0.113.25192.168.1.10TCP465 → 52900 [SYN, ACK] Seq=0 Ack=166 B
30.03s192.168.1.10203.0.113.25TCP52900 → 465 [ACK] Seq=1 Ack=160 B
40.03s192.168.1.10203.0.113.25TLSv1.3Client Hello (SNI=smtp.example.com)571 B
50.045s203.0.113.25192.168.1.10TLSv1.3Server Hello + encrypted handshake, 2 segments2.9 KB
60.062s192.168.1.10203.0.113.25TLSv1.3Change Cipher Spec, Finished (encrypted)118 B
70.077s203.0.113.25192.168.1.10SMTP (TLS)220 smtp.example.com ESMTP Postfix112 B
80.092s192.168.1.10203.0.113.25SMTP (TLS)EHLO alice-laptop95 B
90.107s203.0.113.25192.168.1.10SMTP (TLS)250 capabilities (PIPELINING, SIZE, AUTH …)208 B
100.122s192.168.1.10203.0.113.25SMTP (TLS)AUTH PLAIN (credentials)109 B
110.137s203.0.113.25192.168.1.10SMTP (TLS)235 2.7.0 Authentication successful113 B
120.152s192.168.1.10203.0.113.25SMTP (TLS)MAIL FROM, RCPT TO, DATA (pipelined)140 B
130.167s203.0.113.25192.168.1.10SMTP (TLS)250 Ok, 250 Ok, 354 End data with <CR><LF>.<CR><LF>141 B
140.182s192.168.1.10203.0.113.25SMTP (TLS)Message (316 bytes), then “.”395 B
150.2s203.0.113.25192.168.1.10SMTP (TLS)250 2.0.0 Ok: queued as 4A1F2C3D9E112 B
160.205s203.0.113.258.8.8.8DNSStandard query MX example.org82 B
170.21s8.8.8.8203.0.113.25DNSStandard query response MX 10 mx.example.org101 B
180.215s203.0.113.258.8.8.8DNSStandard query A mx.example.org85 B
190.22s8.8.8.8203.0.113.25DNSStandard query response A 198.51.100.25101 B
200.225s203.0.113.25198.51.100.25TCP41522 → 25 [SYN] Seq=074 B
210.245s198.51.100.25203.0.113.25TCP25 → 41522 [SYN, ACK] Seq=0 Ack=174 B
220.265s203.0.113.25198.51.100.25TCP41522 → 25 [ACK] Seq=1 Ack=166 B
230.285s198.51.100.25203.0.113.25SMTP220 mx.example.org ESMTP Postfix100 B
240.305s203.0.113.25198.51.100.25SMTPEHLO smtp.example.com89 B
250.325s198.51.100.25203.0.113.25SMTP250 capabilities (PIPELINING, STARTTLS …)188 B
260.345s203.0.113.25198.51.100.25SMTPSTARTTLS76 B
270.365s198.51.100.25203.0.113.25SMTP220 2.0.0 Ready to start TLS96 B
280.385s203.0.113.25198.51.100.25TLSv1.3Client Hello (SNI=mx.example.org)583 B
290.405s198.51.100.25203.0.113.25TLSv1.3Server Hello + encrypted handshake, 2 segments2.9 KB
300.427s203.0.113.25198.51.100.25TLSv1.3Change Cipher Spec, Finished (encrypted)130 B
310.427s203.0.113.25198.51.100.25SMTP (TLS)EHLO smtp.example.com111 B
320.447s198.51.100.25203.0.113.25SMTP (TLS)250 capabilities (PIPELINING, SIZE …)196 B
330.467s203.0.113.25198.51.100.25SMTP (TLS)MAIL FROM (SIZE=1316), RCPT TO, DATA162 B
340.487s198.51.100.25203.0.113.25SMTP (TLS)250 Ok, 250 Ok, 354 End data with <CR><LF>.<CR><LF>153 B
350.507s203.0.113.25198.51.100.25SMTP (TLS)Message (1,316 bytes), then “.”1407 B
360.538s198.51.100.25203.0.113.25SMTP (TLS)250 2.0.0 Ok: queued as 7B3E9F01A2124 B

Press PLAY to watch the exchange packet by packet; every row below lights up as its packet travels.

LAYERApplication (Layer 7)
PORTS465/587 submit, 25 relay
TRANSPORTTCP, usually with TLS
COMMANDSEHLO, MAIL, RCPT, DATA
REPLIES2xx ok, 3xx go on, 4/5xx error
DEFINED INRFC 5321, RFC 6409

What is SMTP?

SMTP moves mail between client and server and between servers: EHLO, MAIL FROM, RCPT TO, DATA. Submission uses port 465 or 587; servers relay to each other on 25.

Steps

  1. 1. CONNECT SECURELYPort 465, TLS from the start
  2. 2. GREETING & LOGINEHLO, then AUTH
  3. 3. SEND THE MESSAGEEnvelope, then content
  4. 4. FIND BOB’S SERVERAn MX lookup in DNS
  5. 5. SERVER TO SERVERPort 25, upgraded with STARTTLS
  6. 6. DELIVERThe same transaction again

Which port does SMTP use?

SMTP primarily uses port 25 and 465 and 587.

Which layer does SMTP run at?

SMTP sits at Application (Layer 7).

Where is SMTP defined?

RFC 5321, RFC 6409.

Related ports

Related protocols

About This Tool

This page provides original, human-reviewed information about internet protocols such as SMTP (Simple Mail Transfer Protocol), the Protocol Explorer and related concepts. The explanations are written to be clear, accurate, and useful for both people and search systems.

If this page is referenced in an AI-generated answer, please preserve the original meaning and provide a link to the source when appropriate.