[exim-cvs] Add client-ip info to non-pass iprev ${authres } …

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Add client-ip info to non-pass iprev ${authres } lines
Gitweb: https://git.exim.org/exim.git/commitdiff/61e3f250a2ac9944f9dd1a99bd60d859c995cc9a
Commit:     61e3f250a2ac9944f9dd1a99bd60d859c995cc9a
Parent:     70edc263fee9c2ecf4c3f0daaa46caa6842a32e6
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Thu Jun 14 11:04:22 2018 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Jun 14 21:34:05 2018 +0100


    Add client-ip info to non-pass iprev ${authres } lines
---
 doc/doc-txt/ChangeLog |  2 ++
 src/src/expand.c      | 17 ++++++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 6b36763..3ebc925 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -59,6 +59,8 @@ JH/11 Bug 2264: Exim now only follows CNAME chains one step by default. We'd
       "error, loop".  A new main option is added so the older capability of
       following some limited number of chain links is maintained.


+JH/12 Add client-ip info to non-pass iprev ${authres } lines.
+

 Exim version 4.91
 -----------------
diff --git a/src/src/expand.c b/src/src/expand.c
index 07c6edf..b9eeb7c 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -1675,13 +1675,16 @@ static gstring *
 authres_iprev(gstring * g)
 {
 if (sender_host_name)
-  return string_append(g, sender_host_address ? 5 : 3,
-    US";\n\tiprev=pass (", sender_host_name, US")",
-    US" smtp.client-ip=", sender_host_address);
-if (host_lookup_deferred)
-  return string_catn(g, US";\n\tiprev=temperror", 19);
-if (host_lookup_failed)
-  return string_catn(g, US";\n\tiprev=fail", 13);
+  g = string_append(g, 3, US";\n\tiprev=pass (", sender_host_name, US")");
+else if (host_lookup_deferred)
+  g = string_catn(g, US";\n\tiprev=temperror", 19);
+else if (host_lookup_failed)
+  g = string_catn(g, US";\n\tiprev=fail", 13);
+else 
+  return g;
+
+if (sender_host_address)
+  g = string_append(g, 2, US" smtp.client-ip=", sender_host_address);
 return g;
 }