]> git.netwichtig.de Git - user/henk/code/exim.git/blobdiff - src/src/expand.c
DKIM: Fix signing for body lines starting with a pair of dots. Bug 2284
[user/henk/code/exim.git] / src / src / expand.c
index e386bbd97510128b411231c88e39f5128a7f7428..b9eeb7c46766352e5e09a7c5bf3d7e1407e5072d 100644 (file)
@@ -1525,10 +1525,7 @@ can also return a concatenation of all the header lines. When concatenating
 specific headers that contain lists of addresses, a comma is inserted between
 them. Otherwise we use a straight concatenation. Because some messages can have
 pathologically large number of lines, there is a limit on the length that is
-returned. Also, to avoid massive store use which would result from using
-string_cat() as it copies and extends strings, we do a preliminary pass to find
-out exactly how much store will be needed. On "normal" messages this will be
-pretty trivial.
+returned.
 
 Arguments:
   name          the name of the header, without the leading $header_ or $h_,
@@ -1540,7 +1537,7 @@ Arguments:
                  just return a string that is not "" and not "0" if the header
                  exists
                FH_WANT_RAW
-                 set if called for $rh_ or $rheader_ variables; no processing,
+                 set if called for $rh_ or $rheader_ items; no processing,
                  other than concatenating, will be done on the header. Also used
                  for $message_headers_raw.
                FH_WANT_LIST
@@ -1678,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;
 }