From c1facfc23f9a32e9e8a216dddacec9215c03f374 Mon Sep 17 00:00:00 2001 From: gwire Date: Sat, 20 Mar 2021 19:16:39 +0000 Subject: [PATCH] authres: use policy.iprev to record remote IP Replace "smtp.remote-ip" with "policy.iprev" when applied to iprev method, but retain "smtp.remote-ip" for arc method. Updates changes made in 99efa4cfbe403a1e02bf4a4eb24219e557865033 --- src/src/expand.c | 2 +- test/log/4560 | 30 +++++++++++++++--------------- test/mail/3700.smtps | 2 +- test/mail/3700.x | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/src/expand.c b/src/src/expand.c index 8be7bf97b0..b4e9b9591b 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1716,7 +1716,7 @@ else return g; if (sender_host_address) - g = string_append(g, 2, US" smtp.remote-ip=", sender_host_address); + g = string_append(g, 2, US" policy.iprev=", sender_host_address); return g; } diff --git a/test/log/4560 b/test/log/4560 index 1c4f08a301..bebefdbf81 100644 --- a/test/log/4560 +++ b/test/log/4560 @@ -62,8 +62,8 @@ 1999-03-02 09:44:33 10HmbC-0005vi-00 domains: 1999-03-02 09:44:33 10HmbC-0005vi-00 arc_oldest_pass <1> 1999-03-02 09:44:33 10HmbC-0005vi-00 reason: <> -1999-03-02 09:44:33 10HmbC-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> -1999-03-02 09:44:33 10HmbC-0005vi-00 lh-ams: < i=2; test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbC-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbC-0005vi-00 lh-ams: < i=2; test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> 1999-03-02 09:44:33 10HmbC-0005vi-00 oldest-p-ams: 1999-03-02 09:44:33 10HmbC-0005vi-00 <= CALLER@bloggs.com H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for a@test.ex 1999-03-02 09:44:33 10HmbB-0005vi-00 => a@test.ex R=fwd T=tsmtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbC-0005vi-00" @@ -98,9 +98,9 @@ 1999-03-02 09:44:33 10HmbF-0005vi-00 domains: 1999-03-02 09:44:33 10HmbF-0005vi-00 arc_oldest_pass <2> 1999-03-02 09:44:33 10HmbF-0005vi-00 reason: <> -1999-03-02 09:44:33 10HmbF-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> -1999-03-02 09:44:33 10HmbF-0005vi-00 lh-ams: < i=2; test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> -1999-03-02 09:44:33 10HmbF-0005vi-00 oldest-p-ams: +1999-03-02 09:44:33 10HmbF-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbF-0005vi-00 lh-ams: < i=2; test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbF-0005vi-00 oldest-p-ams: 1999-03-02 09:44:33 10HmbF-0005vi-00 <= CALLER@bloggs.com H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for za@test.ex 1999-03-02 09:44:33 10HmbE-0005vi-00 => za@test.ex R=mlist T=tmlist H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbF-0005vi-00" 1999-03-02 09:44:33 10HmbE-0005vi-00 Completed @@ -110,9 +110,9 @@ 1999-03-02 09:44:33 10HmbG-0005vi-00 domains: 1999-03-02 09:44:33 10HmbG-0005vi-00 arc_oldest_pass <2> 1999-03-02 09:44:33 10HmbG-0005vi-00 reason: <> -1999-03-02 09:44:33 10HmbG-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=2) header.s=sel arc.oldest-pass=2 smtp.remote-ip=127.0.0.1: test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> -1999-03-02 09:44:33 10HmbG-0005vi-00 lh-ams: < i=3; test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=2) header.s=sel arc.oldest-pass=2 smtp.remote-ip=127.0.0.1: i=2; test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> -1999-03-02 09:44:33 10HmbG-0005vi-00 oldest-p-ams: +1999-03-02 09:44:33 10HmbG-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=2) header.s=sel arc.oldest-pass=2 smtp.remote-ip=127.0.0.1: test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbG-0005vi-00 lh-ams: < i=3; test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=2) header.s=sel arc.oldest-pass=2 smtp.remote-ip=127.0.0.1: i=2; test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbG-0005vi-00 oldest-p-ams: 1999-03-02 09:44:33 10HmbG-0005vi-00 <= CALLER@bloggs.com H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for a@test.ex 1999-03-02 09:44:33 10HmbF-0005vi-00 => a@test.ex R=fwd T=tsmtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbG-0005vi-00" 1999-03-02 09:44:33 10HmbF-0005vi-00 Completed @@ -146,8 +146,8 @@ 1999-03-02 09:44:33 10HmbJ-0005vi-00 domains: 1999-03-02 09:44:33 10HmbJ-0005vi-00 arc_oldest_pass <1> 1999-03-02 09:44:33 10HmbJ-0005vi-00 reason: <> -1999-03-02 09:44:33 10HmbJ-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> -1999-03-02 09:44:33 10HmbJ-0005vi-00 lh-ams: < i=2; test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbJ-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbJ-0005vi-00 lh-ams: < i=2; test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> 1999-03-02 09:44:33 10HmbJ-0005vi-00 oldest-p-ams: 1999-03-02 09:44:33 10HmbJ-0005vi-00 <= CALLER@bloggs.com H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for mza@test.ex 1999-03-02 09:44:33 10HmbI-0005vi-00 => mza@test.ex R=fwd T=tsmtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbJ-0005vi-00" @@ -158,8 +158,8 @@ 1999-03-02 09:44:33 10HmbK-0005vi-00 domains: 1999-03-02 09:44:33 10HmbK-0005vi-00 arc_oldest_pass <0> 1999-03-02 09:44:33 10HmbK-0005vi-00 reason: -1999-03-02 09:44:33 10HmbK-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=2) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> -1999-03-02 09:44:33 10HmbK-0005vi-00 lh-ams: < i=2; test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbK-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=2) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbK-0005vi-00 lh-ams: < i=2; test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> 1999-03-02 09:44:33 10HmbK-0005vi-00 oldest-p-ams: <> 1999-03-02 09:44:33 10HmbK-0005vi-00 <= CALLER@bloggs.com H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss for za@test.ex 1999-03-02 09:44:33 10HmbJ-0005vi-00 => za@test.ex R=mlist T=tmlist H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbK-0005vi-00" @@ -170,8 +170,8 @@ 1999-03-02 09:44:33 10HmbL-0005vi-00 domains: 1999-03-02 09:44:33 10HmbL-0005vi-00 arc_oldest_pass <0> 1999-03-02 09:44:33 10HmbL-0005vi-00 reason: -1999-03-02 09:44:33 10HmbL-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=fail (i=2)(AMS body hash miscompare) header.s=sel arc.oldest-pass=0 smtp.remote-ip=127.0.0.1: test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=2) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> -1999-03-02 09:44:33 10HmbL-0005vi-00 lh-ams: < i=3; test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=fail (i=2)(AMS body hash miscompare) header.s=sel arc.oldest-pass=0 smtp.remote-ip=127.0.0.1: i=2; test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbL-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=fail (i=2)(AMS body hash miscompare) header.s=sel arc.oldest-pass=0 smtp.remote-ip=127.0.0.1: test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=2) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbL-0005vi-00 lh-ams: < i=3; test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=fail (i=2)(AMS body hash miscompare) header.s=sel arc.oldest-pass=0 smtp.remote-ip=127.0.0.1: i=2; test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: i=1; test.ex;\n arc=none> 1999-03-02 09:44:33 10HmbL-0005vi-00 oldest-p-ams: <> 1999-03-02 09:44:33 10HmbL-0005vi-00 <= CALLER@bloggs.com H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss for a@test.ex 1999-03-02 09:44:33 10HmbK-0005vi-00 => a@test.ex R=fwd T=tsmtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbL-0005vi-00" @@ -206,7 +206,7 @@ 1999-03-02 09:44:33 10HmbO-0005vi-00 domains: 1999-03-02 09:44:33 10HmbO-0005vi-00 arc_oldest_pass <1> 1999-03-02 09:44:33 10HmbO-0005vi-00 reason: <> -1999-03-02 09:44:33 10HmbO-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) smtp.remote-ip=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> +1999-03-02 09:44:33 10HmbO-0005vi-00 lh_A-R: < test.ex;\n iprev=pass (localhost) policy.iprev=127.0.0.1;\n arc=pass (i=1) header.s=sel arc.oldest-pass=1 smtp.remote-ip=127.0.0.1: test.ex;\n arc=none> 1999-03-02 09:44:33 10HmbO-0005vi-00 lh-ams: < i=1; test.ex;\n arc=none> 1999-03-02 09:44:33 10HmbO-0005vi-00 oldest-p-ams: 1999-03-02 09:44:33 10HmbO-0005vi-00 <= CALLER@bloggs.com H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for a@test.ex diff --git a/test/mail/3700.smtps b/test/mail/3700.smtps index 66d2afe480..b0547d1859 100644 --- a/test/mail/3700.smtps +++ b/test/mail/3700.smtps @@ -1,6 +1,6 @@ From ok@test.ex Tue Mar 02 09:44:33 1999 Authentication-Results: myhost.test.ex; - iprev=pass (localhost) smtp.remote-ip=127.0.0.1; + iprev=pass (localhost) policy.iprev=127.0.0.1; auth=pass (tls) x509.auth="Phil Pennock" Received: from localhost ([127.0.0.1] helo=myhost.test.ex) by myhost.test.ex with esmtpsa (TLS1.x:ke-RSA-AES256-SHAnnn:xxx) diff --git a/test/mail/3700.x b/test/mail/3700.x index d520cfe15b..8e4dcc50d4 100644 --- a/test/mail/3700.x +++ b/test/mail/3700.x @@ -1,6 +1,6 @@ From ok@test.ex Tue Mar 02 09:44:33 1999 Authentication-Results: myhost.test.ex; - iprev=pass (localhost) smtp.remote-ip=127.0.0.1; + iprev=pass (localhost) policy.iprev=127.0.0.1; auth=pass (tls) x509.auth="Phil Pennock" Received: from localhost ([127.0.0.1] helo=myhost.test.ex) by myhost.test.ex with esmtpsa (TLS1.x:ke-RSA-AES256-SHAnnn:xxx)