[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c, 1.150, 1.151

tss at dovecot.org tss at dovecot.org
Mon Oct 9 18:08:12 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv16418/index/mbox

Modified Files:
	mbox-storage.c 
Log Message:
If the mail environment data contains mail format prefix, don't do any kind
of autodetection. Practically this means that mbox:/var/mail/user doesn't
work anymore.



Index: mbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -d -r1.150 -r1.151
--- mbox-storage.c	17 Sep 2006 16:21:47 -0000	1.150
+++ mbox-storage.c	9 Oct 2006 17:08:09 -0000	1.151
@@ -267,6 +267,11 @@
 
 	autodetect = data == NULL || *data == '\0';
 	if (autodetect) {
+		if ((flags & MAIL_STORAGE_FLAG_NO_AUTODETECTION) != 0) {
+			i_error("mbox: root directory not given");
+			return NULL;
+		}
+
 		/* we'll need to figure out the mail location ourself.
 		   it's root dir if we've already chroot()ed, otherwise
 		   either $HOME/mail or $HOME/Mail */
@@ -279,7 +284,8 @@
 		p = strchr(data, ':');
 		if (p == NULL) {
 			/* if the data points to a file, treat it as an INBOX */
-			if (stat(data, &st) < 0 || S_ISDIR(st.st_mode))
+			if ((flags & MAIL_STORAGE_FLAG_NO_AUTODETECTION) != 0 ||
+			    stat(data, &st) < 0 || S_ISDIR(st.st_mode))
 				root_dir = data;
 			else {
 				root_dir = get_root_dir(flags);



More information about the dovecot-cvs mailing list