From 27b9e5f4d269b123e51beee76ab3c7f72521fead Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 19 Jul 2016 23:53:35 +0100 Subject: Logging: visibility of fakereject --- doc/doc-docbook/spec.xfpt | 1 + doc/doc-txt/ChangeLog | 3 +++ src/src/receive.c | 28 +++++++++++++++------------- test/log/0555 | 2 +- test/log/4010 | 2 +- test/scripts/0000-Basic/0555 | 2 +- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 128aef3d1..152bcb238 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -35388,6 +35388,7 @@ picked out by the distinctive two-character flags that immediately follow the timestamp. The flags are: .display &`<=`& message arrival +&`(=`& message fakereject &`=>`& normal message delivery &`->`& additional address in same delivery &`>>`& cutthrough message delivery diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 0fe63f123..454d34311 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -55,6 +55,9 @@ JH/13 Cutthrough: expand transport dkim_domain option when testing for dkim empty is permissible (obviously it should depend only on data available when the cutthrough connection is made). +JH/14 Fakereject: previously logged as a norml message arrival "<="; now + distinguished as "(=". + Exim version 4.87 ----------------- diff --git a/src/src/receive.c b/src/src/receive.c index 52e041c90..d17cf9b83 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -3747,9 +3747,10 @@ size = 256; sptr = 0; s = store_get(size); -s = string_append(s, &size, &sptr, 2, US"<= ", - (sender_address[0] == 0)? US"<>" : sender_address); -if (message_reference != NULL) +s = string_append(s, &size, &sptr, 2, + fake_response == FAIL ? US"(= " : US"<= ", + sender_address[0] == 0 ? US"<>" : sender_address); +if (message_reference) s = string_append(s, &size, &sptr, 2, US" R=", message_reference); s = add_host_info_for_log(s, &size, &sptr); @@ -3759,7 +3760,7 @@ if (LOGGING(tls_cipher) && tls_in.cipher) s = string_append(s, &size, &sptr, 2, US" X=", tls_in.cipher); if (LOGGING(tls_certificate_verified) && tls_in.cipher) s = string_append(s, &size, &sptr, 2, US" CV=", - tls_in.certificate_verified? "yes":"no"); + tls_in.certificate_verified ? "yes":"no"); if (LOGGING(tls_peerdn) && tls_in.peerdn) s = string_append(s, &size, &sptr, 3, US" DN=\"", string_printing(tls_in.peerdn), US"\""); @@ -3771,10 +3772,10 @@ if (LOGGING(tls_sni) && tls_in.sni) if (sender_host_authenticated) { s = string_append(s, &size, &sptr, 2, US" A=", sender_host_authenticated); - if (authenticated_id != NULL) + if (authenticated_id) { s = string_append(s, &size, &sptr, 2, US":", authenticated_id); - if (LOGGING(smtp_mailauth) && authenticated_sender != NULL) + if (LOGGING(smtp_mailauth) && authenticated_sender) s = string_append(s, &size, &sptr, 2, US":", authenticated_sender); } } @@ -3810,7 +3811,7 @@ any characters except " \ and CR and so in particular it can contain NL! Therefore, make sure we use a printing-characters only version for the log. Also, allow for domain literals in the message id. */ -if (msgid_header != NULL) +if (msgid_header) { uschar *old_id; BOOL save_allow_domain_literals = allow_domain_literals; @@ -4069,15 +4070,15 @@ if (smtp_input) if (!smtp_batched_input) { - if (smtp_reply == NULL) + if (!smtp_reply) { if (fake_response != OK) - smtp_respond((fake_response == DEFER)? US"450" : US"550", 3, TRUE, - fake_response_text); + smtp_respond(fake_response == DEFER ? US"450" : US"550", + 3, TRUE, fake_response_text); /* An OK response is required; use "message" text if present. */ - else if (user_msg != NULL) + else if (user_msg) { uschar *code = US"250"; int len = 3; @@ -4124,7 +4125,8 @@ if (smtp_input) nothing on success. The function moan_smtp_batch() does not return - it exits from the program with a non-zero return code. */ - else if (smtp_reply != NULL) moan_smtp_batch(NULL, "%s", smtp_reply); + else if (smtp_reply) + moan_smtp_batch(NULL, "%s", smtp_reply); } @@ -4133,7 +4135,7 @@ file has already been unlinked, and the header file was never written to disk. We must now indicate that nothing was received, to prevent a delivery from starting. */ -if (blackholed_by != NULL) +if (blackholed_by) { const uschar *detail = local_scan_data ? string_printing(local_scan_data) diff --git a/test/log/0555 b/test/log/0555 index e223bd466..29d71cd21 100644 --- a/test/log/0555 +++ b/test/log/0555 @@ -1,2 +1,2 @@ -1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-smtp S=sss +1999-03-02 09:44:33 10HmaX-0005vi-00 (= CALLER@myhost.test.ex U=CALLER P=local-smtp S=sss 1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-smtp S=sss diff --git a/test/log/4010 b/test/log/4010 index 1ab5847e6..c1176fee6 100644 --- a/test/log/4010 +++ b/test/log/4010 @@ -1,6 +1,6 @@ 1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss id=41C2F849.3060203@projectile.test.ex 1999-03-02 09:44:33 10HmaX-0005vi-00 => userx R=r1 T=t1 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-esmtp S=sss id=41C2F849.3060203@projectile.test.ex +1999-03-02 09:44:33 10HmaY-0005vi-00 (= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss id=41C2F849.3060203@projectile.test.ex 1999-03-02 09:44:33 10HmaY-0005vi-00 => userx R=r1 T=t1 1999-03-02 09:44:33 10HmaY-0005vi-00 Completed diff --git a/test/scripts/0000-Basic/0555 b/test/scripts/0000-Basic/0555 index 947f1692d..c35113603 100644 --- a/test/scripts/0000-Basic/0555 +++ b/test/scripts/0000-Basic/0555 @@ -1,4 +1,4 @@ -# Long lines for fakedefer/fakereject +# Long response lines for fakedefer/fakereject exim -bs mail from:<> rcpt to: -- cgit v1.2.3