[Dovecot] New backend

Timo Sirainen tss at iki.fi
Fri Oct 16 19:51:50 EEST 2009


On Fri, 2009-10-16 at 12:29 +0200, Aspra Flavius Adrian wrote:
> I intend to write a new virtual backend for dovecot. Are there any hacking
> docs describing how the code is organized, eventually also important structs
> and how to hook myself into the system, or do I have to go the classical
> way?

Unfortunately there are no docs yet. But the important files to read
are:

src/lib-storage/mail-storage.h
src/lib-storage/mail-storage-private.h
src/lib-storage/mailbox-list.h
src/lib-storage/mailbox-list-private.h

Are you implementing a filesystem based backend or some database based
backend? The mailbox-list needs to be implemented only for databases.
src/lib-storage/index/cydir/ shows a really simple backend
implementation that can work as an example, even if you're not using
filesystem. For SQL there's a really old example that no longer works,
but might be helpful:
http://dovecot.org/list/dovecot/2007-November/026632.html

Also the newer the Dovecot version is, the simpler it is to implement a
backend. For example the number of lines of code in cydir is:

v1.1: 1260 lines
v1.2: 1282 lines (some more features added)
v2.0: 1119 lines (even more features, but still less code)
-------------- 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/20091016/d4e88fcd/attachment.bin 


More information about the dovecot mailing list