[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c, 1.145.2.2, 1.145.2.3

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


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

Modified Files:
      Tag: branch_1_0
	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.145.2.2
retrieving revision 1.145.2.3
diff -u -d -r1.145.2.2 -r1.145.2.3
--- mbox-storage.c	17 Jun 2006 13:03:22 -0000	1.145.2.2
+++ mbox-storage.c	9 Oct 2006 17:08:04 -0000	1.145.2.3
@@ -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