From: Timo Sirainen Date: Wed, 16 Nov 2011 17:39:18 +0000 (+0200) Subject: lib-storage: Improved storage creation failure error message for "auto" driver. X-Git-Tag: 2.1.rc1~71 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=259c34523bbba82bea65b6b9fa113b594052b94d;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Improved storage creation failure error message for "auto" driver. --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 479346707b..e17835f53c 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -180,12 +180,16 @@ mail_storage_get_class(struct mail_namespace *ns, const char *driver, if (storage_class != NULL) return storage_class; - if (ns->set->location == NULL || *ns->set->location == '\0') { - (void)mail_user_get_home(ns->user, &home); - if (home == NULL || *home == '\0') home = "(not set)"; + (void)mail_user_get_home(ns->user, &home); + if (home == NULL || *home == '\0') home = "(not set)"; + if (ns->set->location == NULL || *ns->set->location == '\0') { *error_r = t_strdup_printf( "Mail storage autodetection failed with home=%s", home); + } else if (strncmp(ns->set->location, "auto:", 5) == 0) { + *error_r = t_strdup_printf( + "Autodetection failed for %s (home=%s)", + ns->set->location, home); } else { *error_r = t_strdup_printf( "Ambiguous mail location setting, "