X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fexpand.c;h=b9eeb7c46766352e5e09a7c5bf3d7e1407e5072d;hb=49e56fb37f587bf0e69d2fbe76fa0793f898c26f;hp=e386bbd97510128b411231c88e39f5128a7f7428;hpb=bce15b62182d356f86e7a0bdbb513cbb22de1a20;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/expand.c b/src/src/expand.c index e386bbd97..b9eeb7c46 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -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; }