mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 03:26:37 +03:00
imapserver: implement rfc 9590, returning metadata in the extended list command
only with "return" including "metadata". so clients can quickly get certain metadata (eg for display, such as a color) for mailboxes. this also adds a protocol token type "mailboxt" that properly encodes to utf7 if required.
This commit is contained in:
@ -216,4 +216,21 @@ func TestListExtended(t *testing.T) {
|
||||
tc.transactf("bad", `list (recursivematch remote) "" "*"`) // "remote" is not a base selection option.
|
||||
tc.transactf("bad", `list (unknown) "" "*"`) // Unknown selection options must result in BAD.
|
||||
tc.transactf("bad", `list () "" "*" return (unknown)`) // Unknown return options must result in BAD.
|
||||
|
||||
// Return metadata.
|
||||
tc.transactf("ok", `setmetadata inbox (/private/comment "y")`)
|
||||
tc.transactf("ok", `list () "" ("inbox") return (metadata (/private/comment /shared/comment))`)
|
||||
tc.xuntagged(
|
||||
ulist("Inbox"),
|
||||
imapclient.UntaggedMetadataAnnotations{
|
||||
Mailbox: "Inbox",
|
||||
Annotations: []imapclient.Annotation{
|
||||
{Key: "/private/comment", IsString: true, Value: []byte("y")},
|
||||
{Key: "/shared/comment"},
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
tc.transactf("bad", `list () "" ("inbox") return (metadata ())`) // Metadata list must be non-empty.
|
||||
tc.transactf("bad", `list () "" ("inbox") return (metadata (/shared/comment "/private/comment" ))`) // Extra space.
|
||||
}
|
||||
|
Reference in New Issue
Block a user