[Dovecot] userdb namespace settings bug

Alexander 'Leo' Bergolth leo at strike.wu.ac.at
Mon May 14 12:48:31 EEST 2012


On 05/14/2012 10:40 AM, Alexander 'Leo' Bergolth wrote:
> On 05/13/2012 11:40 PM, Alexander 'Leo' Bergolth wrote:
>> Since upgrading to 2.1.6, setting namespaces via environment variables
>> using a imap-postlogin-script *sometimes* doesn't work.
>>
>> See the error message:
>> Unknown userdb setting: plugin/namespace/s-gsd/prefix=Shared/GSD/
> 
> The prefix "plugin/" is added in mail-storage-service.c:set_line():
> 
> -------------------- 8< --------------------
>         if (!settings_parse_is_valid_key(set_parser, key)) {
>                 /* assume it's a plugin setting */
>                 key = t_strconcat("plugin/", key, NULL);
> -------------------- 8< --------------------
> 
> Looks like dovecot doesn't think that s-gsd isn't a valid namespace...
> Maybe the order of parsing the userdb settings is not well defined?
> 
> I think it should parse the list of allowed namespaces first
> (namespace=s-gsd s-kit s-rufhilfe s-sef s-homepage) and the namespace specific
> settings after that.
> 
> However, the debug output shows a different order:
> 
> -------------------- 8< --------------------
> May 13 23:00:22 samba dovecot: imap: Debug: Unknown userdb setting: plugin/namespace/s-gsd/prefix=Shared/GSD/
> May 13 23:00:22 samba dovecot: imap: Debug: Unknown userdb setting: plugin/namespace/s-rufhilfe/location=maildir:/var/spool/mail/Shared/Rufhilfe:INDEX=~/Maildir/index/Shared/Rufhilfe
> May 13 23:00:22 samba dovecot: imap: Debug: Added userdb setting: namespace=s-gsd s-kit s-rufhilfe s-sef s-homepage
> May 13 23:00:22 samba dovecot: imap: Debug: Added userdb setting: namespace/s-rufhilfe/separator=/
> -------------------- 8< --------------------
> 
> The first two namespace settings are rejected because the allowed namespaces are
> not configured yet.
> The third line configures the namespaces and subsequent namespace-settings are working fine.
> 
> Does that sound reasonable?
> 
> Any hints on how to change the order of userdb settings?

OK, got it.

userdb settings are parsed in the same order as set in USERDB_KEYS.
The key NAMESPACES has to be defined before the namespace-specific keys.

My post-login script was setting this variable dynamically from a hash
so the order was undefined. That's why it did actually work sometimes... :-)

Cheers,
--leo
-- 
e-mail   ::: Leo.Bergolth (at) wu.ac.at
fax      ::: +43-1-31336-906050
location ::: IT-Services | Vienna University of Economics | Austria




More information about the dovecot mailing list