[Dovecot] no bookeeping using public folders
Using dovecot 1.0.10. In the config:
namespace public { separator = / hidden = no prefix = Flock/ location = maildir:/home/baratin/PublicMaildir:CONTROL=~/Maildir/control/Flock:INDEX=/var/dovecot/index/%u/Flock }
This should be a public mail folder owned by "baratin", "read only" for all other users. Every user has his/her own control and index area related to this public folder. I have verified, they are owner and "group" of the respective control and index area.
The problem, while using Thunderbird: The "read only" user can delete messages or mark then read. But after a new session, all the messages are still "new". Of course, only "baratin" is the owner.
The problem, while using mutt and IMAP: mutt refuse to change any flag because the folder is "read only". Of course, this is correct.
My question: Why is no bookkeeping maintained for "other" users, although every one has his/her own control and index structure ?
Thanks a lot !
Claude
On Mon, 2008-05-19 at 09:17 +0200, Claude Frantz wrote:
The problem, while using Thunderbird: The "read only" user can delete messages or mark then read. But after a new session, all the messages are still "new". Of course, only "baratin" is the owner.
The problem, while using mutt and IMAP: mutt refuse to change any flag because the folder is "read only". Of course, this is correct.
My question: Why is no bookkeeping maintained for "other" users, although every one has his/her own control and index structure ?
So you'd want all users to be able to have their own private flags? If you create dovecot-shared file, the seen flag will be private, but others will still be shared. This is currently hard coded, but it's pretty easy to change from sources if you really want to:
src/lib-storage/index/maildir/maildir-storage.c around line 544:
mbox->private_flags_mask = MAIL_SEEN;
Change that to:
mbox->private_flags_mask = MAIL_FLAGS_MASK;
Timo Sirainen wrote:
The problem, while using Thunderbird: The "read only" user can delete messages or mark then read. But after a new session, all the messages are still "new". Of course, only "baratin" is the owner.
So you'd want all users to be able to have their own private flags?
The "Seen" flag as private is sufficient here.
If you create dovecot-shared file, the seen flag will be private, but others will still be shared. This is currently hard coded, but it's pretty easy to change from sources if you really want to:
[....]
Many thanks, Timo, for this interesting information. But, as stated above, the "Seen" flag is sufficient and this is the default.
The strange behaviour seems to be probably related to Thunderbird. When opening the connection to the public shared folder, Thunderbird shows the number of ALL messages in the folder, in the window in which one the folders related to the accounts are displayed. Usually only the number of unread messages is displayed here. In the window showing the subject, sender, etc... of the messages, only the unread messages are displayed when using the options "View, Threads, Unread". Therefore, Thunderbird knowns about what has been read. But I ignore if Thunderbird is using an own bookkeeping or if this information comes from the server.
In the related "dovecot-keywords" file, there is only one line which contains "0 unknown-0". This seems strange to me.
Please explain me, where the "private seen flag" is located. I think, it cannot be in "dovecot-uidlist" because the second entry in every line is the filename in the folder where the message file is located, and the "only reading" user is not the owner of this file. Are I'm right ?
I think, I have to investigate further.
Many thanks again, Claude
On Thu, 2008-05-29 at 10:21 +0200, Claude Frantz wrote:
The strange behaviour seems to be probably related to Thunderbird. When opening the connection to the public shared folder, Thunderbird shows the number of ALL messages in the folder, in the window in which one the folders related to the accounts are displayed. Usually only the number of unread messages is displayed here. In the window showing the subject, sender, etc... of the messages, only the unread messages are displayed when using the options "View, Threads, Unread". Therefore, Thunderbird knowns about what has been read. But I ignore if Thunderbird is using an own bookkeeping or if this information comes from the server.
I don't really know about Thunderbird. You could always verify these things by talking IMAP protocol directly:
1 login user pass 2 status mailbox (messages unseen recent)
In the related "dovecot-keywords" file, there is only one line which contains "0 unknown-0". This seems strange to me.
Does each user have their own control directory? If so that explains it. The control directory should probably be shared (as long as there are enough write permissions for everyone to be able to update/replace dovecot-uidlist). dovecot-shared file can be used to affect created files' group/permissions (chgrp mailshared dovecot-shared, chmod 0660 dovecot-shared).
Anyway the unknown-0 means that Dovecot found "a" flag from maildir filenames (the flags/keywords are stored in filenames), but it didn't exist in dovecot-keywords file, so it added it. So it's not really possible to use keywords without sharing control directory.
Please explain me, where the "private seen flag" is located. I think, it cannot be in "dovecot-uidlist" because the second entry in every line is the filename in the folder where the message file is located, and the "only reading" user is not the owner of this file. Are I'm right ?
Private seen flags are stored only in index files.
Timo Sirainen wrote:
I don't really know about Thunderbird. You could always verify these things by talking IMAP protocol directly:
1 login user pass 2 status mailbox (messages unseen recent)
The server reports the same number of messages and unseen's.
In the related "dovecot-keywords" file, there is only one line which contains "0 unknown-0". This seems strange to me.
Does each user have their own control directory? If so that explains it.
Yes, every user has his/her own control directory because (s)he should have the option to subscribe the folders (s)he want to have.
The control directory should probably be shared (as long as there are enough write permissions for everyone to be able to update/replace dovecot-uidlist).
Which one control directory should be shared ? The one owned by the user which is owner of the Maildir which should be shared or the one of every user which should get a read-only access ?
dovecot-shared file can be used to affect created files' group/permissions (chgrp mailshared dovecot-shared, chmod 0660 dovecot-shared).
http://wiki.dovecot.org/SharedMailboxes says: "Dovecot versions older than v1.1 ignore dovecot-shared for copied messages when maildir_copy_with_hardlinks=yes." I have an older version and this option is set to "yes".
Anyway the unknown-0 means that Dovecot found "a" flag from maildir filenames (the flags/keywords are stored in filenames), but it didn't exist in dovecot-keywords file, so it added it. So it's not really possible to use keywords without sharing control directory.
This discrepency can occur when the reading user's dovecot-keywords file does not contain an entry related to the flags which are found at the end of the filename of the message file, which is owned by another user than the reading one.
Private seen flags are stored only in index files.
I'm surprised to see that there are no dovecot.* files in the reading user's index directories related to the shared folders. The directories have been created but not the index files. The dovecot.* files exists in the directories related to the non-shared folders.
Again, many thanks for your help.
Claude
participants (3)
-
Claude Frantz
-
Claude Frantz
-
Timo Sirainen