dovecot: Give better error messages if storage creation fails.
dovecot at dovecot.org
dovecot at dovecot.org
Sun Jul 15 14:44:26 EEST 2007
details: http://hg.dovecot.org/dovecot/rev/f40d16eed722
changeset: 6021:f40d16eed722
user: Timo Sirainen <tss at iki.fi>
date: Sun Jul 15 14:44:23 2007 +0300
description:
Give better error messages if storage creation fails.
diffstat:
1 file changed, 10 insertions(+), 9 deletions(-)
src/lib-storage/mail-namespace.c | 19 ++++++++++---------
diffs (39 lines):
diff -r b94fc6e80bae -r f40d16eed722 src/lib-storage/mail-namespace.c
--- a/src/lib-storage/mail-namespace.c Sun Jul 15 14:34:57 2007 +0300
+++ b/src/lib-storage/mail-namespace.c Sun Jul 15 14:44:23 2007 +0300
@@ -70,8 +70,8 @@ namespace_add_env(pool_t pool, const cha
ns->prefix = p_strdup(pool, prefix);
if (mail_storage_create(ns, NULL, data, user, flags, lock_method) < 0) {
- i_error("Failed to create storage for '%s' with data: %s",
- ns->prefix, data);
+ i_error("Namespace '%s' mail storage creation failed "
+ "with mail location: %s", ns->prefix, data);
return NULL;
}
@@ -213,16 +213,17 @@ int mail_namespaces_init(pool_t pool, co
ns->prefix = "";
if (mail_storage_create(ns, NULL, mail, user, flags, lock_method) < 0) {
- if (mail != NULL && *mail != '\0')
- i_error("Failed to create storage with data: %s", mail);
- else {
+ if (mail != NULL && *mail != '\0') {
+ i_error("Mail storage creation failed with "
+ "mail_location: %s", mail);
+ } else {
const char *home;
home = getenv("HOME");
- if (home == NULL) home = "not set";
-
- i_error("MAIL environment missing and "
- "autodetection failed (home %s)", home);
+ if (home == NULL || *home == '\0') home = "(not set)";
+
+ i_error("mail_location not set and "
+ "autodetection failed with home=%s", home);
}
return -1;
}
More information about the dovecot-cvs
mailing list