&` outgoing_port `& add remote port to => lines
&`*queue_run `& start and end queue runs
&` queue_time `& time on queue for one recipient
+&`*queue_time_exclusive `& exclude recieve time from QT times
&` queue_time_overall `& time on queue for whole message
&` pid `& Exim process id
&` pipelining `& PIPELINING use, on <= and => lines
.cindex "log" "queue time"
&%queue_time%&: The amount of time the message has been in the queue on the
local host is logged as QT=<&'time'&> on delivery (&`=>`&) lines, for example,
-&`QT=3m45s`&. The clock starts when Exim starts to receive the message, so it
-includes reception time as well as the delivery time for the current address.
-This means that it may be longer than the difference between the arrival and
-delivery log line times, because the arrival log line is not written until the
-message has been successfully received.
+&`QT=3m45s`&.
If millisecond logging is enabled, short times will be shown with greater
precision, eg. &`QT=1.578s`&.
.next
&%queue_time_overall%&: The amount of time the message has been in the queue on
the local host is logged as QT=<&'time'&> on &"Completed"& lines, for
-example, &`QT=3m45s`&. The clock starts when Exim starts to receive the
-message, so it includes reception time as well as the total delivery time.
+example, &`QT=3m45s`&.
.next
.cindex "log" "receive duration"
&%receive_time%&: For each message, the amount of real time it has taken to
transport executions. This also mean that the log lines for the
messages can show the proxy information.
+JH/50 Bug 2672: QT elements in log lines, unless disabled, now exclude the
+ receive time. With modern systems the difference is significant.
+ The historical behaviour can be restored by disabling (a new) log_selector
+ "queue_time_exclusive".
+
Exim version 4.94
13. Option "smtp_accept_msx_per_connection" is now expanded.
+14. Log selector "queue_size_exclusive", enabled by default, to exclude the
+ time taken for reception from QT log elements.
+
Version 4.94
------------
int received_count = 0;
uschar *received_protocol = NULL;
struct timeval received_time = { 0, 0 };
+struct timeval received_time_complete = { 0, 0 };
int recipients_count = 0;
recipient_item *recipients_list = NULL;
int recipients_list_max = 0;
/* Time on queue and actual time taken to deliver */
if (LOGGING(queue_time))
- g = string_append(g, 2, US" QT=",
- string_timesince(&received_time));
+ g = string_append(g, 2, US" QT=", string_timesince(
+ LOGGING(queue_time_exclusive) ? &received_time_complete : &received_time));
if (LOGGING(deliver_time))
g = string_append(g, 2, US" DT=", string_timediff(&addr->delivery_time));
/******************************************************************************/
/* Time calculations */
+/* Diff two times (later, earlier) returning diff in 1st arg */
static inline void
-timesince(struct timeval * diff, const struct timeval * then)
+timediff(struct timeval * later, const struct timeval * earlier)
{
-gettimeofday(diff, NULL);
-diff->tv_sec -= then->tv_sec;
-if ((diff->tv_usec -= then->tv_usec) < 0)
+later->tv_sec -= earlier->tv_sec;
+if ((later->tv_usec -= earlier->tv_usec) < 0)
{
- diff->tv_sec--;
- diff->tv_usec += 1000*1000;
+ later->tv_sec--;
+ later->tv_usec += 1000*1000;
}
}
+static inline void
+timesince(struct timeval * diff, const struct timeval * then)
+{
+gettimeofday(diff, NULL);
+timediff(diff, then);
+}
+
static inline uschar *
string_timediff(const struct timeval * diff)
{
Li_outgoing_interface, /* see d_log_interface in deliver.c */
Li_msg_id,
Li_queue_run,
+ Li_queue_time_exclusive,
Li_rejected_header,
Li_retry_defer,
Li_sender_verify_fail,
#endif
BIT_TABLE(L, queue_run),
BIT_TABLE(L, queue_time),
+ BIT_TABLE(L, queue_time_exclusive),
BIT_TABLE(L, queue_time_overall),
BIT_TABLE(L, receive_time),
BIT_TABLE(L, received_recipients),
int received_headers_max = 30;
uschar *received_protocol = NULL;
struct timeval received_time = { 0, 0 };
-struct timeval received_time_taken = { 0, 0 };
+struct timeval received_time_complete = { 0, 0 };
uschar *recipient_data = NULL;
uschar *recipient_unqualified_hosts = NULL;
uschar *recipient_verify_failure = NULL;
extern uschar *received_for; /* For "for" field */
extern uschar *received_header_text; /* Definition of Received: header */
extern int received_headers_max; /* Max count of Received: headers */
-extern struct timeval received_time; /* Time the message was received */
-extern struct timeval received_time_taken; /* Interval the message took to be received */
+extern struct timeval received_time; /* Time the message started to be received */
+extern struct timeval received_time_complete; /* Time the message completed reception */
extern uschar *recipient_data; /* lookup data for recipients */
extern uschar *recipient_unqualified_hosts; /* Permitted unqualified recipients */
extern uschar *recipient_verify_failure; /* What went wrong */
Li_protocol_detail,
Li_proxy,
Li_queue_time,
+ Li_queue_time_exclusive,
Li_queue_time_overall,
Li_receive_time,
Li_received_sender,
/* No I/O errors were encountered while writing the data file. */
DEBUG(D_receive) debug_printf("Data file written for message %s\n", message_id);
-if (LOGGING(receive_time)) timesince(&received_time_taken, &received_time);
+gettimeofday(&received_time_complete, NULL);
/* If there were any bad addresses extracted by -t, or there were no recipients
#endif
if (LOGGING(receive_time))
- g = string_append(g, 2, US" RT=", string_timediff(&received_time_taken));
+ {
+ struct timeval diff = received_time_complete;
+ timediff(&diff, &received_time);
+ g = string_append(g, 2, US" RT=", string_timediff(&diff));
+ }
if (*queue_name)
g = string_append(g, 2, US" Q=", queue_name);
if (sscanf(CS big_buffer, TIME_T_FMT " %d", &received_time.tv_sec, &warning_count) != 2)
goto SPOOL_FORMAT_ERROR;
received_time.tv_usec = 0;
+received_time_complete = received_time;
+
message_age = time(NULL) - received_time.tv_sec;
#ifndef COMPILE_UTILITY
{
unsigned usec;
if (sscanf(CS var + 20, "%u", &usec) == 1)
+ {
received_time.tv_usec = usec;
+ if (!received_time_complete.tv_sec) received_time_complete.tv_usec = usec;
+ }
+ }
+ else if (Ustrncmp(p, "eceived_time_complete", 21) == 0)
+ {
+ unsigned sec, usec;
+ if (sscanf(CS var + 23, "%u.%u", &sec, &usec) == 2)
+ {
+ received_time_complete.tv_sec = sec;
+ received_time_complete.tv_usec = usec;
+ }
}
break;
fprintf(fp, "%d %d\n", (int)received_time.tv_sec, warning_count);
fprintf(fp, "-received_time_usec .%06d\n", (int)received_time.tv_usec);
+fprintf(fp, "-received_time_complete %d.%06d\n",
+ (int)received_time_complete.tv_sec, (int)received_time_complete.tv_usec);
/* If there is information about a sending host, remember it. The HELO
data can be set for local SMTP as well as remote. */
s/conversion: german.xn--strae-oqa.de/conversion: german.straße.de/;
# subsecond timstamp info in reported header-files
- s/^(-received_time_usec \.)\d{6}$/$1uuuuuu/;
+ s/^-received_time_usec \.\K\d{6}$/uuuuuu/;
+ s/^-received_time_complete \K\d+\.\d{6}$/tttt.uuuuuu/;
# Postgres server takes varible time to shut down; lives in various places
s/^waiting for server to shut down\.+ done$/waiting for server to shut down.... done/;
<notsubmit@y>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-interface_address 127.0.0.1.1225
<a@y>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-interface_address 127.0.0.1.1225
<>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-interface_address 127.0.0.1.1225
<notsubmit@y>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-interface_address 127.0.0.1.1225
<a@y>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-interface_address 127.0.0.1.1225
<a@y>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-interface_address 127.0.0.1.1225
<a@y>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-interface_address 127.0.0.1.1225
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 1
<CALLER-rewritten@test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER-rewritten@test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER-rewritten@test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local-smtp
-aclm 0 22
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local-smtp
-body_linecount 0
<CALLER@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident CALLER
-received_protocol local-smtp
-body_linecount 2
<"spaced user"@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
-ident spaced user
-received_protocol local
-body_linecount 1
<username@myhost.test.ex>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-host_auth au1
<>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-host_auth au1
<>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-host_auth au1
<>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-host_auth au1
<>
ddddddddd 0
-received_time_usec .uuuuuu
+-received_time_complete tttt.uuuuuu
--helo_name rhu.barb
-host_address 127.0.0.1.9999
-host_auth au1