Bug: empty prefix value in userdb lookup defaults to "yes"?

Aki Tuomi aki.tuomi at open-xchange.com
Fri Jul 2 12:09:50 EEST 2021


> On 02/07/2021 12:03 Dan Malm <dam at one.com> wrote:
> 
>  
> On 2021-07-02 10:56, Aki Tuomi wrote:
> > 
> >> On 02/07/2021 11:48 Dan Malm <dam at one.com> wrote:
> >>
> >>  
> >> Hi,
> >>
> >> I'm trying to migrate some users into our system from another one that
> >> also run dovecot but with different prefix and separator settings than
> >> we do.
> >>
> >> I've setup userdb to return these values for a test user to match the
> >> other systems separator/prefix setup:
> >> {
> >>   "home": "/customers/b/5/3/cdeadbeef/mail/m0123456789abcdef/",
> >>   "namespace/inbox/separator": "/",
> >>   "uid": 10000001,
> >>   "namespace/inbox/prefix": "",
> >>   "gid": 10000001
> >> }
> >>
> >> But the empty value for prefix seems to get converted to some default
> >> value of "yes" as when I log in with that user dovecot throws this error:
> >>
> >> Error: namespace configuration error: list=yes requires prefix=yes to
> >> end with separator /
> >>
> >> Dovecot version: 2.3.13
> >> OS: Ubuntu 20.04.2
> >>
> >> -- 
> >> BR/Mvh. Dan Malm, Systems Engineer, One.com
> > 
> > This is indeed what happens. Your best option is to not set the variable at all when it's empty.
> > 
> > Aki
> > 
> Not setting the variable in userdb will make it use the value from our
> 10-dovecot.conf which would make use "INBOX." though... Which is why i
> needed to get the new value from userdb...
> 
> The server is set up to use
> prefix=INBOX.
> separator=.
> 
> and we need to have this for some specific users only:
> prefix=
> separator=/
> 
> -- 
> BR/Mvh. Dan Malm, Systems Engineer, One.com

You can also use postlogin scripting to manipulate the namespaces after authentication, where you can do this cleanup.

Alternatively you could default to empty and provide INBOX. from userdb.

Aki


More information about the dovecot mailing list