Document live IMAP selected state

This commit is contained in:
Mario Fetka
2026-07-29 08:17:07 +02:00
parent 0c0d281b9f
commit 03a0226808
2 changed files with 42 additions and 1 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ review does not mark an open live test as passed.
| IMAP-04 | CAPABILITY, NOOP, LOGOUT, ID, and NAMESPACE | [PASS](test-evidence/0.7-r1.md#imap-01020304) | | |
| IMAP-05 | LIST, LSUB, extended LIST, LIST-STATUS, hierarchy quoting | [PASS](test-evidence/0.7-r1.md#imap-0506) | | |
| IMAP-06 | CREATE, DELETE, RENAME, SUBSCRIBE, UNSUBSCRIBE | [PASS](test-evidence/0.7-r1.md#imap-0506) | | |
| IMAP-07 | SELECT, EXAMINE, STATUS/SIZE, CHECK, CLOSE, UNSELECT | | | |
| IMAP-07 | SELECT, EXAMINE, STATUS/SIZE, CHECK, CLOSE, UNSELECT | [PASS](test-evidence/0.7-r1.md#imap-07) | | |
| IMAP-08 | APPEND, LITERAL+, APPENDLIMIT, flags/date, oversized literals | | | |
| IMAP-09 | FETCH/UID FETCH body, headers, partials, flags, envelope, binary | | | |
| IMAP-10 | STORE/UID STORE add/remove/replace flags and silent variants | | | |
+41
View File
@@ -3498,3 +3498,44 @@ IMAP-05/06 PASS host=127.0.0.1:993 delimiter=/ hierarchy=quoted list=percent/sta
The test creates only uniquely named disposable mailboxes for `test1`, removes
them before exit, and does not alter service configuration or existing mail.
## IMAP-07
Result: **PASS**
The installed `0c0d281b` GCC 15.3.0 debug build was exercised on 2026-07-29
with the reusable `imap-selected-state-check.py`. The test created two
disposable mailboxes and appended one disposable message using a synchronizing
IMAP literal. Rev1 SELECT returned EXISTS, RECENT, UIDVALIDITY, UIDNEXT, FLAGS,
PERMANENTFLAGS and a READ-WRITE completion. EXAMINE returned READ-ONLY with no
permanent flags. CHECK succeeded only in selected state, and an UNSELECT with
an extra argument was rejected without changing that state.
The message was marked `\Deleted`. UNSELECT preserved it, as did CLOSE after
EXAMINE. A subsequent read-write SELECT followed by CLOSE expunged it without
an EXPUNGE response and STATUS then reported zero MESSAGES and zero SIZE.
Empty-mailbox STATUS values and UID state were checked in both protocol modes.
After `ENABLE IMAP4rev2`, STATUS accepted DELETED and DELETED-STORAGE but
rejected RECENT; SELECT omitted RECENT, emitted the required LIST response,
and selecting a second mailbox emitted the CLOSED response code.
The source audit used current Cyrus IMAP `imap/imapd.c` as the implementation
comparison. Cyrus likewise separates EXAMINE read-only state, expunges on
CLOSE but not UNSELECT, emits CLOSED when rev2 selection replaces an open
mailbox, and refreshes selected-mailbox state before STATUS.
The first live attempt found a real APPEND deadlock: the IMAP agent buffered
the message sent to Store and waited for Store's completion without flushing
that buffer. After adding the same flush used by Bongo's other Store writers,
APPEND completed but exposed a second error: the UIDPLUS parser expected the
NMAP response code even though `NMAPReadResponse(..., TRUE)` deliberately
returns only its payload. The corrected payload parser is covered by the
native `imap-uidplus` test and also fixes the later COPY/MOVE UIDPLUS paths.
```text
IMAP-07 PASS host=127.0.0.1:993 select=read-write examine=read-only status=rev1/rev2/size check=selected-only close=deselect/expunge-semantics unselect=no-expunge rev2=closed/list/no-recent cleanup=yes
```
The successful run removed its disposable message and mailboxes. The three
mailboxes left by deliberately interrupted diagnostic runs were separately
listed, matched by their unique test names, and removed afterward.