]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
virtual: Allow "*" to match inbox=yes namespace if there's otherwise no prefix="...
authorTimo Sirainen <tss@iki.fi>
Fri, 8 Aug 2014 11:54:46 +0000 (14:54 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 8 Aug 2014 11:54:46 +0000 (14:54 +0300)
src/plugins/virtual/virtual-config.c

index 140201807e7a1fc15f94d84a32a478144d8f1e69..e48f2e11af7e075bd93fdc38330a81067c8ee44c 100644 (file)
@@ -263,6 +263,14 @@ static bool virtual_ns_match(struct mail_namespace *config_ns,
            (config_ns->flags & NAMESPACE_FLAG_AUTOCREATED) == 0 &&
            (iter_ns->flags & NAMESPACE_FLAG_AUTOCREATED) != 0)
                return TRUE;
+       if ((iter_ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0 &&
+           (config_ns->flags & NAMESPACE_FLAG_AUTOCREATED) != 0 &&
+           config_ns->prefix_len == 0) {
+               /* prefix="" namespace was autocreated, so e.g. "*" would match
+                  only that empty namespace. but we want "*" to also match
+                  the inbox=yes namespace, so check it here separately. */
+               return TRUE;
+       }
        return FALSE;
 }