Skip to content

Support Imap4rev2 short tags#123

Open
cmouse wants to merge 3 commits intodovecot:mainfrom
cmouse:imap4rev2
Open

Support Imap4rev2 short tags#123
cmouse wants to merge 3 commits intodovecot:mainfrom
cmouse:imap4rev2

Conversation

@cmouse
Copy link
Copy Markdown
Contributor

@cmouse cmouse commented May 7, 2026

JIRA: DOV-8669

Comment thread tests/mock-imap4rev2.py
coverage. Speaks just enough IMAP for imaptest's stress-mode startup
(banner -> LOGIN -> [ENABLE] -> LIST/SELECT/NOOP/LOGOUT) and emits
short-form tagged replies (tag OK\\r\\n with no resp-text) under one of
two policies:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to start adding mock servers, especially for such a trivial changes as this?..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least until dovecot has something we can test against

cmouse added 3 commits May 7, 2026 11:17
RFC 9051 Appendix E.23 + Errata 7343 allow resp-text to be vacant
("tag OK\r\n", "* OK\r\n"). Accept those forms when IMAP4rev2 is in
effect for this connection -- either client->imap4rev2_enabled is
set after ENABLE IMAP4REV2, or the user opted in via the imap4rev2
cmdline (conf.imap4rev2). The latter covers servers that emit
IMAP4rev2 syntax before ENABLE has been negotiated, e.g. dovecot
built with --enable-experimental-imap4rev2.

Without either signal, surface the short tagged form as an explicit
error so the imap4rev1 strictness check stays.
Bundles a minimal mock IMAP server with two modes (compliant emits
short replies only after ENABLE IMAP4REV2; rogue emits them from the
start) and a bash runner that asserts three cases:

 - compliant mock + imap4rev2 cmdline: clean run, no resp-text errors.
 - rogue mock without imap4rev2 cmdline: imaptest surfaces the missing
   resp-text error, proving the strict gate still fires.
 - rogue mock + imap4rev2 cmdline: imaptest accepts the short form
   (mirrors dovecot --enable-experimental-imap4rev2 behavior).

All cases pass append=0 so the test does not depend on a default
mbox fixture file.
Needed so the static workflow exercises the IMAP4rev2 code path that
imaptest now covers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants