Frerich Raabe
2012-Oct-17 12:44 UTC
[Dovecot] Marking all mail in one folder of public mailbox as read
Hi, I'm running Dovecot 1.2.17 on FreeBSD 9 to serve an archive of a few internal mailinglists. The archive is implemented using a public namespace: namespace private { separator = / prefix inbox = yes } namespace public { separator = / prefix = Lists/ location = maildir:/home/vmail/lists/Maildir:CONTROL=~/Maildir/lists:INDEX=~/Maildir/lists subscriptions = no } As you can see, the CONTROL/INDEX files are stored per-user to allow private \Seen flags. The different mailinglists are all sent to the 'lists' user which has a Sieve script to file them into different folders, so I have directories on my harddisk like /home/vmail/lists/Maildir/.somelist /home/vmail/lists/Maildir/.anotherlist Now, I'd like to mark the mail in *one* of those folders as \Seen by default. If the INDEX files weren't per-user, it would simply be a matter of using 'addflag "\Seen";' in the Sieve script of the lists user. Alas, this has no effect. Hence my question - how can I have the mail of just one mailinglist get marked as "read" for all users? So far, the only option I see is to add a second public namespace, with a different prefix - and this namespace doesn't use private CONTROL/INDEX files. However, I'd like to keep using the "Lists" prefix if possible to avoid too many changes to the clients. -- Frerich Raabe - raabe at froglogic.com www.froglogic.com - Multi-Platform GUI Testing
Timo Sirainen
2012-Oct-18 03:31 UTC
[Dovecot] Marking all mail in one folder of public mailbox as read
On 17.10.2012, at 15.44, Frerich Raabe wrote:> I'm running Dovecot 1.2.17 on FreeBSD 9 to serve an archive of a few internal mailinglists. The archive is implemented using a public namespace: > > namespace private { > separator = / > prefix > inbox = yes > } > > namespace public { > separator = / > prefix = Lists/ > location = maildir:/home/vmail/lists/Maildir:CONTROL=~/Maildir/lists:INDEX=~/Maildir/lists > subscriptions = no > } > > As you can see, the CONTROL/INDEX files are stored per-user to allow private \Seen flags. The different mailinglists are all sent to the 'lists' user which has a Sieve script to file them into different folders, so I have directories on my harddisk like > > /home/vmail/lists/Maildir/.somelist > /home/vmail/lists/Maildir/.anotherlist > > Now, I'd like to mark the mail in *one* of those folders as \Seen by default. If the INDEX files weren't per-user, it would simply be a matter of using 'addflag "\Seen";' in the Sieve script of the lists user. Alas, this has no effect. > > Hence my question - how can I have the mail of just one mailinglist get marked as "read" for all users?You can't with the above settings. It would require writing the seen flag to all users' index files. Not easy to do and definitely not efficient to do. Maybe if there was some kind of a mixed hybrid of accepting seen flag changes from the shared index, but no such code exists (also private/shared index separation doesn't exist before v2.2).> So far, the only option I see is to add a second public namespace, with a different prefix - and this namespace doesn't use private CONTROL/INDEX files. However, I'd like to keep using the "Lists" prefix if possible to avoid too many changes to the clients.Use: prefix=Lists/anotherlist/ location = maildir:/home/vmail/lists/sharedseen/Maildir Then deliver the mails to /home/vmail/lists/sharedseen/Maildir root directly. Of course this means that you need to create a namespace for each such list. Alternative would be to use prefix=Lists/sharedseen/ and create lists under it.
Frerich Raabe
2012-Oct-22 07:21 UTC
[Dovecot] Marking all mail in one folder of public mailbox as read
Am 10/18/2012 5:31 AM, schrieb Timo Sirainen:> Use: > > prefix=Lists/anotherlist/ > location = maildir:/home/vmail/lists/sharedseen/Maildir > > Then deliver the mails to /home/vmail/lists/sharedseen/Maildir root directly. Of course this means that you need to create a namespace for each such list. > > Alternative would be to use prefix=Lists/sharedseen/ and create lists under it.Thanks, the second version is basically what I did! I added a new namespace namespace public { separator = / prefix = Lists/Archive/ location = maildir:/home/vmail/lists/archive/Maildir subscriptions = no } ...and then had my Sieve script fileinto that. Works fine! Thanks for your help! -- Frerich Raabe - raabe at froglogic.com www.froglogic.com - Multi-Platform GUI Testing