dovecot-2.0: lib-storage: Added "auto" mail storage driver for f...

dovecot at dovecot.org dovecot at dovecot.org
Tue Nov 15 18:35:16 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/bef7acd675f3
changeset: 12961:bef7acd675f3
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 15 18:21:39 2011 +0200
description:
lib-storage: Added "auto" mail storage driver for forcing autodetection.

diffstat:

 src/lib-storage/mail-storage.c |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 37c044235948 -r bef7acd675f3 src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Wed Nov 09 18:14:04 2011 +0200
+++ b/src/lib-storage/mail-storage.c	Tue Nov 15 18:21:39 2011 +0200
@@ -130,7 +130,15 @@
 	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(


More information about the dovecot-cvs mailing list