Add client-ip info to non-pass iprev ${authres } lines
[exim.git] / src / src / expand.c
index 07c6edfc57aacdad246c95187ebb57c499b00c87..b9eeb7c46766352e5e09a7c5bf3d7e1407e5072d 100644 (file)
@@ -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;
 }