Added log_selector=+queue_time_overall.
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Wed, 24 Nov 2004 14:38:13 +0000 (14:38 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Wed, 24 Nov 2004 14:38:13 +0000 (14:38 +0000)
doc/doc-txt/ChangeLog
doc/doc-txt/NewStuff
src/ACKNOWLEDGMENTS
src/src/deliver.c
src/src/globals.c
src/src/macros.h

index 1d294c8574c6f31449b8ef59b130ed495ba4767b..51ca5f64faf6131e17330906a65c4d5aee021a03 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.36 2004/11/22 11:30:03 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.37 2004/11/24 14:38:13 ph10 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -164,6 +164,8 @@ Exim version 4.44
     a list of IP addresses and/or domains to be looked up in a particular DNS
     domain.
 
     a list of IP addresses and/or domains to be looked up in a particular DNS
     domain.
 
+39. Added log_selector=+queue_time_overall.
+
 
 Exim version 4.43
 -----------------
 
 Exim version 4.43
 -----------------
index be1bbfe16fb9299760a35d5784e9fb52cb941815..3525e84dc7772a2d3f92621d2d30f760325d44a3 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/NewStuff,v 1.14 2004/11/22 11:30:03 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/NewStuff,v 1.15 2004/11/24 14:38:13 ph10 Exp $
 
 New Features in Exim
 --------------------
 
 New Features in Exim
 --------------------
@@ -196,6 +196,12 @@ Version 4.44
     Once a DNS record has been found (that matches a specific IP return
     address, if specified), no further lookups are done.
 
     Once a DNS record has been found (that matches a specific IP return
     address, if specified), no further lookups are done.
 
+16. The log selector queue_time_overall causes Exim to output the time spent on
+    the queue as an addition to the "Completed" message. Like queue_time (which
+    puts the queue time on individual delivery lines), the time is tagged with
+    "QT=", and it is measured from the time that the message starts to be
+    received, so it includes the reception time.
+
 
 Version 4.43
 ------------
 
 Version 4.43
 ------------
index e6af9f53ec6be306085921736303351cb59ae9b3..4ca8ffbb714d92996f353ce2ce0bf96193fb114d 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.5 2004/11/12 15:03:40 ph10 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.6 2004/11/24 14:38:13 ph10 Exp $
 
 EXIM ACKNOWLEDGEMENTS
 
 
 EXIM ACKNOWLEDGEMENTS
 
@@ -20,7 +20,7 @@ relatively small patches.
 Philip Hazel
 
 Lists created: 20 November 2002
 Philip Hazel
 
 Lists created: 20 November 2002
-Last updated:  10 November 2004
+Last updated:  24 November 2004
 
 
 THE OLD LIST
 
 
 THE OLD LIST
@@ -85,6 +85,7 @@ Brian Candler             Use h_errno for gethostbyname()
                           Several minor fixes and suggestions
 Oliver Cook               Suggested patch for exigrep & rejected messages
                             Patch to add sender/host info to local_scan() rejects
                           Several minor fixes and suggestions
 Oliver Cook               Suggested patch for exigrep & rejected messages
                             Patch to add sender/host info to local_scan() rejects
+                            Suggested patch to add queue time to "Completed"
 Jennifer Corley           Designing the new Exim logo
 John Dalbec               Patch for quota_warn_threshold bug
 Vivek Dasmohapatra        Suggested patch for CRL support
 Jennifer Corley           Designing the new Exim logo
 John Dalbec               Patch for quota_warn_threshold bug
 Vivek Dasmohapatra        Suggested patch for CRL support
index 2bf141c163f3d707aa3db6a6c3ac78730d14c1a8..b2e9ea58c3b8ded5d7d13aaa25e5c5bed32486a0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/deliver.c,v 1.2 2004/11/18 10:35:19 ph10 Exp $ */
+/* $Cambridge: exim/src/src/deliver.c,v 1.3 2004/11/24 14:38:13 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -6315,14 +6315,21 @@ if (addr_defer == NULL)
     }
 
   /* Remove the two message files. */
     }
 
   /* Remove the two message files. */
