From 2556b3c619956593f4ac43b30a7b4e15228888d6 Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sun, 11 Mar 2018 16:25:28 +0000 Subject: PRDR: append overall DATA acceptance message to delivery log line "C=" item. Bug 2253 It can have useful tracking info from the destination, eg. their message Id. --- src/src/transports/smtp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index add425326..c4a6c0283 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -3224,8 +3224,11 @@ else #ifndef DISABLE_PRDR if (sx.prdr_active) { + const uschar * overall_message; + /* PRDR - get the final, overall response. For any non-success upgrade all the address statuses. */ + sx.ok = smtp_read_response(&sx.inblock, sx.buffer, sizeof(sx.buffer), '2', sx.ob->final_timeout); if (!sx.ok) @@ -3241,7 +3244,14 @@ else goto RESPONSE_FAILED; } - /* Update the journal, or setup retry. */ + /* Append the overall response to the individual PRDR response for logging + and update the journal, or setup retry. */ + + overall_message = string_printing(sx.buffer); + for (addr = addrlist; addr != sx.first_addr; addr = addr->next) + if (addr->transport_return == OK) + addr->message = string_sprintf("%s\\n%s", addr->message, overall_message); + for (addr = addrlist; addr != sx.first_addr; addr = addr->next) if (addr->transport_return == OK) { -- cgit v1.2.3