[Dovecot] plugin development guide for non-FS backing store

Timo Sirainen tss at iki.fi
Mon Sep 21 12:40:25 EEST 2009


On Sep 21, 2009, at 12:32 PM, Chang Song wrote:

> This is something completely new.
> We are connecting to our pre-existing custom-made mail server.
> IMAP needs to be plugged into the infrastructure.

OK, so you do have some existing mails that need to be accessed.

> So basically we can simply use existing index_* since we need to have
> index files (on local fs) no matter what.

Right. And even if you didn't use actual index files, the same  
index_*() functions will be useful for in-memory indexes.

> I saw dbox source file there. Is the layer stable (as far as API  
> goes)?
> Tell me more about the abstraction layer.

It probably won't be useful then, because if you have existing mails  
they won't be in dbox format. I guess you could maybe do some kind of  
translation on the fly, but that could just be more trouble than  
implementing your own storage backend.

I'd probably start by implementing your own mailbox-list backend. Then  
you could see that IMAP's LIST, CREATE, DELETE, RENAME commands work.  
That should be somewhat easy to do. You could temporarily just use  
e.g. Maildir backend and:

mail_location = maildir:~/Maildir:LAYOUT=rpc

After that works, create "rpc" mail-storage as well. cydir might be a  
good an easy example. The biggest problem is the "mailbox_sync" part.  
It's easiest if you can just trust that the local index files are up- 
to-date, otherwise you somehow need to figure out what had changed in  
the mailbox and update the indexes.


More information about the dovecot mailing list