-
+  
   sprintf(CS spoolname, "%s/input/%s/%s-D", spool_directory, message_subdir, id);
   if (Uunlink(spoolname) < 0)
     log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to unlink %s", spoolname);
   sprintf(CS spoolname, "%s/input/%s/%s-H", spool_directory, message_subdir, id);
   if (Uunlink(spoolname) < 0)
     log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to unlink %s", spoolname);
   sprintf(CS spoolname, "%s/input/%s/%s-D", spool_directory, message_subdir, id);
   if (Uunlink(spoolname) < 0)
     log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to unlink %s", spoolname);
   sprintf(CS spoolname, "%s/input/%s/%s-H", spool_directory, message_subdir, id);
   if (Uunlink(spoolname) < 0)
     log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to unlink %s", spoolname);
-  log_write(0, LOG_MAIN, "Completed");
+
+  /* Log the end of this message, with queue time if requested. */
+
+  if ((log_extra_selector & LX_queue_time_overall) != 0)
+    log_write(0, LOG_MAIN, "Completed QT=%s", 
+      readconf_printtime(time(NULL) - received_time));
+  else
+    log_write(0, LOG_MAIN, "Completed");
   }
 
 /* If there are deferred addresses, we are keeping this message because it is
   }
 
 /* If there are deferred addresses, we are keeping this message because it is
index 3ea8d7d209089d2cca8b9850b19d25582d107a00..53a9f0a00a183d0718e6c74af7a071a973e85276 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.c,v 1.6 2004/11/10 10:29:56 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.c,v 1.7 2004/11/24 14:38:13 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -601,6 +601,7 @@ bit_table log_options[]        = {
   { US"outgoing_port",                LX_outgoing_port },
   { US"queue_run",                    L_queue_run },
   { US"queue_time",                   LX_queue_time },
   { US"outgoing_port",                LX_outgoing_port },
   { US"queue_run",                    L_queue_run },
   { US"queue_time",                   LX_queue_time },
+  { US"queue_time_overall",           LX_queue_time_overall },
   { US"received_recipients",          LX_received_recipients },
   { US"received_sender",              LX_received_sender },
   { US"rejected_header",              LX_rejected_header },
   { US"received_recipients",          LX_received_recipients },
   { US"received_sender",              LX_received_sender },
   { US"rejected_header",              LX_rejected_header },
index bc685dac833804c9f769e63b1cb3ff08cc3f5475..3b440785156c3d0ce44819a42c515e47e17ab935 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/macros.h,v 1.2 2004/11/04 10:42:11 ph10 Exp $ */
+/* $Cambridge: exim/src/src/macros.h,v 1.3 2004/11/24 14:38:13 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -361,16 +361,17 @@ only in the name table to set all options in both bit maps. */
 #define LX_incoming_port               0x80000020
 #define LX_outgoing_port               0x80000040
 #define LX_queue_time                  0x80000080
 #define LX_incoming_port               0x80000020
 #define LX_outgoing_port               0x80000040
 #define LX_queue_time                  0x80000080
-#define LX_received_sender             0x80000100
-#define LX_received_recipients         0x80000200
-#define LX_rejected_header             0x80000400
-#define LX_return_path_on_delivery     0x80000800
-#define LX_sender_on_delivery          0x80001000
-#define LX_smtp_confirmation           0x80002000
-#define LX_subject                     0x80004000
-#define LX_tls_certificate_verified    0x80008000
-#define LX_tls_cipher                  0x80010000
-#define LX_tls_peerdn                  0x80020000
+#define LX_queue_time_overall          0x80000100
+#define LX_received_sender             0x80000200
+#define LX_received_recipients         0x80000400
+#define LX_rejected_header             0x80000800
+#define LX_return_path_on_delivery     0x80001000
+#define LX_sender_on_delivery          0x80002000
+#define LX_smtp_confirmation           0x80004000
+#define LX_subject                     0x80008000
+#define LX_tls_certificate_verified    0x80010000
+#define LX_tls_cipher                  0x80020000
+#define LX_tls_peerdn                  0x80040000
 
 #define L_default     (L_connection_reject        | \
                        L_delay_delivery           | \
 
 #define L_default     (L_connection_reject        | \
                        L_delay_delivery           | \