summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ACKNOWLEDGMENTS3
-rw-r--r--src/exim_monitor/em_log.c14
-rw-r--r--src/exim_monitor/em_version.c4
-rw-r--r--src/src/exigrep.src8
-rw-r--r--src/src/eximstats.src15
-rw-r--r--src/src/globals.c5
-rw-r--r--src/src/log.c18
-rw-r--r--src/src/macros.h33
8 files changed, 65 insertions, 35 deletions
diff --git a/src/ACKNOWLEDGMENTS b/src/ACKNOWLEDGMENTS
index a855be12c..1a39046c3 100644
--- a/src/ACKNOWLEDGMENTS
+++ b/src/ACKNOWLEDGMENTS
@@ -1,4 +1,4 @@
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.70 2007/01/31 11:30:08 ph10 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.71 2007/01/31 16:52:12 ph10 Exp $
EXIM ACKNOWLEDGEMENTS
@@ -240,6 +240,7 @@ Jonathan Sambrook Suggested patch for expanding uid and gid lists
Peter Savitch Diagnosis of FPE bug when statvfs() fails on spool
Harald Schueler Patch for dn_expand() failure on truncated data
Heiko Schlichting Diagnosis of intermittent daemon crash bug
+Heiko Schlitterman Proposed patch for +pid
Stephan Schulz Patch for $host_data caching error
Lai Zit Seng Patch for radiusclient 0.4.9 interface bugs
Tony Sheen Log files with datestamped names and auto rollover
diff --git a/src/exim_monitor/em_log.c b/src/exim_monitor/em_log.c
index e87d5207e..409f2daf6 100644
--- a/src/exim_monitor/em_log.c
+++ b/src/exim_monitor/em_log.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/exim_monitor/em_log.c,v 1.4 2007/01/08 10:50:17 ph10 Exp $ */
+/* $Cambridge: exim/src/exim_monitor/em_log.c,v 1.5 2007/01/31 16:52:12 ph10 Exp $ */
/*************************************************
* Exim Monitor *
@@ -7,7 +7,7 @@
/* Copyright (c) University of Cambridge 1995 - 2007 */
/* See the file NOTICE for conditions of use and distribution. */
-/* This module contains code for scanning the smaill log,
+/* This module contains code for scanning the main log,
extracting information from it, and displaying a "tail". */
#include "em_hdr.h"
@@ -250,14 +250,20 @@ if (LOG != NULL)
}
/* Munge the log entry and display shortened form on one line.
- We omit the date and show only the time. Remove any time zone offset. */
+ We omit the date and show only the time. Remove any time zone offset.
+ Take note of the presence of [pid]. */
if (pcre_exec(yyyymmdd_regex,NULL,CS buffer,length,0,PCRE_EOPT,NULL,0) >= 0)
{
+ int pidlength = 0;
if ((buffer[20] == '+' || buffer[20] == '-') &&
isdigit(buffer[21]) && buffer[25] == ' ')
memmove(buffer + 20, buffer + 26, Ustrlen(buffer + 26) + 1);
- id = string_copyn(buffer + 20, MESSAGE_ID_LENGTH);
+ if (buffer[20] == '[')
+ {
+ while (Ustrchr("[]0123456789", buffer[20+pidlength++]) != NULL);
+ }
+ id = string_copyn(buffer + 20 + pidlength, MESSAGE_ID_LENGTH);
show_log("%s", buffer+11);
}
else
diff --git a/src/exim_monitor/em_version.c b/src/exim_monitor/em_version.c
index 871fbf199..4a6f3ce4e 100644
--- a/src/exim_monitor/em_version.c
+++ b/src/exim_monitor/em_version.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/exim_monitor/em_version.c,v 1.4 2007/01/08 10:50:17 ph10 Exp $ */
+/* $Cambridge: exim/src/exim_monitor/em_version.c,v 1.5 2007/01/31 16:52:12 ph10 Exp $ */
/*************************************************
* Exim Monitor *
@@ -21,7 +21,7 @@ version_init(void)
int i = 0;
uschar today[20];
-version_string = US"2.05";
+version_string = US"2.06";
Ustrcpy(today, __DATE__);
if (today[4] == ' ') i = 1;
diff --git a/src/src/exigrep.src b/src/src/exigrep.src
index c6ccbfdc5..f888984b0 100644
--- a/src/src/exigrep.src
+++ b/src/src/exigrep.src
@@ -1,9 +1,9 @@
#! PERL_COMMAND -w
-# $Cambridge: exim/src/src/exigrep.src,v 1.3 2005/08/01 13:28:30 ph10 Exp $
+# $Cambridge: exim/src/src/exigrep.src,v 1.4 2007/01/31 16:52:12 ph10 Exp $
use strict;
-# Copyright (c) 2004 University of Cambridge.
+# Copyright (c) 2007 University of Cambridge.
# See the file NOTICE for conditions of use and distribution.
# Except when they appear in comments, the following placeholders in this
@@ -68,9 +68,9 @@ return unless
# Handle the case when the log line belongs to a specific message. We save
# lines for specific messages until the message is complete. Then either print
-# discard.
+# or discard.
-if (my($id) = $entry =~ /^(\w{6}\-\w{6}\-\w{2})/)
+if (my($id) = $entry =~ /^(?:\[\d+\]\s)?(\w{6}\-\w{6}\-\w{2})/)
{
$saved{$id} = '' unless defined($saved{$id});
diff --git a/src/src/eximstats.src b/src/src/eximstats.src
index 539c756d7..88eb69fe8 100644
--- a/src/src/eximstats.src
+++ b/src/src/eximstats.src
@@ -1,5 +1,5 @@
#!PERL_COMMAND -w
-# $Cambridge: exim/src/src/eximstats.src,v 1.12 2007/01/22 15:14:01 steve Exp $
+# $Cambridge: exim/src/src/eximstats.src,v 1.13 2007/01/31 16:52:12 ph10 Exp $
# Copyright (c) 2001 University of Cambridge.
# See the file NOTICE for conditions of use and distribution.
@@ -260,6 +260,9 @@
# 2006-11-27 V1.52 Steve Campbell
# Tally any reject message containing SpamAssassin.
#
+# 2007-01-31 V1.53 Philip Hazel
+# Allow for [pid] after date in log lines
+#
#
#
# For documentation on the logfile format, see
@@ -558,7 +561,7 @@ use vars qw($WEEK $DAY $HOUR $MINUTE);
@days_per_month = (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334);
$gig = 1024 * 1024 * 1024;
-$VERSION = '1.52';
+$VERSION = '1.53';
# How much space do we allow for the Hosts/Domains/Emails/Edomains column headers?
$COLUMN_WIDTHS = 8;
@@ -1821,7 +1824,7 @@ sub generate_parser {
$length = length($_);
next if ($length < 38);
- next unless /^(\\d{4}\\-\\d\\d-\\d\\d\\s(\\d\\d):(\\d\\d):\\d\\d( [-+]\\d\\d\\d\\d)?)/o;
+ next unless /^(\\d{4}\\-\\d\\d-\\d\\d\\s(\\d\\d):(\\d\\d):\\d\\d( [-+]\\d\\d\\d\\d)?)( \\[\\d+\\])?/o;
($tod,$m_hour,$m_min) = ($1,$2,$3);
@@ -1834,6 +1837,12 @@ sub generate_parser {
$extra = 0;
}
+ # PH - watch for PID added after the timestamp.
+ if (defined($5)) {
+ $extra += length($5);
+ next if ($length < 38 + $extra);
+ }
+
$id = substr($_, 20 + $extra, 16);
$flag = substr($_, 37 + $extra, 2);
diff --git a/src/src/globals.c b/src/src/globals.c
index 880b99985..b030c7f7b 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.c,v 1.66 2007/01/30 15:10:59 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.c,v 1.67 2007/01/31 16:52:12 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -668,6 +668,8 @@ top bit). They are never used in calls to log_write(), but are tested
independently. This separation became necessary when the number of log
selectors was getting close to filling a 32-bit word. */
+/* Note that this list must be in alphabetical order. */
+
bit_table log_options[] = {
{ US"acl_warn_skipped", LX_acl_warn_skipped },
{ US"address_rewrite", L_address_rewrite },
@@ -686,6 +688,7 @@ bit_table log_options[] = {
{ US"incoming_port", LX_incoming_port },
{ US"lost_incoming_connection", L_lost_incoming_connection },
{ US"outgoing_port", LX_outgoing_port },
+ { US"pid", LX_pid },
{ US"queue_run", L_queue_run },
{ US"queue_time", LX_queue_time },
{ US"queue_time_overall", LX_queue_time_overall },
diff --git a/src/src/log.c b/src/src/log.c
index 2757ee0b4..5cc309287 100644
--- a/src/src/log.c
+++ b/src/src/log.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/log.c,v 1.11 2007/01/08 10:50:18 ph10 Exp $ */
+/* $Cambridge: exim/src/src/log.c,v 1.12 2007/01/31 16:52:12 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -732,11 +732,21 @@ if (!write_rejectlog) flags &= ~LOG_REJECT;
id except for the process log and when called by a utility. */
ptr = log_buffer;
+sprintf(CS ptr, "%s ", tod_stamp(tod_log));
+while(*ptr) ptr++;
+
+if ((log_extra_selector & LX_pid) != 0)
+ {
+ sprintf(CS ptr, "[%d] ", (int)getpid());
+ while (*ptr) ptr++;
+ }
+
if (really_exim && (flags & LOG_PROCESS) == 0 && message_id[0] != 0)
- sprintf(CS ptr, "%s %s ", tod_stamp(tod_log), message_id);
-else sprintf(CS ptr, "%s ", tod_stamp(tod_log));
+ {
+ sprintf(CS ptr, "%s ", message_id);
+ while(*ptr) ptr++;
+ }
-while(*ptr) ptr++;
if ((flags & LOG_CONFIG) != 0) ptr = log_config_info(ptr, flags);
va_start(ap, format);
diff --git a/src/src/macros.h b/src/src/macros.h
index 7b317e42d..f73ce63ac 100644
--- a/src/src/macros.h
+++ b/src/src/macros.h
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/macros.h,v 1.30 2007/01/15 15:59:22 ph10 Exp $ */
+/* $Cambridge: exim/src/src/macros.h,v 1.31 2007/01/31 16:52:12 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -378,21 +378,22 @@ set all the bits in a multi-word selector. */
#define LX_incoming_interface 0x80000020
#define LX_incoming_port 0x80000040
#define LX_outgoing_port 0x80000080
-#define LX_queue_time 0x80000100
-#define LX_queue_time_overall 0x80000200
-#define LX_received_sender 0x80000400
-#define LX_received_recipients 0x80000800
-#define LX_rejected_header 0x80001000
-#define LX_return_path_on_delivery 0x80002000
-#define LX_sender_on_delivery 0x80004000
-#define LX_sender_verify_fail 0x80008000
-#define LX_smtp_confirmation 0x80010000
-#define LX_smtp_no_mail 0x80020000
-#define LX_subject 0x80040000
-#define LX_tls_certificate_verified 0x80080000
-#define LX_tls_cipher 0x80100000
-#define LX_tls_peerdn 0x80200000
-#define LX_unknown_in_list 0x80400000
+#define LX_pid 0x80000100
+#define LX_queue_time 0x80000200
+#define LX_queue_time_overall 0x80000400
+#define LX_received_sender 0x80000800
+#define LX_received_recipients 0x80001000
+#define LX_rejected_header 0x80002000
+#define LX_return_path_on_delivery 0x80004000
+#define LX_sender_on_delivery 0x80008000
+#define LX_sender_verify_fail 0x80010000
+#define LX_smtp_confirmation 0x80020000
+#define LX_smtp_no_mail 0x80040000
+#define LX_subject 0x80080000
+#define LX_tls_certificate_verified 0x80100000
+#define LX_tls_cipher 0x80200000
+#define LX_tls_peerdn 0x80400000
+#define LX_unknown_in_list 0x80800000
#define L_default (L_connection_reject | \
L_delay_delivery | \