Bug Report: %% variables not expanded properly with shared namespace using . as separator

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Fri Feb 19 10:09:45 UTC 2016


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

On Fri, 19 Feb 2016, Hugh Bragg wrote:

> Subject: Bug Report: %% variables not expanded properly with shared namespace
>     using . as separator
> 
> I think this is a bug.
> I'd expect that location %% variables are translated the same way %
> variables are interpreted, but apparently this isn't the case.
> virtual folders work fine, but my shared folders fail because of the .
> in the domain name.
> What I get is the following:
>
> # doveadm acl debug -u user1 at domain1.com.au shared.user2 at domain2.com.au
> doveadm(user1 at domain1.com.au): Error: Mailbox 'com.au' in namespace
> 'shared.user2 at domain2.' doesn't exist in
> /var/mail/vhosts/domain2/user2/mail/.com.au

> namespace others {
>  list = children
>  location =
> maildir:/var/mail/vhosts/%%d/%%n/mail:INDEX=/var/mail/vhosts/%d/%n/shared/%%u
>  prefix = shared.%%u.

The mailbox Trash of user user1 at domain1.com.au would spell as IMAP token:

shared.user1 at domain1.com.au.Trash

Because . is the hierarchie separator, Dovecot must break the string at 
the 2nd ., because it cannot determine which dot comes from a domain name 
and which is a separator.

You need another hierarchie separator for all your namespaces.
http://wiki2.dovecot.org/Namespaces?highlight=%28separator%29

"IMAP clients, Sieve scripts and many parts of Dovecot configuration use 
the configured separator when referring to mailboxes. This means that if 
you change the separator, you may break things."
Meaning e.g. the fileinto in Sieve scripts need to use the other 
separator, too.

>  separator = .
>  subscriptions = yes
>  type = shared
> }
> namespace virtual {
>  location = virtual:/var/mail/vhosts/%d/%n/virtual
>  prefix = virtual.
>  separator = .
> }
> passdb {
>  args = scheme=PLAIN username_format=%u /etc/dovecot/dovecot-users
>  driver = passwd-file
> }
> plugin {
>  acl = vfile
>  acl_shared_dict = file:/var/mail/vhosts/shared-mailboxes.db
>  sieve = ~/.dovecot.sieve
>  sieve_dir = ~/sieve
>  sieve_global_dir = /var/mail/vhosts/sieve-global
> }
> protocols = imap lmtp sieve
> service auth-worker {
>  user = vmail
> }
> service auth {
>  unix_listener /var/spool/postfix/private/auth {
>    group = postfix
>    mode = 0660
>    user = postfix
>  }
>  unix_listener auth-userdb {
>    group = vmail
>    mode = 0660
>    user = vmail
>  }
> }
> service imap-login {
>  inet_listener imap {
>    port = 143
>  }
>  inet_listener imaps {
>    port = 0
>    ssl = yes
>  }
> }
> service lmtp {
>  unix_listener /var/spool/postfix/private/dovecot-lmtp {
>    group = postfix
>    mode = 0600
>    user = postfix
>  }
> }
> service managesieve-login {
>  inet_listener sieve {
>    port = 4190
>  }
> }
> service pop3-login {
>  inet_listener pop3 {
>    port = 0
>  }
>  inet_listener pop3s {
>    port = 0
>  }
> }
> ssl = required
> ssl_cert = </etc/pki/dovecot/certs/hjbmx.ddns.net.cert.pem
> ssl_cipher_list = PROFILE=SYSTEM
> ssl_key = </etc/pki/dovecot/private/hjbmx.ddns.net.key.pem
> userdb {
>  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
>  driver = static
> }
> protocol lmtp {
>  mail_plugins = virtual, acl , sieve
> }
> protocol lda {
>  mail_plugins = virtual, acl , sieve
> }
> protocol imap {
>  mail_plugins = virtual, acl , imap_acl
> }
>

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEVAwUBVsbp6Xz1H7kL/d9rAQJumAf/YtIXGM1t4WalzhrjP5azXEDXa1twsRdY
hHTycmmUpsmXlMS4Ol3kT3u/YpEBk/VMMqPay8gMuKD9rQ69wAqH9xIt47mWfwFG
NsBGbDeoCePFmdtZ+nix2RkWApNL3JDONIF0UtpUHvFj7QJrW+jqVExdBeXdijGv
rkbUr8fZl+4AM8m6CG07opTgxcgF6mFlakNe022uYSJdvH7UUY/fjJE/n+pj6lQ4
FUJ2RKSJWflJif8Klfs91iHJ9X4RVloY/WNJj52HWkthSgz3Xc9O1GTM8D1U24ZG
rZHkdDtkryC709NKqWJqnQt3ejQ1KP7mGy7zY2we+wkv8SdajbagQA==
=dNkH
-----END PGP SIGNATURE-----


More information about the dovecot mailing list