IMAP Response Codes Reference

IMAP tagged, untagged and response code tokens with RFC 3501 context.

Searchable IMAP response reference covering status responses (OK, NO, BAD, PREAUTH, BYE) and bracketed response codes like READ-ONLY, UIDVALIDITY and TRYCREATE, each with RFC source and meaning.

What is the difference between IMAP NO and BAD?

NO is an operational failure: the command was valid but the server could not complete it for an expected reason, such as a mailbox that does not exist or wrong credentials. BAD is a protocol error: the command was unrecognized or its syntax was invalid, which usually points to a client bug rather than a user-fixable condition.

The IMAP Response Codes Reference is a searchable lookup for the status words and bracketed response codes that an IMAP4rev1 server sends. IMAP responses are richer than a single number — they combine a tagged or untagged status with an optional machine-readable code in square brackets — and this tool decodes both sides, from OK/NO/BAD to [READ-ONLY], [UIDVALIDITY] and [OVERQUOTA].

How it works

IMAP, defined in RFC 3501 (and updated by RFC 9051), structures every server message as a status plus optional detail:

Tagged    A001 OK LOGIN completed          ← ends command A001
Untagged  * 23 EXISTS                        ← server data, no tag
Untagged  * OK [UIDVALIDITY 1] Predictable   ← status + response code
Greeting  * PREAUTH ... already logged in    ← connection greeting

The status response is one of OK (success), NO (operational failure), BAD (protocol/syntax error), PREAUTH (greeting: pre-authenticated) or BYE (server closing the connection). The optional response code in square brackets — such as TRYCREATE, READ-ONLY, UIDNEXT or AUTHENTICATIONFAILED — gives software an exact reason it can act on without parsing English text. This tool keeps both sets in your browser and filters them as you type.

Example and tips

A normal mailbox open looks like A002 SELECT INBOX* OK [UIDVALIDITY 1234567890]* OK [UIDNEXT 4001]A002 OK [READ-WRITE] SELECT completed. Read the bracketed codes, not just the final word: a NO [TRYCREATE] tells you to create the mailbox and retry, and a NO [OVERQUOTA] tells you the user is out of storage — two failures that share the same NO status but need completely different handling. Always surface [ALERT] text verbatim to the user, as the RFC requires.