PROTOCOL EXPLORERLearn how the internet works
Now learningIMAP · Mailbox synchronizationOverview · 5 steps
Learning progress0%
0 / 14 complete · 0 in progress
Mail Server198.51.100.25InternetRouter192.168.1.1Client192.168.1.10

Protocol overview

IMAP

Active

Internet Message Access Protocol

Work with server-side mailboxes, tagged commands, flags and selective fetches. IMAP supports a mailbox shared across several devices.

Layer
Application (Layer 7)
Default port
143 / 993 implicit TLS
Transport
TCP
Data format
Tagged text commands + mailbox data
Defined in
RFC 9051
Read the complete guide ↗

Packet flow

DNSTCPRequestResponse
No.TimeSourceDestinationProtocolInfoSize
10.000s198.51.100.25192.168.1.10IMAP* OK IMAP ready71 B
20.024s192.168.1.10198.51.100.25IMAPa1 LOGIN learner teaching-only86 B
30.048s198.51.100.25192.168.1.10IMAPa1 OK authenticated75 B
40.072s192.168.1.10198.51.100.25IMAPa2 SELECT INBOX71 B
50.096s198.51.100.25192.168.1.10IMAP* 1 EXISTS105 B
60.120s192.168.1.10198.51.100.25IMAPa3 UID FETCH 42 (BODY.PEEK[HEADER])91 B
70.144s198.51.100.25192.168.1.10IMAP* 1 FETCH (UID 42 BODY[HEADER] {17}126 B
80.168s192.168.1.10198.51.100.25IMAPa4 UID STORE 42 +FLAGS (\Seen)86 B
90.192s198.51.100.25192.168.1.10IMAP* 1 FETCH (FLAGS (\Seen))95 B
100.216s192.168.1.10198.51.100.25IMAPa5 LOGOUT65 B

How IMAP Syncs Mailboxes and Flags

Follow IMAP SELECT, UID FETCH and UID STORE in a mailbox session. See how a client fetches headers and updates the server’s read flag.

Understanding IMAP

Work with server-side mailboxes, tagged commands, flags and selective fetches. IMAP supports a mailbox shared across several devices.

Default port
143 / 993 implicit TLS
Transport / carrier
TCP
Category
application

What to look for in the lab

Find UID 42 in the header fetch and the later flag update. BODY.PEEK requests the header without marking the message read. The later STORE command explicitly adds the read flag to that same message.

1. Authenticate securely

An IMAP session starts with a server greeting. The lab uses synthetic LOGIN data to expose syntax; real authentication needs TLS.

2. Select a mailbox

SELECT INBOX returns mailbox state including message counts and UIDVALIDITY. Sequence numbers can change when messages are removed.

3. Fetch only what is needed

FETCH can request flags, headers or body sections. UID commands address more stable identifiers within a mailbox validity period.

4. Synchronize flags

STORE changes flags such as \Seen. Untagged responses can report mailbox changes; tagged responses identify command completion.

5. Finish the session

LOGOUT closes the session. Downloaded content and server-side state are separate: fetching a message need not remove it.

Protocol relationships

Protocols cooperate across layers. Compare the neighboring lessons to distinguish addressing, delivery, application semantics and encryption.

Standards and editorial method

Written and implemented independently by NavSprout. Lessons summarize public protocol standards using synthetic documentation addresses and fictional credentials. Consult the standards for complete wire formats and normative behavior.

RFC 9051 ↗

Check your understanding

Which feature is central to IMAP?