On 5.5.2010, at 20.27, Jonathan Siegle wrote: >>>> - open INBOX from that namespace and keep it open >>> >>> Ok sync init would open /var/mail/%u >> >> Well, you would simply call mailbox_open(ns->list, "INBOX"). Dovecot >> internally then figures out that INBOX is /var/mail/%u based on the >> namespace's configuration. > > Ok. I couldn't find a mailbox_open that takes a list and char* as arguments, > but I found a mail_namespace_find_inbox function which works well.
Oh, I meant mailbox_alloc() actually. mail_namespace_find_inbox() returns the INBOX's namespace, but I think above I meant opening the hidden snarf-INBOX. But you probably do need mail_namespace_find*() to find the snarf namespace by its configured prefix. >> Also note that nothing here now assumes anything about what mailbox >> format is being used. The whole plugin should perhaps be renamed to >> "snarf", since it would work with any mailbox formats >> (source/destination could even be different formats). >> > Where do I specify the Destination mailbox in the config file? I have a > source of INBOX(/var/spool). Should I just tack on SNARF on the var list? > > namespace foo { > prefix = ~~Snarf/ > location = mbox~/mail:INBOX=/var/mail/%u:SNARF=/some/other/file > list = no > hidden = yes > inbox = yes > } Destination mailbox is always the default INBOX (and that you can find with the mail_namespace_find_inbox()). So something like: src = mailbox_alloc(snarf_ns->list, "INBOX"); dest = mailbox_alloc(inbox_ns->list, "INBOX");