[Dovecot] Question about mbox_snarf and dovecot2.0

Jonathan Siegle jsiegle at psu.edu
Thu Apr 29 21:00:36 EEST 2010


On Apr 29, 2010, at 1:27 PM, Timo Sirainen wrote:

> On Thu, 2010-04-29 at 11:11 -0400, Jonathan Siegle wrote:
>>> namespace {
>>> location = mbox:~/mail
>>> ..
>>> }
>>> namespace {
>>> prefix = ~~MboxSnarf~~/ # or whatever unique string you can think of
>>> location = mbox:~/mail:INBOX=/var/mail/%u
>>> list = no
>>> hidden = yes
>>> }
>>> plugin {
>>> mbox_snarf = ~~MboxSnarf~~/
>>> }
> 
> I guess my idea above was that mbox_snarf would:
> 
> 1) Do nothing special when opening the mailbox (unlike now), except add
> hooks to sync_init and mailbox_close.
> 
Ok gotcha.

> 2) when mbox_snarf_sync_init() is called the first time:
> - find mbox_snarf namespace
Know how to do that.

> - open INBOX from that namespace and keep it open

Ok sync init would open /var/mail/%u

> - goto 3)
> 
> 3) every time mbox_snarf_sync_init() is called:
> - call mbox_snarf()
> 
Oh Ok. So mbox_snarf would open the SNARF FILE and do the move and then return it like it does now.

> 4) on mailbox_close() close the snarf mailbox
> 
>> As I need this to function, I've been thinking about your words above
>> and been reading http://wiki.dovecot.org/Design/Storage/Plugins. The
>> mentality of it reminds me of the lazy-expunge-plugin, but this API is
>> taking some time getting used to. Any pointers would be appreciated.
> 
> Maybe the above helps? That Plugins wiki page probably won't help you
> much, since the current mbox_snarf already sets up the plugin stuff
> correctly. "Overriding methods" is probably the only important part
> there. The other Design/* pages could be more helpful.


Yeah your thoughts help here. Thanks. Do you have a working example of mailbox_opened ? Would that solve my IDLE problem(doesn't stat /var/spool at all so no new messages)?

-Jonathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2209 bytes
Desc: not available
Url : http://dovecot.org/pipermail/dovecot/attachments/20100429/bfa58b86/attachment.bin 


More information about the dovecot mailing list