[Dovecot] Help with some features to do in a plugin

Timo Sirainen tss at iki.fi
Thu Jul 22 21:16:24 EEST 2010


On Thu, 2010-07-22 at 15:01 -0300, Alex Baule wrote:

> I need to develop some plugins, but i can't know if is possible to do or
> not.
> 
> 1 - There is a way to deny a email to be moved from one folder to another ?
> example:
> the user is only allowed to move mails in Spam Folder to Trash Folder.
> 
> If yes, were i can find a code example or a plugin to extract some idea.

There is no "move" feature in IMAP or Dovecot, only copy+delete. For
example ACL plugin can deny saves and copies to a mailbox.

Anyway, override mailbox.copy() and return -1 if you don't like the
source or destination mailbox. You can hook into that from
hook_mailbox_allocated, similar to many plugins override e.g.
mailbox.transaction_begin().

> 2 - It's possible to deny a user to create a subscription folder ?

Override mailbox.create() and return -1 if you don't want it created.
Hook the same way as copy().



More information about the dovecot mailing list