[dovecot-cvs] dovecot/src/pop3 main.c,1.48.2.5,1.48.2.6

tss at dovecot.org tss at dovecot.org
Thu Mar 15 17:52:58 EET 2007


Update of /var/lib/cvs/dovecot/src/pop3
In directory talvi:/tmp/cvs-serv15087/pop3

Modified Files:
      Tag: branch_1_0
	main.c 
Log Message:
Fixes to handling log prefixes. imap/pop3 processes now log the
mail_log_prefix even when started with --exec-mail.



Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/main.c,v
retrieving revision 1.48.2.5
retrieving revision 1.48.2.6
diff -u -d -r1.48.2.5 -r1.48.2.6
--- main.c	22 Feb 2007 14:36:00 -0000	1.48.2.5
+++ main.c	15 Mar 2007 15:52:56 -0000	1.48.2.6
@@ -119,14 +119,18 @@
 		return;
 	}
 
-	user = getenv("USER");
-	if (user == NULL) user = "??";
-	if (strlen(user) >= sizeof(log_prefix)-6) {
-		/* quite a long user name, cut it */
-		user = t_strndup(user, sizeof(log_prefix)-6-2);
-		user = t_strconcat(user, "..", NULL);
+	if (getenv("LOG_PREFIX") != NULL)
+		strocpy(log_prefix, getenv("LOG_PREFIX"), sizeof(log_prefix));
+	else {
+		user = getenv("USER");
+		if (user == NULL) user = "??";
+		if (strlen(user) >= sizeof(log_prefix)-6) {
+			/* quite a long user name, cut it */
+			user = t_strndup(user, sizeof(log_prefix)-6-2);
+			user = t_strconcat(user, "..", NULL);
+		}
+		i_snprintf(log_prefix, sizeof(log_prefix), "pop3(%s): ", user);
 	}
-	i_snprintf(log_prefix, sizeof(log_prefix), "pop3(%s)", user);
 
 	if (getenv("USE_SYSLOG") != NULL) {
 		const char *env = getenv("SYSLOG_FACILITY");



More information about the dovecot-cvs mailing list