[Dovecot] Mongo backend for userdb and passdb

Damien Churchill damoxc at gmail.com
Wed Mar 20 12:29:13 EET 2013

On 28 February 2013 14:47, Damien Churchill <damoxc at gmail.com> wrote:
> On 28 February 2013 14:40, Timo Sirainen <tss at iki.fi> wrote:
>> On 28.2.2013, at 15.13, Damien Churchill <damoxc at gmail.com> wrote:
>>> On 28 February 2013 14:01, Timo Sirainen <tss at iki.fi> wrote:
>>>> On 28.2.2013, at 12.28, Damien Churchill <damoxc at gmail.com> wrote:
>>>>> I was wondering if any work had been made (out of tree) or has been
>>>>> planned for a mongo driver? If not is it something that would be of
>>>>> any interest for being included?
>>>> Have you noticed the memcached and redis backends for lib-dict, and the passdb/userdb dict? So you'd only need to implement dict-mongodb.c for Dovecot v2.2. Feel free to start developing. :) v2.2 also has its own lib-http if that's needed.
>>> I hadn't no! That makes things far easier :) Do you have any
>>> preference on which driver to use? I was thinking of selecting
>>> libmongo-client[0] as its made its way into repositories unlike the
>>> official mongo C driver.
>>> [0] https://github.com/algernon/libmongo-client
>> Any external library actually makes things more difficult, because they can easily only be loaded by the dict server, which means every lookup have to be proxied through it (similar problem with dict-sql). Although in v2.2 there's some new code for how to load SSL library dynamically only when needed, and the same could be done for your dict-mongodb at least in theory..
> Okay I'll have a look at doing it that way. Is the ssl code in
> lib-ssl-iostream or somewhere else?


I've been messing about with this and I think a similar configuration
format to the sql dict driver would be handy, although I imagine the
same could also be achieved with just lots of uri arguments. Mongo
isn't really a key/value store so you'd want to be able to specify
fields within the document to query upon/fetch.

I'm still getting to grips with the architecture of things so not
entirely sure what the best course of action would be here. If using
the map style config would be desirable then creating some shared
parser that sql and mongodb can use would be good.

More information about the dovecot mailing list