[Dovecot] How to achieve: Automove of mails
Dear All,
I was wondering if this is possible:
I am using namespaces to support my environment which has legacy mboxes and new maildirs.
In it looks like:
namespace private { separator = / inbox = yes prefix = location = maildir:/home/virtual/%d/home/%n/Maildir/ } namespace private { separator = / prefix = mail2/ inbox = yes hidden = yes location = mbox:/home/virtual/%d/home/var/spool/mail/%n:INBOX=/home/virtual/%d/var/spool/mail/%n }
This basically means that there is a hidden inbox "mail2/INBOX" that the user cannot see but which can referenced and accessed.
What I would like is for Dovecot to automatically move all mail (actually only as much as possible within quota limits) in "mail2/INBOX" into "/INBOX" whenever INBOX is checked/expunged.
An alternative acceptable solution is to have something that moves mail once it has read. I would then symlink mail2/INBOX as a "New mail" folder. Once user's read their mail it is moved to the standard /INBOX folder.
Are either of the above possible natively or do I need to look at something like plugins? Incidently where is the documentation guiding plugin development? I've looked at the website but can't find anything either by browsing or searching.
Many thanks, Daniel
On Mon, 2006-03-27 at 14:49 +0100, Daniel Watts wrote:
This basically means that there is a hidden inbox "mail2/INBOX" that the user cannot see but which can referenced and accessed.
What I would like is for Dovecot to automatically move all mail (actually only as much as possible within quota limits) in "mail2/INBOX" into "/INBOX" whenever INBOX is checked/expunged.
An alternative acceptable solution is to have something that moves mail once it has read. I would then symlink mail2/INBOX as a "New mail" folder. Once user's read their mail it is moved to the standard /INBOX folder.
Are either of the above possible natively or do I need to look at something like plugins?
It sounds similar to what I already have in TODO:
- move /var/mail/user to ~/mbox if ~/mbox exists.. supposedly this
could be useful if /var/mail doesn't have quota, but ~/mail does.
now, what do we then do if we can move only some of the mails?..
I'm not really sure what's a good way to do this. I guess the mailbox could be opened using Dovecot's normal mail accessing functions, and then the mails would be copied and marked deleted.
But I'm not sure what happens if you reach quota limits while copying lots of mails within one transaction. It'll probably delete all the new mails.
Incidently where is the documentation guiding plugin development? I've looked at the website but can't find anything either by browsing or searching.
There's no real plugin API or anything, so you'd just call Dovecot's functions normally. Although there are a couple of special hooks which you can you. I think looking at lib-storage/mail-storage.h and the plugins that come with Dovecot would get you started.
participants (2)
-
Daniel Watts
-
Timo Sirainen