On Tue, 2006-03-21 at 15:47 -0500, David Powers wrote:
I have written an alpha version of an auto trash plugin for dovecot. When compiled in any mail expunged from a non-Trash folder is moved to a folder named Trash. As of yet the folder is not created if it doesn't exist (the process fails before expunge). I would appreciate feedback of any sort. In addition, I am currently getting an error I haven't been able to puzzle out in the logs when it runs:
Mar 21 15:22:01 david dovecot: imap(david@grayskies.net): Timeout leak: 0x807fad0
Probably because you're not calling mailbox_close() for the mailbox you opened.
I see that it seems to relate to transactions somehow, but my few hours of playing with dovecot haven't given me the answer - so ideas/patches to the code would also be nice.
One problem is that it doesn't support "UID EXPUNGE" command where the command allows giving an UID range of the messages to expunge. Although Dovecot doesn't yet announce the UIDPLUS capability for this command, because it's only partially implemented, so at least currently it isn't a problem.
Maybe a bit cleaner way would be to hook into the actual expunge handler and do the copying there before calling the real expunge handler. I think that should work anyway :) plugins/acl/acl-mailbox.c shows an example how to do this.