From 194cc0e4ae3487900036c6bd208c0784d4e6e814 Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Mon, 13 Nov 2006 12:07:46 +0000 Subject: [PATCH] Rename $interface_address and $interface_port as $received_ip_address and $received_port in an attempt to lessen confusion. --- doc/doc-txt/ChangeLog | 7 ++++++- doc/doc-txt/NewStuff | 7 ++++++- src/src/expand.c | 4 +++- test/confs/0282 | 3 ++- test/confs/0480 | 6 +++--- test/mail/0282.userx | 2 ++ test/stderr/0480 | 2 +- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index ee5817026..1ac335408 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.431 2006/11/13 11:56:41 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.432 2006/11/13 12:07:46 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -266,6 +266,11 @@ PH/41 Add bitwise logical operations to eval (courtesy Brad Jorsch). PH/42 Give an error if -q is specified more than once. +PH/43 Renamed the variables $interface_address and $interface_port as + $received_ip_address and $received_port, to make it clear that these + values apply to message reception, and not to the outgoing interface when + a message is delivered. (The old names remain recognized, of course.) + Exim version 4.63 ----------------- diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff index 53bfcc179..564d76df2 100644 --- a/doc/doc-txt/NewStuff +++ b/doc/doc-txt/NewStuff @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/NewStuff,v 1.121 2006/11/13 11:26:37 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/NewStuff,v 1.122 2006/11/13 12:07:46 ph10 Exp $ New Features in Exim -------------------- @@ -192,6 +192,11 @@ Version 4.64 ${eval:~255&0x1234} yields 4608 ${eval:-(~255&0x1234)} yields -4608 +11. The variables $interface_address and $interface_port have been renamed + as $received_ip_address and $received_port, to make it clear that they + relate to message reception rather than delivery. (The old names remain + available for compatibility.) + Version 4.63 ------------ diff --git a/src/src/expand.c b/src/src/expand.c index 31791a888..d049466f1 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/expand.c,v 1.69 2006/11/13 11:26:37 ph10 Exp $ */ +/* $Cambridge: exim/src/src/expand.c,v 1.70 2006/11/13 12:07:46 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -436,6 +436,8 @@ static var_entry var_table[] = { { "rcpt_fail_count", vtype_int, &rcpt_fail_count }, { "received_count", vtype_int, &received_count }, { "received_for", vtype_stringptr, &received_for }, + { "received_ip_address", vtype_stringptr, &interface_address }, + { "received_port", vtype_int, &interface_port }, { "received_protocol", vtype_stringptr, &received_protocol }, { "received_time", vtype_int, &received_time }, { "recipient_data", vtype_stringptr, &recipient_data }, diff --git a/test/confs/0282 b/test/confs/0282 index 0952977ab..9ebe5ad81 100644 --- a/test/confs/0282 +++ b/test/confs/0282 @@ -33,6 +33,7 @@ local_delivery: driver = appendfile file = DIR/test-mail/$local_part user = CALLER - headers_add = interface-port: $interface_port + headers_add = interface-port: $interface_port\n\ + received-port: $received_port # End diff --git a/test/confs/0480 b/test/confs/0480 index 3308c0663..c8adb1ba5 100644 --- a/test/confs/0480 +++ b/test/confs/0480 @@ -18,13 +18,13 @@ gecos_name = CALLER_NAME acl_smtp_rcpt = accept -smtp_active_hostname = ${if eq{$interface_address}{IP1}\ +smtp_active_hostname = ${if eq{$received_ip_address}{IP1}\ {host.IP1}\ {\ - ${if eq{$interface_address}{IP2}\ + ${if eq{$received_ip_address}{IP2}\ {}\ {\ - ${if eq{$interface_address}{IP3}\ + ${if eq{$received_ip_address}{IP3}\ {${lookup{x}lsearch{/non/exist}}}\ fail}\ }}\ diff --git a/test/mail/0282.userx b/test/mail/0282.userx index e01c84b0c..abd61fa18 100644 --- a/test/mail/0282.userx +++ b/test/mail/0282.userx @@ -5,6 +5,7 @@ Received: from [127.0.0.1] (port=1111 helo=rhu.barb) id 10HmaX-0005vi-00 for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 interface-port: 1225 +received-port: 1225 This is a test message. @@ -15,6 +16,7 @@ Received: from [127.0.0.1] (port=1112 helo=rhu.barb) id 10HmaY-0005vi-00 for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 interface-port: 1226 +received-port: 1226 This is a test message. diff --git a/test/stderr/0480 b/test/stderr/0480 index b3f00895f..507e1d082 100644 --- a/test/stderr/0480 +++ b/test/stderr/0480 @@ -16,7 +16,7 @@ >>> host in helo_try_verify_hosts? no (option unset) >>> host in helo_accept_junk_hosts? no (option unset) >>> a.b.c in helo_lookup_domains? no (end of list) -LOG: failed to expand "${if eq{$interface_address}{V4NET.0.0.1}{host.V4NET.0.0.1}{${if eq{$interface_address}{V4NET.0.0.2}{}{${if eq{$interface_address}{V4NET.0.0.3}{${lookup{x}lsearch{/non/exist}}}fail}}}}}" (smtp_active_hostname): failed to open /non/exist for linear search: No such file or directory +LOG: failed to expand "${if eq{$received_ip_address}{V4NET.0.0.1}{host.V4NET.0.0.1}{${if eq{$received_ip_address}{V4NET.0.0.2}{}{${if eq{$received_ip_address}{V4NET.0.0.3}{${lookup{x}lsearch{/non/exist}}}fail}}}}}" (smtp_active_hostname): failed to open /non/exist for linear search: No such file or directory >>> host in hosts_connection_nolog? no (option unset) >>> host in host_lookup? no (option unset) >>> host in host_reject_connection? no (option unset) -- 2.30.2