Julien Danjou
2010-May-20 14:44 UTC
[Dovecot] Permanent flags not announced and public mailbox with per-user index
Hi, I've a set of public mailboxes that all users can access. The index is stored per user, so each user can mark the message as read for themselves. This is with dovecot 1.2.10. However, when selecting the mailbox, system flags are not announced as permanent but only as session flags: 3619 SELECT "public.Admin" * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) * OK [PERMANENTFLAGS ()] Read-only mailbox. * 324 EXISTS * 0 RECENT * OK [UNSEEN 171] First unseen. * OK [UIDVALIDITY 1254326934] UIDs valid * OK [UIDNEXT 1102] Predicted next UID * OK [HIGHESTMODSEQ 1] Highest 3445 OK [READ-ONLY] Select completed. I think (reading the RFC, but I bet you know it better than me) that FLAGS should also been set in PERMANENTFLAGS since they can be permanent. The relevant code seems to be in commands-util.c (dovecot 1.2.11): void client_send_mailbox_flags(struct client *client, bool selecting) { [?] if (mailbox_is_readonly(client->mailbox)) { client_send_line(client, "* OK [PERMANENTFLAGS ()] " "Read-only mailbox."); } else { [?] } } Even if it's true that the Maildir is read-only, it's still possible to store \Seen permanently. Am I getting things wrong, or is this a bug? If I'm correct, a simple fix MAY be not to send the PERMANENTFLAGS at all since the RFC says: OK [PERMANENTFLAGS (<list of flags>)] A list of message flags that the client can change permanently. If this is missing, the client should assume that all flags can be changed permanently. Thanks, -- Julien Danjou // ? <julien at danjou.info> http://julien.danjou.info -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20100520/a30e1d79/attachment-0002.bin>
Timo Sirainen
2010-May-25 15:09 UTC
[Dovecot] Permanent flags not announced and public mailbox with per-user index
On Thu, 2010-05-20 at 16:44 +0200, Julien Danjou wrote:> However, when selecting the mailbox, system flags are not announced as > permanent but only as session flags:Yeah, that's a bug I guess..> 3445 OK [READ-ONLY] Select completed...> Even if it's true that the Maildir is read-only, it's still possible to > store \Seen permanently.I think the main bug is that maildir is thought to be read-only. IMAP ACL RFC says READ-ONLY shouldn't be returned unless nothing can be changed. Does this help? http://hg.dovecot.org/dovecot-1.2/rev/c2c1639b91ee