]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Allow namespaces_created hook to return failure via user error.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 12 Jan 2017 14:20:40 +0000 (16:20 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 12 Jan 2017 14:22:34 +0000 (16:22 +0200)
src/lib-storage/mail-namespace.c

index 8c03eb24dfa99ee6b8069757bb9bf0d631317f00..9ae113d3a9a847ee2589ec181d70c08cc1fcb0c3 100644 (file)
@@ -384,6 +384,12 @@ int mail_namespaces_init_finish(struct mail_namespace *namespaces,
        T_BEGIN {
                hook_mail_namespaces_created(namespaces);
        } T_END;
+
+       /* allow namespace hooks to return failure via the user error */
+       if (namespaces->user->error != NULL) {
+               *error_r = t_strdup(namespaces->user->error);
+               return -1;
+       }
        return 0;
 }