.next
.cindex "log" "smtp confirmation"
.cindex "SMTP" "logging confirmation"
-&%smtp_confirmation%&: The response to the final &"."& in the SMTP dialogue for
+.cindex "LMTP" "logging confirmation"
+&%smtp_confirmation%&: The response to the final &"."& in the SMTP or LMTP dialogue for
outgoing messages is added to delivery log lines in the form &`C=`&<&'text'&>.
A number of MTAs (including Exim) return an identifying string in this
response.
PP/01 Continue incomplete 4.82 PP/19 by fixing docs too: use dns_dnssec_ok
not dns_use_dnssec.
+JH/03 Bugzilla 1157: support log_selector smtp_confirmation for lmtp.
+
Exim version 4.82
-----------------
if (addr->flags & af_prdr_used)
s = string_append(s, &size, &ptr, 1, US" PRDR");
#endif
+ }
- if ((log_extra_selector & LX_smtp_confirmation) != 0 &&
- addr->message != NULL)
- {
- int i;
- uschar *p = big_buffer;
- uschar *ss = addr->message;
- *p++ = '\"';
- for (i = 0; i < 100 && ss[i] != 0; i++)
- {
- if (ss[i] == '\"' || ss[i] == '\\') *p++ = '\\';
- *p++ = ss[i];
- }
- *p++ = '\"';
- *p = 0;
- s = string_append(s, &size, &ptr, 2, US" C=", big_buffer);
- }
+/* confirmation message (SMTP (host_used) and LMTP (driver_name)) */
+
+if ((log_extra_selector & LX_smtp_confirmation) != 0 &&
+ addr->message != NULL &&
+ ((addr->host_used != NULL) || (Ustrcmp(addr->transport->driver_name, "lmtp") == 0)))
+ {
+ int i;
+ uschar *p = big_buffer;
+ uschar *ss = addr->message;
+ *p++ = '\"';
+ for (i = 0; i < 100 && ss[i] != 0; i++)
+ {
+ if (ss[i] == '\"' || ss[i] == '\\') *p++ = '\\';
+ *p++ = ss[i];
+ }
+ *p++ = '\"';
+ *p = 0;
+ s = string_append(s, &size, &ptr, 2, US" C=", big_buffer);
}
/* Time on queue and actual time taken to deliver */
if (addr->transport_return != PENDING_OK) continue;
if (lmtp_read_response(out, buffer, sizeof(buffer), '2', timeout))
+ {
addr->transport_return = OK;
-
+ if ((log_extra_selector & LX_smtp_confirmation) != 0)
+ {
+ uschar *s = string_printing(buffer);
+ addr->message = (s == buffer)? (uschar *)string_copy(s) : s;
+ }
+ }
/* If the response has failed badly, use it for all the remaining pending
addresses and give up. */
QUIT
<<< QUIT
250 OK
-1999-03-02 09:44:33 10HmbD-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp
+1999-03-02 09:44:33 10HmbD-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp C="250 Number 1 is OK"
1999-03-02 09:44:33 10HmbD-0005vi-00 == jack@myhost.test.ex R=smartuser T=lmtp defer (-46): LMTP error after end of data: 450 Number 2 is now delayed
1999-03-02 09:44:33 10HmbD-0005vi-00 ** jill@myhost.test.ex R=smartuser T=lmtp: LMTP error after end of data: 550 Number 3 is now rejected
1999-03-02 09:44:33 10HmbD-0005vi-00 == tom@myhost.test.ex R=smartuser T=lmtp defer (-44): LMTP error after RCPT TO:<tom@myhost.test.ex>: 450 This one is delayed on RCPT
1999-03-02 09:44:33 10HmbD-0005vi-00 ** dick@myhost.test.ex R=smartuser T=lmtp: LMTP error after RCPT TO:<dick@myhost.test.ex>: 550 This one is unknown on RCPT
-1999-03-02 09:44:33 10HmbD-0005vi-00 -> harry <harry@myhost.test.ex> R=smartuser T=lmtp
+1999-03-02 09:44:33 10HmbD-0005vi-00 -> harry <harry@myhost.test.ex> R=smartuser T=lmtp C="250 Number 6 is OK"
1999-03-02 09:44:33 10HmbE-0005vi-00 <= <> R=10HmbD-0005vi-00 U=EXIMUSER P=local S=sss
1999-03-02 09:44:33 10HmbE-0005vi-00 => :blackhole: <CALLER@myhost.test.ex> R=bounces
1999-03-02 09:44:33 10HmbE-0005vi-00 Completed
<<< This is a test message.
<<< .
250 Number 1 is OK
-1999-03-02 09:44:33 10HmbF-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp
+1999-03-02 09:44:33 10HmbF-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp C="250 Number 1 is OK"
1999-03-02 09:44:33 10HmbF-0005vi-00 == jack@myhost.test.ex R=smartuser T=lmtp defer (-1): LMTP timeout after end of data (ddd bytes written)
1999-03-02 09:44:33 10HmbF-0005vi-00 == jill@myhost.test.ex R=smartuser T=lmtp defer (-1): LMTP timeout after end of data (ddd bytes written)
1999-03-02 09:44:33 10HmbF-0005vi-00 == tom@myhost.test.ex R=smartuser T=lmtp defer (-44): LMTP error after RCPT TO:<tom@myhost.test.ex>: 450 This one is delayed on RCPT
QUIT
<<< QUIT
220 OK
-1999-03-02 09:44:33 10HmbI-0005vi-00 => jack <jack@myhost.test.ex> R=smartuser T=lmtp
-1999-03-02 09:44:33 10HmbI-0005vi-00 -> jill <jill@myhost.test.ex> R=smartuser T=lmtp
+1999-03-02 09:44:33 10HmbI-0005vi-00 => jack <jack@myhost.test.ex> R=smartuser T=lmtp C="250 OK"
+1999-03-02 09:44:33 10HmbI-0005vi-00 -> jill <jill@myhost.test.ex> R=smartuser T=lmtp C="250 OK"
1999-03-02 09:44:33 10HmbI-0005vi-00 Completed
1999-03-02 09:44:33 10HmbJ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
220 Welcome to this LMTP simulation
QUIT
<<< QUIT
220 OK
-1999-03-02 09:44:33 10HmbJ-0005vi-00 => jack <jack@myhost.test.ex> R=smartuser T=lmtp
-1999-03-02 09:44:33 10HmbJ-0005vi-00 -> jill <jill@myhost.test.ex> R=smartuser T=lmtp
+1999-03-02 09:44:33 10HmbJ-0005vi-00 => jack <jack@myhost.test.ex> R=smartuser T=lmtp C="250 OK"
+1999-03-02 09:44:33 10HmbJ-0005vi-00 -> jill <jill@myhost.test.ex> R=smartuser T=lmtp C="250 OK"
1999-03-02 09:44:33 10HmbJ-0005vi-00 Completed
1999-03-02 09:44:33 10HmbK-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
220 Welcome to this LMTP simulation
QUIT
<<< QUIT
250 OK
-1999-03-02 09:44:33 10HmaX-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp ST=local_delivery
+1999-03-02 09:44:33 10HmaX-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp ST=local_delivery C="250 Number 1 is OK"
1999-03-02 09:44:33 10HmaX-0005vi-00 ** jack@myhost.test.ex R=smartuser T=lmtp: LMTP error after end of data: 550 Number 2 fails
-1999-03-02 09:44:33 10HmaX-0005vi-00 -> jill <jill@myhost.test.ex> R=smartuser T=lmtp ST=local_delivery
+1999-03-02 09:44:33 10HmaX-0005vi-00 -> jill <jill@myhost.test.ex> R=smartuser T=lmtp ST=local_delivery C="250 Number 3 is OK"
1999-03-02 09:44:33 10HmaY-0005vi-00 <= <> R=10HmaX-0005vi-00 U=EXIMUSER P=local S=sss
1999-03-02 09:44:33 10HmaY-0005vi-00 => CALLER <CALLER@myhost.test.ex> R=bounces T=local_delivery
1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
QUIT
<<< QUIT
250 OK
-1999-03-02 09:44:33 10HmaZ-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp ST=local_delivery (mailbox TESTSUITE/test-mail/ has too many links (2))
+1999-03-02 09:44:33 10HmaZ-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp ST=local_delivery (mailbox TESTSUITE/test-mail/ has too many links (2)) C="250 Number 1 is OK"
1999-03-02 09:44:33 10HmaZ-0005vi-00 ** jack@myhost.test.ex R=smartuser T=lmtp: LMTP error after end of data: 550 Number 2 fails
-1999-03-02 09:44:33 10HmaZ-0005vi-00 -> jill <jill@myhost.test.ex> R=smartuser T=lmtp ST=local_delivery (mailbox TESTSUITE/test-mail/ has too many links (2))
+1999-03-02 09:44:33 10HmaZ-0005vi-00 -> jill <jill@myhost.test.ex> R=smartuser T=lmtp ST=local_delivery (mailbox TESTSUITE/test-mail/ has too many links (2)) C="250 Number 3 is OK"
1999-03-02 09:44:33 10HmbA-0005vi-00 <= <> R=10HmaZ-0005vi-00 U=EXIMUSER P=local S=sss
1999-03-02 09:44:33 10HmbA-0005vi-00 => CALLER <CALLER@myhost.test.ex> R=bounces T=local_delivery
1999-03-02 09:44:33 10HmbA-0005vi-00 Completed
1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaX-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp
+1999-03-02 09:44:33 10HmaX-0005vi-00 => userx <userx@myhost.test.ex> R=smartuser T=lmtp C="250 OK"
1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmaY-0005vi-00 == userx@myhost.test.ex R=smartuser T=lmtp defer (-1): LMTP timeout after initial connection
1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
1999-03-02 09:44:33 End queue run: pid=pppp -qf
1999-03-02 09:44:33 10HmbA-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmbA-0005vi-00 => lp1 <lp1@myhost.test.ex> R=smartuser T=lmtp
+1999-03-02 09:44:33 10HmbA-0005vi-00 => lp1 <lp1@myhost.test.ex> R=smartuser T=lmtp C="250 Number 1 is OK"
1999-03-02 09:44:33 10HmbA-0005vi-00 == lp2@myhost.test.ex R=smartuser T=lmtp defer (-46): LMTP error after end of data: 450 Number 2 is now delayed
1999-03-02 09:44:33 10HmbA-0005vi-00 ** lp3@myhost.test.ex R=smartuser T=lmtp: LMTP error after end of data: 550 Number 3 is now rejected
1999-03-02 09:44:33 10HmbA-0005vi-00 == lp4@myhost.test.ex R=smartuser T=lmtp defer (-44): LMTP error after RCPT TO:<lp4@myhost.test.ex>: 450 This one is delayed on RCPT
1999-03-02 09:44:33 10HmbA-0005vi-00 ** lp5@myhost.test.ex R=smartuser T=lmtp: LMTP error after RCPT TO:<lp5@myhost.test.ex>: 550 This one is unknown on RCPT
-1999-03-02 09:44:33 10HmbA-0005vi-00 -> lp6 <lp6@myhost.test.ex> R=smartuser T=lmtp
+1999-03-02 09:44:33 10HmbA-0005vi-00 -> lp6 <lp6@myhost.test.ex> R=smartuser T=lmtp C="250 Number 6 is OK"
1999-03-02 09:44:33 10HmbB-0005vi-00 <= <> R=10HmbA-0005vi-00 U=EXIMUSER P=local S=sss
1999-03-02 09:44:33 10HmbB-0005vi-00 => :blackhole: <CALLER@myhost.test.ex> R=bounces
1999-03-02 09:44:33 10HmbB-0005vi-00 Completed