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,10 +7,18 @@ import (
|
||||
)
|
||||
|
||||
func TestUnselect(t *testing.T) {
|
||||
tc := start(t)
|
||||
testUnselect(t, false)
|
||||
}
|
||||
|
||||
func TestUnselectUIDOnly(t *testing.T) {
|
||||
testUnselect(t, true)
|
||||
}
|
||||
|
||||
func testUnselect(t *testing.T, uidonly bool) {
|
||||
tc := start(t, uidonly)
|
||||
defer tc.close()
|
||||
|
||||
tc.client.Login("mjl@mox.example", password0)
|
||||
tc.login("mjl@mox.example", password0)
|
||||
tc.client.Select("inbox")
|
||||
|
||||
tc.transactf("bad", "unselect bogus") // Leftover data.
|
||||
@ -19,7 +27,7 @@ func TestUnselect(t *testing.T) {
|
||||
|
||||
tc.client.Select("inbox")
|
||||
tc.client.Append("inbox", makeAppend(exampleMsg))
|
||||
tc.client.StoreFlagsAdd("1", true, `\Deleted`)
|
||||
tc.client.UIDStoreFlagsAdd("1", true, `\Deleted`)
|
||||
tc.transactf("ok", "unselect")
|
||||
tc.transactf("ok", "status inbox (messages)")
|
||||
tc.xuntagged(imapclient.UntaggedStatus{Mailbox: "Inbox", Attrs: map[imapclient.StatusAttr]int64{imapclient.StatusMessages: 1}}) // Message not removed.
|
||||
|
Reference in New Issue
Block a user