[dovecot-cvs] dovecot/src/pop3 main.c,1.59,1.60
tss at dovecot.org
tss at dovecot.org
Thu Mar 15 17:53:10 EET 2007
Update of /var/lib/cvs/dovecot/src/pop3
In directory talvi:/tmp/cvs-serv15106/pop3
Modified Files:
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.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- main.c 8 Mar 2007 22:07:33 -0000 1.59
+++ main.c 15 Mar 2007 15:53:06 -0000 1.60
@@ -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