[Dovecot] Problem with configuring dovecot to take namespaces from database

Marcin Mirosław marcin at mejor.pl
Fri Sep 9 14:24:08 EEST 2011


W dniu 08.09.2011 15:18, Timo Sirainen pisze:

> Forget all of that. I just tried a few ways and looks like you can add
> more namespaces by returning e.g. these fields (from SQL):
>
> namespace=nsname
> namespace/nsname/prefix=prefix/
> namespace/nsname/location=maildir:/elsewhere
> namespace/nsname/separator=/
>
> Where nsname is some unique name for the namespace. If you want more
> than one namespace, I think you can do it by adding another name to
> "namespace" field, e.g.:
>
> namespace=nsname nsname2 nsname3

select .... "test1 test2" AS namespace works, it gives me two 
namespaces. It's nice. Now i've another problem, how to configure them 
usinq sql. I can't do "recursive sql query" , sql can't create variable 
number of output columns depended on values in table.
E.g:
I imagine such table:
--------------------------------------------------------------
|user_id | namespace   |  prefix  | location                 |
--------------------------------------------------------------
| 648    | test1       | test1.   | mdbox:~/test1/.mdbox     |
--------------------------------------------------------------
| 648    | test2       | test2.   | maildir:~/test2/.maildir |
--------------------------------------------------------------
etc...

In query i have to know all namespaces names to mention them in query: 
select ... as "namespace/test1/prefix"
but i don't know if there is "test1" namespace untill i fetch record 
from table.

Ok, maybe could it be possible to do it in other way:
--------------------------------------------------------------------
|user_id | namespace_full_definition                               |
--------------------------------------------------------------------
| 7684   | /name=test1/prefix=test1./location=mdbox:~/test1/.mdbox/
               name=test2/prefix=test2/location=...                 | 
--------------------------------------------------------------------

but this isn't supported by dovecot as i know.
Maybe something like "user_namespace" query could be usefull? Query 
could be very easy:
select ... namespace_name, namespace_prefix, namespace_location where 
user='somuser' (and table schema like in first example).
Maybe there i other, way to do it by i can't see it now.

Btw, i can see dovecot 2.1 can proxy imap connections. It's a great idea!

Thanks.



More information about the dovecot mailing list