Thanks for reply! Answer below:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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?
>
Empty string, so "". I have even changed this experimentally to this:
"""
user_query = \
SELECT \
1002 AS uid \
, 1002 AS gid \
, CONCAT('/www/home/vmail/domains/', SUBSTRING(d.name, 1,
1), '/', d.name, '/', u.username) AS home \
, IF(namespace_prefix="", "", 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
"""
Result is same, error from log:
"""
Sep 26 15:12:25 server dovecot: imap([email protected]): Error: user
[email protected]: Initialization failed: namespace configuration error:
list=yes requires prefix=yes to end with separator
Sep 26 15:12:25 server dovecot: imap([email protected]): Error: Invalid user
settings. Refer to server log for more information.
"""
With NULL in DB (and using first query version of course) error is same,
like above.
Thanks!
Ain