[Dovecot] userdb namespace settings bug

Alexander 'Leo' Bergolth leo at strike.wu.ac.at
Mon May 14 11:40:13 EEST 2012


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.
> 
> Sometimes, the prefix of a namespace isn't set correctly, but is set to
> an empty string, which leads to the following error:
> namespace configuration error: Duplicate namespace prefix: ""
> 
> However, the environment is set correctly, the error seems to occur when
> parsing the environment.
> 
> See the attached log:
> The postlogin-script sets the environment variables attached as
> dovecot-postlogin-environment.txt. (dumped from postlogin script via env)
> 
> However, the variable "NAMESPACE/S-GSD/PREFIX=Shared/GSD/" gets parsed
> as: plugin/namespace/s-gsd/prefix=Shared/GSD/
> 
> 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?

Thanks,
--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