Hi
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?
Thanks
--Flavius
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)
Are you implementing a filesystem based backend or some database based backend?
It's going to be couchdb-based. Are you aware of any existing efforts towards this direction? I'd be glad to give a helping hand.
Anyway, thanks for the information, I'll have a look at the API.
I've also found doc/wiki/Design.txt, is the information described there still valid for version 2.x (with respect to the header files you recommended me about, of course)? I would prefer to write my code future-oriented, for 2.x.
I'm also going to use some external libs. Is it ok to link dynamically to cURL and some other json library? (couchDB has a RESTful API).
On Fri, 2009-10-16 at 19:38 +0200, Aspra Flavius Adrian wrote:
Are you implementing a filesystem based backend or some database based backend?
It's going to be couchdb-based. Are you aware of any existing efforts towards this direction? I'd be glad to give a helping hand.
I've some future plans towards that: http://www.dovecot.org/list/dovecot/2009-August/041983.html
I've also found doc/wiki/Design.txt, is the information described there still valid for version 2.x (with respect to the header files you recommended me about, of course)? I would prefer to write my code future-oriented, for 2.x.
The Design*.txt are the same as http://wiki.dovecot.org/Design/ and there isn't all that much in them. v2.x has some details changed, but it's about the same.
I'm also going to use some external libs. Is it ok to link dynamically to cURL and some other json library? (couchDB has a RESTful API).
If you implement it as a plugin (which should be possible) you can link whatever libraries you want. For example fts-solr already links to curl and that works fine.
participants (2)
-
Aspra Flavius Adrian
-
Timo Sirainen