[Dovecot] Request for help with new plugin

Timo Sirainen tss at iki.fi
Sat Oct 18 17:19:42 EEST 2008


On Thu, 2008-10-09 at 10:26 -0500, John Lightsey wrote:
> 1. Is there any documentation of how the hook system and virtual  
> mailboxes work outside of the source code?

Unfortunately I haven't had time to write docs.

> 2. I'd like the Trash cleanup to occur at logout, but the closest I  
> could find was mailbox close.  This makes the behavior a little  
> quirky.  It seems like Dovecot closes the mailbox each time it  
> performs an operation on it, so when the client gets a list of mail in  
> the box it does a close and the oldest items in the returned list will  
> actually be expunged.

You could hook into mail_storage.destroy() (the same way you're hooking
into mailbox_open).

> 3. Is SAVE_DATE the correct field to be looking for here?  I want the  
> expiration to be based on the amount of time the letter has spent in  
> the trash folder.

Yes.

> 4. For searching through the Trash folder, SEARCH_BEFORE doesn't seem  
> to match up with SAVE_DATE.  Is there some other way to limit the  
> search results to the dates that will fall before a certain SAVE_DATE  
> value?

No, but it doesn't really matter. The oldest mails are always at the
beginning of the mailbox. So just search for all mails and stop
searching when you encounter a mail with too high save_date.

About the code:

>   rc = gettimeofday( &now, NULL);

Just use ioloop_time (from ioloop.h). It's updated all the time
automatically and it's close enough to the current time always.

Other than that (and the SEARCH_BEFORE) it looked good.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20081018/813dbabb/attachment-0001.bin 


More information about the dovecot mailing list