]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
virtual: Give a nice error message if mailbox's namespace isn't found.
authorTimo Sirainen <tss@iki.fi>
Wed, 25 Mar 2009 23:01:37 +0000 (19:01 -0400)
committerTimo Sirainen <tss@iki.fi>
Wed, 25 Mar 2009 23:01:37 +0000 (19:01 -0400)
--HG--
branch : HEAD

src/plugins/virtual/virtual-config.c

index 050a1da360d3d7c7eaf5c06c81a33920b48b3ddd..f37ebace40a646b40cd549839081092701fdb60c 100644 (file)
@@ -120,6 +120,11 @@ virtual_config_parse_line(struct virtual_parse_context *ctx, const char *line,
                line = "INBOX";
        bbox->name = p_strdup(ctx->pool, line);
        bbox->ns = mail_namespace_find(user->namespaces, &line);
+       if (bbox->ns == NULL) {
+               *error_r = t_strdup_printf("Namespace not found for %s",
+                                          bbox->name);
+               return -1;
+       }
        if (strchr(bbox->name, '*') != NULL ||
            strchr(bbox->name, '%') != NULL) {
                name = bbox->name[0] == '-' ? bbox->name + 1 : bbox->name;