dovecot-2.0: rawlog: If mail_debug=yes, log if dovecot.rawlog/ d...

dovecot at dovecot.org dovecot at dovecot.org
Wed Apr 29 21:54:20 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/396cd2e86103
changeset: 9173:396cd2e86103
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Apr 29 14:49:10 2009 -0400
description:
rawlog: If mail_debug=yes, log if dovecot.rawlog/ directory doesn't exist.

diffstat:

1 file changed, 10 insertions(+), 4 deletions(-)
src/util/rawlog.c |   14 ++++++++++----

diffs (31 lines):

diff -r fa8f044040e1 -r 396cd2e86103 src/util/rawlog.c
--- a/src/util/rawlog.c	Wed Apr 29 14:26:09 2009 -0400
+++ b/src/util/rawlog.c	Wed Apr 29 14:49:10 2009 -0400
@@ -291,10 +291,15 @@ static void rawlog_open(enum rawlog_flag
 	if (lstat(path, &st) < 0) {
 		if (errno != ENOENT)
 			i_warning("lstat() failed for %s: %m", path);
-		return;
-	}
-	if (!S_ISDIR(st.st_mode))
-		return;
+		else if (getenv("DEBUG") != NULL)
+			i_info("rawlog: %s doesn't exist", path);
+		return;
+	}
+	if (!S_ISDIR(st.st_mode)) {
+		if (getenv("DEBUG") != NULL)
+			i_info("rawlog: %s is not a directory", path);
+		return;
+	}
 
 	if (chroot_dir != NULL) {
 		/* we'll chroot soon. skip over the chroot in the path. */
@@ -342,6 +347,7 @@ int main(int argc, char *argv[], char *e
 	flags = RAWLOG_FLAG_LOG_INPUT | RAWLOG_FLAG_LOG_OUTPUT;
 
 	lib_init();
+	i_set_failure_internal();
 	process_title_init(argv, envp);
 
 	argc--;


More information about the dovecot-cvs mailing list