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

dovecot at dovecot.org dovecot at dovecot.org
Wed Apr 29 21:49:47 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.1/rev/e049f48aaaea
changeset: 8257:e049f48aaaea
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 455d1d6fa230 -r e049f48aaaea src/util/rawlog.c
--- a/src/util/rawlog.c	Wed Apr 29 14:13:23 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