[Dovecot] How to achieve: Automove of mails

Timo Sirainen tss at iki.fi
Sun Apr 9 19:09:09 EEST 2006


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20060409/08a0faaf/attachment.pgp


More information about the dovecot mailing list