[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@danjou.info> http://julien.danjou.info
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
On Tue, May 25 2010, Timo Sirainen wrote:
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
It will not help my mail client (Gnus).
It does not care about the READ-ONLY status to store the \Seen flag for example, it cares about PERMANENTFLAGS. But it seems that is is its right. What do you think ?
Cheers,
Julien Danjou // ᐰ <julien@danjou.info> http://julien.danjou.info
On ma, 2010-05-31 at 13:26 +0200, Julien Danjou wrote:
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
It will not help my mail client (Gnus).
It does not care about the READ-ONLY status to store the \Seen flag for example, it cares about PERMANENTFLAGS. But it seems that is is its right. What do you think ?
Actually a side effect of that change is that it also changes PERMANENTFLAGS. Dovecot's PERMANENTFLAGS handling is a bit stupid now I guess. It either has all or nothing.
On Mon, May 31 2010, Timo Sirainen wrote:
Actually a side effect of that change is that it also changes PERMANENTFLAGS. Dovecot's PERMANENTFLAGS handling is a bit stupid now I guess. It either has all or nothing.
I've tried the patch applying it on dovecot 1.2.11. Unfortunately, the mailbox is still announced the same way (READ-ONLY without the PERMANENTFLAGS).
-- Julien Danjou // ᐰ <julien@danjou.info> http://julien.danjou.info
On Mon, May 31 2010, Timo Sirainen wrote:
Actually a side effect of that change is that it also changes PERMANENTFLAGS. Dovecot's PERMANENTFLAGS handling is a bit stupid now I guess. It either has all or nothing.
My bad, Timo. It does work on some mailboxes actually.
It seems I've some mailbox (even in the same directory) that are different and where it does not work, but I don't know why yet.
-- Julien Danjou // ᐰ <julien@danjou.info> http://julien.danjou.info
On Mon, May 31 2010, Julien Danjou wrote:
My bad, Timo. It does work on some mailboxes actually.
It seems I've some mailbox (even in the same directory) that are different and where it does not work, but I don't know why yet.
Answer is that I missed the `dovecot-shared' files in the directory where it did not worked. :) I've added this file where it was missing, and now I can say that the patch totally fix my issue:
. select public.Stg-ee
- FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
- OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
- 12 EXISTS
- 0 RECENT
- OK [UNSEEN 2] First unseen.
- OK [UIDVALIDITY 1254336597] UIDs valid
- OK [UIDNEXT 13] Predicted next UID
- OK [HIGHESTMODSEQ 1] Highest . OK [READ-WRITE] Select completed.
Thanks a lot Timo !
Cheers,
Julien Danjou // ᐰ <julien@danjou.info> http://julien.danjou.info
participants (2)
-
Julien Danjou
-
Timo Sirainen