Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authres: use policy.iprev to record remote IP #83

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/src/expand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
30 changes: 15 additions & 15 deletions test/log/4560
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
1999-03-02 09:44:33 10HmbC-0005vi-00 domains: <test.ex:test.ex>
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: <i=1; test.ex;\n arc=none>
1999-03-02 09:44:33 10HmbC-0005vi-00 <= [email protected] H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for [email protected]
1999-03-02 09:44:33 10HmbB-0005vi-00 => [email protected] <[email protected]> R=fwd T=tsmtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbC-0005vi-00"
Expand Down Expand Up @@ -98,9 +98,9 @@
1999-03-02 09:44:33 10HmbF-0005vi-00 domains: <test.ex:test.ex>
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: <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>
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: <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>
1999-03-02 09:44:33 10HmbF-0005vi-00 <= [email protected] H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for [email protected]
1999-03-02 09:44:33 10HmbE-0005vi-00 => [email protected] <[email protected]> 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
Expand All @@ -110,9 +110,9 @@
1999-03-02 09:44:33 10HmbG-0005vi-00 domains: <test.ex:test.ex:test.ex>
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: <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>
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: <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>
1999-03-02 09:44:33 10HmbG-0005vi-00 <= [email protected] H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for [email protected]
1999-03-02 09:44:33 10HmbF-0005vi-00 => [email protected] <[email protected]> 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
Expand Down Expand Up @@ -146,8 +146,8 @@
1999-03-02 09:44:33 10HmbJ-0005vi-00 domains: <test.ex:test.ex>
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: <i=1; test.ex;\n arc=none>
1999-03-02 09:44:33 10HmbJ-0005vi-00 <= [email protected] H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for [email protected]
1999-03-02 09:44:33 10HmbI-0005vi-00 => [email protected] <[email protected]> R=fwd T=tsmtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbJ-0005vi-00"
Expand All @@ -158,8 +158,8 @@
1999-03-02 09:44:33 10HmbK-0005vi-00 domains: <test.ex:test.ex>
1999-03-02 09:44:33 10HmbK-0005vi-00 arc_oldest_pass <0>
1999-03-02 09:44:33 10HmbK-0005vi-00 reason: <AMS body hash miscompare>
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 <= [email protected] H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss for [email protected]
1999-03-02 09:44:33 10HmbJ-0005vi-00 => [email protected] <[email protected]> R=mlist T=tmlist H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbK-0005vi-00"
Expand All @@ -170,8 +170,8 @@
1999-03-02 09:44:33 10HmbL-0005vi-00 domains: <test.ex:test.ex:test.ex>
1999-03-02 09:44:33 10HmbL-0005vi-00 arc_oldest_pass <0>
1999-03-02 09:44:33 10HmbL-0005vi-00 reason: <i=3 (cv)>
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 <= [email protected] H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss for [email protected]
1999-03-02 09:44:33 10HmbK-0005vi-00 => [email protected] <[email protected]> R=fwd T=tsmtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbL-0005vi-00"
Expand Down Expand Up @@ -206,7 +206,7 @@
1999-03-02 09:44:33 10HmbO-0005vi-00 domains: <test.ex>
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: <i=1; test.ex;\n arc=none>
1999-03-02 09:44:33 10HmbO-0005vi-00 <= [email protected] H=localhost (test.ex) [127.0.0.1] P=esmtp S=sss ARC for [email protected]
Expand Down
2 changes: 1 addition & 1 deletion test/mail/3700.smtps
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From [email protected] 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)
Expand Down
2 changes: 1 addition & 1 deletion test/mail/3700.x
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From [email protected] 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)
Expand Down