mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 03:26:37 +03:00
imapserver: implement UIDONLY extension, RFC 9586
Once clients enable this extension, commands can no longer refer to "message sequence numbers" (MSNs), but can only refer to messages with UIDs. This means both sides no longer have to carefully keep their sequence numbers in sync (error-prone), and don't have to keep track of a mapping of sequence numbers to UIDs (saves resources). With UIDONLY enabled, all FETCH responses are replaced with UIDFETCH response.
This commit is contained in:
@ -7,11 +7,19 @@ import (
|
||||
)
|
||||
|
||||
func TestStatus(t *testing.T) {
|
||||
testStatus(t, false)
|
||||
}
|
||||
|
||||
func TestStatusUIDOnly(t *testing.T) {
|
||||
testStatus(t, true)
|
||||
}
|
||||
|
||||
func testStatus(t *testing.T, uidonly bool) {
|
||||
defer mockUIDValidity()()
|
||||
tc := start(t)
|
||||
tc := start(t, uidonly)
|
||||
defer tc.close()
|
||||
|
||||
tc.client.Login("mjl@mox.example", password0)
|
||||
tc.login("mjl@mox.example", password0)
|
||||
|
||||
tc.transactf("bad", "status") // Missing param.
|
||||
tc.transactf("bad", "status inbox") // Missing param.
|
||||
@ -53,7 +61,7 @@ func TestStatus(t *testing.T) {
|
||||
})
|
||||
|
||||
tc.client.Select("inbox")
|
||||
tc.client.StoreFlagsSet("1", true, `\Deleted`)
|
||||
tc.client.UIDStoreFlagsSet("1", true, `\Deleted`)
|
||||
tc.transactf("ok", "status inbox (messages uidnext uidvalidity unseen deleted size recent appendlimit)")
|
||||
tc.xuntagged(imapclient.UntaggedStatus{
|
||||
Mailbox: "Inbox",
|
||||
|
Reference in New Issue
Block a user