Problem to override setting with empty string via userdb

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Fri Sep 26 14:19:10 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 26 Sep 2014, Ain wrote:

There seems to be no way, in order to override a non-empty 
namespace/default/prefix with an empty value. My test system is Dovecot 
v2.2.13 (35c3194900b7), the current hg version.

See below for an example with SQL. Returning an empty string '' using SQL 
results into namespace/default/prefix=yes, the boolean string "yes" does 
replace the empty string returned by SQL. Using a NULL value, you can work 
around this, but in this the default value must be empty.

The applies to LDAP as well, I assume.

It definitly applies to userdb_import returned by LDAP, too: 
http://wiki2.dovecot.org/UserDatabase/ExtraFields?highlight=%28userdb_import%29

The string:

namespace/default/prefix=<TAB>namespace/inbox/prefix

sets both namespace/default/prefix and namespace/inbox/prefix to 'yes'. 
The '=' does not matter.

====
> Sorry, using NULL indeed works correctly. My previous test with NULL was
> little bit flawed.
>
>> On Thu, 25 Sep 2014, Ain wrote:
>>
>>> I had working setup, where namespace settings (including prefix) was
>>> queried over SQL. Now, after installing new Dovecot to new server (using
>>> same configuration), this is not working anymore.
>>>
>>> Log shows following error:
>>>
>>> """
>>> Initialization failed: namespace configuration error: list=yes requires
>>> prefix=yes to end with separator
>>> """
>>>
>>> relevant part from dovecot-sql.conf.ext:
>>> """
>>> user_query = \
>>>        SELECT \
>>>                  1002 AS uid \
>>>                , 1003 AS gid \
>>>                , CONCAT('/www/home/vmail/domains/', SUBSTRING(d.name, 1,
>>> 1), '/', d.name, '/', u.username) AS home \
>>>                , namespace_prefix AS 'namespace/default/prefix' \
>>>                , 'yes' AS 'namespace/default/inbox' \
>>>                , '%s' AS 'mail_service' \
>>>        FROM vm_domain d \
>>>        INNER JOIN vm_user u ON u.vm_domain_id = d.id \
>>>        WHERE d.name = '%d' AND u.username = '%n' AND u.active = 1 AND
>>> d.active = 1
>>> """
>>
>> what do you return as namespace_prefix, NULL vs. '' ? Could you try the
>> other value?

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBVCV13nz1H7kL/d9rAQLOUwgAneROV2VCx6kbckPo5+pP5VBh2CX6ns7B
WD0QVb4/DdP+VcsGCYsKrNmrRA7UA+QMRzjEmpPD4M6UonhfzyrjfatUeTHvQFxC
I96+9EPNImCSEujfEp7IvH/S9jebfxYCv23XbY4OQniw+CYHDqVucQ9uV/AEaAe2
OEBJwxP+RPnlVNxo4A9Pt4/GOpNcViCu8FeP74MoyGLyHpWrCqNocse8P1tKRSni
gYTB7q2i29UhUfF/WFaaK1pR7sLG0TT1QJ0ZCOLtQMfQPQd8fPwRuxodCsVUDSU4
+IOzWFwQZU7LszSNN4mKetY/jMwW45eVggTIU0ThMuGP8kf4AQWD5w==
=L1Qz
-----END PGP SIGNATURE-----


More information about the dovecot mailing list