mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 12:24:38 +03:00
imapserver: only send OLDNAME in LIST responses when IMAP4rev2 was enabled
OLDNAME is included in IMAP4rev2, but not in IMAP4rev1. it is also included in the NOTIFY extension, but we don't implement that yet. found by Damian Poddebniak with https://github.com/duesee/imap-flow, thanks!
This commit is contained in:
@ -32,9 +32,15 @@ func TestRename(t *testing.T) {
|
||||
tc.client.Subscribe("x/y/c") // For later rename, but not affected by rename of x.
|
||||
tc2.transactf("ok", "noop") // Drain.
|
||||
|
||||
tc.transactf("ok", "rename x y")
|
||||
tc.transactf("ok", "rename x z")
|
||||
tc2.transactf("ok", "noop")
|
||||
tc2.xuntagged(imapclient.UntaggedList{Separator: '/', Mailbox: "y", OldName: "x"})
|
||||
tc2.xuntagged(imapclient.UntaggedList{Separator: '/', Mailbox: "z"})
|
||||
|
||||
// OldName is only set for IMAP4rev2 or NOTIFY.
|
||||
tc2.client.Enable("IMAP4rev2")
|
||||
tc.transactf("ok", "rename z y")
|
||||
tc2.transactf("ok", "noop")
|
||||
tc2.xuntagged(imapclient.UntaggedList{Separator: '/', Mailbox: "y", OldName: "z"})
|
||||
|
||||
// Rename to a mailbox that only exists in database as subscribed.
|
||||
tc.transactf("ok", "rename y sub")
|
||||
|
Reference in New Issue
Block a user