diff --git a/imapserver/list.go b/imapserver/list.go index ed8ffa2..7bdebd6 100644 --- a/imapserver/list.go +++ b/imapserver/list.go @@ -58,7 +58,7 @@ func (c *conn) cmdList(tag, cmd string, p *parser) { p.xspace() patterns, isList := p.xmboxOrPat() isExtended = isExtended || isList - var retSubscribed, retChildren, retSpecialUse bool + var retSubscribed, retChildren bool var retStatusAttrs []string if p.take(" RETURN (") { isExtended = true @@ -79,7 +79,8 @@ func (c *conn) cmdList(tag, cmd string, p *parser) { retChildren = true case "SPECIAL-USE": // ../rfc/6154:478 - retSpecialUse = true + // We always include special-use mailbox flags. Mac OS X Mail 16.0 (sept 2023) does + // not ask for the flags, but does use them when given. ../rfc/6154:146 case "STATUS": // ../rfc/9051:7072 ../rfc/5819:181 p.xspace() @@ -189,7 +190,7 @@ func (c *conn) cmdList(tag, cmd string, p *parser) { if !listSubscribed && retSubscribed && info.subscribed { flags = append(flags, bare(`\Subscribed`)) } - if retSpecialUse && info.mailbox != nil { + if info.mailbox != nil { if info.mailbox.Archive { flags = append(flags, bare(`\Archive`)) } diff --git a/imapserver/list_test.go b/imapserver/list_test.go index 49d81a8..72fd1c1 100644 --- a/imapserver/list_test.go +++ b/imapserver/list_test.go @@ -27,13 +27,13 @@ func TestListBasic(t *testing.T) { tc.xuntagged(ulist("Inbox")) tc.last(tc.client.List("%")) - tc.xuntagged(ulist("Archive"), ulist("Drafts"), ulist("Inbox"), ulist("Junk"), ulist("Sent"), ulist("Trash")) + tc.xuntagged(ulist("Archive", `\Archive`), ulist("Drafts", `\Drafts`), ulist("Inbox"), ulist("Junk", `\Junk`), ulist("Sent", `\Sent`), ulist("Trash", `\Trash`)) tc.last(tc.client.List("*")) - tc.xuntagged(ulist("Archive"), ulist("Drafts"), ulist("Inbox"), ulist("Junk"), ulist("Sent"), ulist("Trash")) + tc.xuntagged(ulist("Archive", `\Archive`), ulist("Drafts", `\Drafts`), ulist("Inbox"), ulist("Junk", `\Junk`), ulist("Sent", `\Sent`), ulist("Trash", `\Trash`)) tc.last(tc.client.List("A*")) - tc.xuntagged(ulist("Archive")) + tc.xuntagged(ulist("Archive", `\Archive`)) tc.client.Create("Inbox/todo")