From: Timo Sirainen Date: Tue, 15 Nov 2011 16:21:39 +0000 (+0200) Subject: lib-storage: Added "auto" mail storage driver for forcing autodetection. X-Git-Tag: 2.1.rc1~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5ae8a7c2963653c8ebebb093890f521d5bf59e1;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Added "auto" mail storage driver for forcing autodetection. --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index b3e52cc4c6..f9173ad6cd 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -132,7 +132,15 @@ mail_storage_get_class(struct mail_namespace *ns, const char *driver, struct mail_storage *storage_class = NULL; const char *home; - if (driver != NULL) { + if (driver == NULL) { + /* no mail_location, autodetect */ + } else if (strcmp(driver, "auto") == 0) { + /* explicit autodetection with "auto" driver. */ + if (*list_set->root_dir == '\0') { + /* handle the same as with driver=NULL */ + list_set->root_dir = NULL; + } + } else { storage_class = mail_storage_find_class(driver); if (storage_class == NULL) { *error_r = t_strdup_printf(