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:
@ -2,13 +2,19 @@ package imapserver
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mjl-/mox/imapclient"
|
||||
)
|
||||
|
||||
func TestUnsubscribe(t *testing.T) {
|
||||
tc := start(t)
|
||||
tc := start(t, false)
|
||||
defer tc.close()
|
||||
|
||||
tc.client.Login("mjl@mox.example", password0)
|
||||
tc.login("mjl@mox.example", password0)
|
||||
|
||||
tc2 := startNoSwitchboard(t, false)
|
||||
defer tc2.closeNoWait()
|
||||
tc2.login("mjl@mox.example", password0)
|
||||
|
||||
tc.transactf("bad", "unsubscribe") // Missing param.
|
||||
tc.transactf("bad", "unsubscribe ") // Missing param.
|
||||
@ -17,9 +23,16 @@ func TestUnsubscribe(t *testing.T) {
|
||||
tc.transactf("no", "unsubscribe a/b") // Does not exist and is not subscribed.
|
||||
tc.transactf("ok", "unsubscribe expungebox") // Does not exist anymore but is still subscribed.
|
||||
tc.transactf("no", "unsubscribe expungebox") // Not subscribed.
|
||||
tc2.transactf("ok", "noop")
|
||||
tc2.xuntagged(imapclient.UntaggedList{Flags: []string{`\NonExistent`}, Separator: '/', Mailbox: "expungebox"})
|
||||
|
||||
tc.transactf("ok", "create a/b")
|
||||
tc2.transactf("ok", "noop")
|
||||
tc.transactf("ok", "unsubscribe a/b")
|
||||
tc.transactf("ok", "unsubscribe a/b") // Can unsubscribe even if there is no subscription.
|
||||
tc2.transactf("ok", "noop")
|
||||
tc2.xuntagged(imapclient.UntaggedList{Flags: []string(nil), Separator: '/', Mailbox: "a/b"})
|
||||
|
||||
tc.transactf("ok", "subscribe a/b")
|
||||
tc.transactf("ok", "unsubscribe a/b")
|
||||
}
|
||||
|
Reference in New Issue
Block a user