IMAP gives access to a mailbox that lives on the server. The client reads messages, files them into folders and sets flags, and all of this looks the same on a phone, a laptop and in webmail.
What IMAP can do
| Feature | What it means |
|---|---|
| Folders | creating, renaming and deleting folders (IMAP calls them mailboxes) |
| Flags | \Seen, \Answered, \Flagged, \Deleted are stored on the server |
| Search | the SEARCH command runs on the server, without downloading messages |
| Partial fetch | only the headers or a single attachment can be fetched |
| Synchronisation | an offline client compares its state with the server |
The specification is RFC 9051 (IMAP4rev2, August 2021), which replaced RFC 3501. The server listens on port 143 (unencrypted, usually with STARTTLS) or port 993 (implicit TLS); RFC 8314 recommends the latter.
An example session
C: a1 LOGIN anna secretS: a1 OK LOGIN completedC: a2 SELECT INBOXS: * 3 EXISTSS: a2 OK [READ-WRITE] SELECT completedC: a3 FETCH 3 (FLAGS BODY[HEADER])C: a4 LOGOUTIn IMAP, messages do not disappear until the user deletes them: this is what sets the protocol apart from POP3.
Sources
the term is written from these pagesVerified 9 Nov