From 55264a5f4b04e9df372b2ca7a01199c866318a2b Mon Sep 17 00:00:00 2001 From: Paul Arthur Date: Wed, 25 Mar 2026 17:21:22 +0000 Subject: [PATCH] milter: better line breaks for AAR --- .gitignore | 1 + CHANGELOG.md | 2 + openarc/openarc.c | 7 +- test/test_interop.py | 10 +- test/test_milter.py | 241 ++++++++++++++++++++++++++----------------- 5 files changed, 160 insertions(+), 101 deletions(-) diff --git a/.gitignore b/.gitignore index f9515ea..a38c1f8 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ stamp-h1 .deps/* *~ *.cache +*.swp *#* .venv .vscode diff --git a/CHANGELOG.md b/CHANGELOG.md index 2882f46..57ce0ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file. ### Changed * tests - migrated from manual "snapshots" to `inline-snapshot`. +* milter - `ARC-Authentication-Results` is returned with a linebreak before + the first resinfo. ### Fixed diff --git a/openarc/openarc.c b/openarc/openarc.c index 77d24c3..65ad465 100644 --- a/openarc/openarc.c +++ b/openarc/openarc.c @@ -3835,8 +3835,9 @@ mlfi_eom(SMFICTX *ctx) if (arc_dstring_len(afc->mctx_tmpstr) > 0) { - arc_dstring_cat(afc->mctx_tmpstr, ";\n\t"); + arc_dstring_cat(afc->mctx_tmpstr, ";"); } + arc_dstring_cat(afc->mctx_tmpstr, "\n\t"); arc_dstring_printf(afc->mctx_tmpstr, "%s=%s", ares_getmethod(ar.ares_result[i].result_method), @@ -3875,8 +3876,10 @@ mlfi_eom(SMFICTX *ctx) { if (arc_dstring_len(afc->mctx_tmpstr) > 0) { - arc_dstring_cat(afc->mctx_tmpstr, ";\n\t"); + arc_dstring_cat(afc->mctx_tmpstr, ";"); } + arc_dstring_cat(afc->mctx_tmpstr, "\n\t"); + add_arc_authres(afc, conf, ipbuf); } diff --git a/test/test_interop.py b/test/test_interop.py index 076292e..6d3859c 100644 --- a/test/test_interop.py +++ b/test/test_interop.py @@ -57,7 +57,10 @@ def test_dkimpy_sign(run_miltertest, private_key, dkimpy): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=Subject:From:To;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1', + ], ] ) @@ -128,6 +131,9 @@ def test_perl_sign(run_miltertest, private_key, perl_mail_dkim): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=Subject:From:To;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1', + ], ] ) diff --git a/test/test_milter.py b/test/test_milter.py index 2795443..8b24d34 100644 --- a/test/test_milter.py +++ b/test/test_milter.py @@ -21,7 +21,10 @@ def test_milter_basic(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=1; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1', + ], ] ) @@ -40,7 +43,10 @@ def test_milter_v2(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r'i=1; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', 'i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + 'i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1', + ], ] ) @@ -58,7 +64,10 @@ def test_milter_canon_simple(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=1; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1', + ], ] ) @@ -73,7 +82,10 @@ def test_milter_canon_simple(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1', + ], ] ) @@ -101,7 +113,7 @@ def test_milter_resign(run_miltertest): regex=r' i=[0-9]{1,2}; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)' ), ], - ['ARC-Authentication-Results', IsStr(regex=r' i=[0-9]{1,2}; example\.com; arc=pass header\.oldest-pass=0 smtp\.remote-ip=127.0.0.1')], + ['ARC-Authentication-Results', IsStr(regex=r' i=[0-9]{1,2}; example\.com; \n\tarc=pass header\.oldest-pass=0 smtp\.remote-ip=127.0.0.1')], ] ) else: @@ -121,7 +133,10 @@ def test_milter_mode_s(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=1; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1', + ], ] ) @@ -136,7 +151,10 @@ def test_milter_mode_s(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1', + ], ] ) @@ -163,7 +181,10 @@ def test_milter_resign_s(run_miltertest): regex=r' i=[0-9]{1,2}; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)' ), ], - ['ARC-Authentication-Results', IsStr(regex=r' i=[0-9]{1,2}; example\.com; arc=pass header\.oldest-pass=0 smtp\.remote-ip=127\.0\.0\.1')], + [ + 'ARC-Authentication-Results', + IsStr(regex=r' i=[0-9]{1,2}; example\.com; \n\tarc=pass header\.oldest-pass=0 smtp\.remote-ip=127\.0\.0\.1'), + ], ] ) else: @@ -195,7 +216,10 @@ def test_milter_mode_none_sign(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=1; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1', + ], ] ) @@ -214,10 +238,11 @@ def test_milter_mode_none_sign(run_miltertest): ) ], snapshot("""\ - i=1; example.com; iprev=pass policy.iprev=192.0.2.1 (mail.example.com); - spf=pass (domain of foo@example.com designates 192.0.2.1 as permitted sender); - dkim=pass header.i=@example.com header.s=foo; - arc=none smtp.remote-ip=127.0.0.1\ + i=1; example.com; \n\ +\tiprev=pass policy.iprev=192.0.2.1 (mail.example.com); +\tspf=pass (domain of foo@example.com designates 192.0.2.1 as permitted sender); +\tdkim=pass header.i=@example.com header.s=foo; +\tarc=none smtp.remote-ip=127.0.0.1\ """), ], # Multiple headers @@ -228,10 +253,11 @@ def test_milter_mode_none_sign(run_miltertest): 'example.com; dkim=pass header.i=@example.com header.s=foo', ], snapshot("""\ - i=1; example.com; iprev=pass policy.iprev=192.0.2.1 (mail.example.com); - spf=pass (domain of foo@example.com designates 192.0.2.1 as permitted sender); - dkim=pass header.i=@example.com header.s=foo; - arc=none smtp.remote-ip=127.0.0.1\ + i=1; example.com; \n\ +\tiprev=pass policy.iprev=192.0.2.1 (mail.example.com); +\tspf=pass (domain of foo@example.com designates 192.0.2.1 as permitted sender); +\tdkim=pass header.i=@example.com header.s=foo; +\tarc=none smtp.remote-ip=127.0.0.1\ """), ], # Multiple headers for the same method @@ -241,18 +267,12 @@ def test_milter_mode_none_sign(run_miltertest): 'example.com; spf=fail', 'example.com; spf=none', ], - snapshot("""\ - i=1; example.com; spf=pass; - arc=none smtp.remote-ip=127.0.0.1\ -"""), + snapshot(' i=1; example.com; \n\tspf=pass;\n\tarc=none smtp.remote-ip=127.0.0.1'), ], # Same method multiple times [ ['example.com; spf=pass; spf=fail; spf=none'], - snapshot("""\ - i=1; example.com; spf=pass; - arc=none smtp.remote-ip=127.0.0.1\ -"""), + snapshot(' i=1; example.com; \n\tspf=pass;\n\tarc=none smtp.remote-ip=127.0.0.1'), ], # Header with more results than we're willing to store [ @@ -281,23 +301,24 @@ def test_milter_mode_none_sign(run_miltertest): ) ], snapshot("""\ - i=1; example.com; dkim=pass header.i=@example.com header.s=foo; - dkim=pass header.i=@example.com header.s=bar; - dkim=pass header.i=@example.com header.s=baz; - dkim=pass header.i=@example.com header.s=qux; - dkim=pass header.i=@example.com header.s=quux; - dkim=pass header.i=@example.com header.s=quuux; - dkim=fail header.i=@example.com header.s=foo; - dkim=fail header.i=@example.com header.s=bar; - dkim=fail header.i=@example.com header.s=baz; - dkim=fail header.i=@example.com header.s=qux; - dkim=fail header.i=@example.com header.s=quux; - dkim=fail header.i=@example.com header.s=quuux; - dkim=policy header.i=@example.com header.s=foo; - dkim=policy header.i=@example.com header.s=bar; - dkim=policy header.i=@example.com header.s=baz; - dkim=policy header.i=@example.com header.s=qux; - arc=none smtp.remote-ip=127.0.0.1\ + i=1; example.com; \n\ +\tdkim=pass header.i=@example.com header.s=foo; +\tdkim=pass header.i=@example.com header.s=bar; +\tdkim=pass header.i=@example.com header.s=baz; +\tdkim=pass header.i=@example.com header.s=qux; +\tdkim=pass header.i=@example.com header.s=quux; +\tdkim=pass header.i=@example.com header.s=quuux; +\tdkim=fail header.i=@example.com header.s=foo; +\tdkim=fail header.i=@example.com header.s=bar; +\tdkim=fail header.i=@example.com header.s=baz; +\tdkim=fail header.i=@example.com header.s=qux; +\tdkim=fail header.i=@example.com header.s=quux; +\tdkim=fail header.i=@example.com header.s=quuux; +\tdkim=policy header.i=@example.com header.s=foo; +\tdkim=policy header.i=@example.com header.s=bar; +\tdkim=policy header.i=@example.com header.s=baz; +\tdkim=policy header.i=@example.com header.s=qux; +\tarc=none smtp.remote-ip=127.0.0.1\ """), ], # Non-matching authserv-id @@ -307,23 +328,17 @@ def test_milter_mode_none_sign(run_miltertest): 'otheradmd.example.com; spf=tempfail', 'example.net; spf=permfail', ], - snapshot(' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'), + snapshot(' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1'), ], # CFWS [ ['example.com; (a)spf (Sender Policy Framework) = pass (good) smtp (mail transfer) . (protocol) mailfrom = foo@example.com;'], - snapshot("""\ - i=1; example.com; spf=pass (good) smtp.mailfrom=foo@example.com; - arc=none smtp.remote-ip=127.0.0.1\ -"""), + snapshot(' i=1; example.com; \n\tspf=pass (good) smtp.mailfrom=foo@example.com;\n\tarc=none smtp.remote-ip=127.0.0.1'), ], # Unknown method [ ['example.com; spf=pass; superspf=pass; arc=pass; superarc=fail policy.krypton=foo;'], - snapshot("""\ - i=1; example.com; spf=pass; - arc=pass\ -"""), + snapshot(' i=1; example.com; \n\tspf=pass;\n\tarc=pass'), ], # Unknown ptype [ @@ -331,21 +346,20 @@ def test_milter_mode_none_sign(run_miltertest): 'example.com; spf=pass imap.override=true', 'example.com; spf=pass; iprev=pass dnssec.signed=true', ], - snapshot(' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'), + snapshot(' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1'), ], # reason [ ['example.com; spf=pass (ip4)reason="192.0.2.1 matched ip4:192.0.2.0/27 in _spf.example.com"; dmarc=pass'], - snapshot("""\ - i=1; example.com; spf=pass reason="192.0.2.1 matched ip4:192.0.2.0/27 in _spf.example.com" (ip4); - dmarc=pass; - arc=none smtp.remote-ip=127.0.0.1\ -"""), + snapshot( + ' i=1; example.com; \n\tspf=pass reason="192.0.2.1 matched ip4:192.0.2.0/27 in _spf.example.com" (ip4);\n\tdmarc=pass;' + '\n\tarc=none smtp.remote-ip=127.0.0.1' + ), ], # misplaced reason [ ['example.com; spf=pass; iprev=pass policy.iprev=192.0.2.1 reason="because"'], - snapshot(' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'), + snapshot(' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1'), ], # no-result [ @@ -354,7 +368,7 @@ def test_milter_mode_none_sign(run_miltertest): 'example.com; none; spf=pass', 'example.com; spf=fail; none', ], - snapshot(' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'), + snapshot(' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1'), ], # truncations [ @@ -371,7 +385,7 @@ def test_milter_mode_none_sign(run_miltertest): 'example.com; dmarc=pass; iprev=pass policy.iprev="1" (', 'example.com; dmarc=pass; iprev=pass policy.iprev="1" ( a c', ], - snapshot(' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'), + snapshot(' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1'), ], # bad sequences [ @@ -381,23 +395,20 @@ def test_milter_mode_none_sign(run_miltertest): 'example.com; dmarc=pass; iprev=pass policy=iprev=192.0.2.1', 'example.com; dmarc=pass reason "because";', ], - snapshot(' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'), + snapshot(' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1'), ], # RFC 8904 [ ['example.com; dnswl=pass dns.zone=accept.example.com policy.ip=192.0.2.1 policy.txt="sure, yeah" dns.sec=yes'], - snapshot("""\ - i=1; example.com; dnswl=pass dns.zone=accept.example.com policy.ip=192.0.2.1 policy.txt="sure, yeah" dns.sec=yes; - arc=none smtp.remote-ip=127.0.0.1\ -"""), + snapshot( + ' i=1; example.com; \n\tdnswl=pass dns.zone=accept.example.com policy.ip=192.0.2.1 policy.txt="sure, yeah" dns.sec=yes;' + '\n\tarc=none smtp.remote-ip=127.0.0.1' + ), ], # quoted-string [ ['example.com; auth=pass smtp.auth="花木蘭\\"\\\\ []"'], - snapshot("""\ - i=1; example.com; auth=pass smtp.auth="花木蘭\\"\\\\ []"; - arc=none smtp.remote-ip=127.0.0.1\ -"""), + snapshot(' i=1; example.com; \n\tauth=pass smtp.auth="花木蘭\\"\\\\ []";\n\tarc=none smtp.remote-ip=127.0.0.1'), ], # version [ @@ -405,11 +416,7 @@ def test_milter_mode_none_sign(run_miltertest): 'example.com 1; spf=pass', 'example.com 1 ; dmarc=pass', ], - snapshot("""\ - i=1; example.com; spf=pass; - dmarc=pass; - arc=none smtp.remote-ip=127.0.0.1\ -"""), + snapshot(' i=1; example.com; \n\tspf=pass;\n\tdmarc=pass;\n\tarc=none smtp.remote-ip=127.0.0.1'), ], # invalid version [ @@ -418,7 +425,7 @@ def test_milter_mode_none_sign(run_miltertest): 'example.com a; spf=pass', 'example.com 1 1; spf=pass', ], - snapshot(' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'), + snapshot(' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1'), ], ], ) @@ -441,10 +448,7 @@ def test_milter_authrescomments(run_miltertest): assert res['headers'][3] == snapshot( [ 'ARC-Authentication-Results', - """\ - i=1; example.com; spf=pass smtp.mailfrom=foo@example.com; - arc=none smtp.remote-ip=127.0.0.1\ -""", + ' i=1; example.com; \n\tspf=pass smtp.mailfrom=foo@example.com;\n\tarc=none smtp.remote-ip=127.0.0.1', ] ) @@ -469,7 +473,10 @@ def test_milter_ar_override(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=fail'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=fail', + ], ] ) @@ -502,7 +509,10 @@ def test_milter_ar_override_disabled(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1', + ], ] ) @@ -528,7 +538,10 @@ def test_milter_ar_override_multi(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=pass'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=pass', + ], ] ) @@ -568,7 +581,10 @@ def test_milter_duplicate_header(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=fail smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=fail smtp.remote-ip=127.0.0.1', + ], ] ) @@ -589,9 +605,7 @@ def test_milter_idna(run_miltertest): ], [ 'ARC-Authentication-Results', - """ i=1; 시험.example.com; spf=pass smtp.mailfrom=привіт@시험.example.com; - arc=none smtp.remote-ip=127.0.0.1\ -""", + ' i=1; 시험.example.com; \n\tspf=pass smtp.mailfrom=привіт@시험.example.com;\n\tarc=none smtp.remote-ip=127.0.0.1', ], ] ) @@ -607,7 +621,10 @@ def test_milter_idna(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=시험\.example\.com; s=예; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; 시험.example.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; 시험.example.com; \n\tarc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1', + ], ] ) @@ -633,7 +650,10 @@ def test_milter_oldest_pass(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=pass smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=pass smtp.remote-ip=127.0.0.1', + ], ] ) @@ -652,7 +672,10 @@ def test_milter_oldest_pass(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=3; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=3; example.com; arc=pass header.oldest-pass=2 smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=3; example.com; \n\tarc=pass header.oldest-pass=2 smtp.remote-ip=127.0.0.1', + ], ] ) @@ -671,7 +694,10 @@ def test_milter_authresip(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=1; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=1; example.com; arc=none'], + [ + 'ARC-Authentication-Results', + ' i=1; example.com; \n\tarc=none', + ], ] ) @@ -693,7 +719,10 @@ def test_milter_finalreceiver(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=3; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=3; example.com; arc=pass smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=3; example.com; \n\tarc=pass smtp.remote-ip=127.0.0.1', + ], ] ) @@ -718,7 +747,10 @@ def test_milter_minimum_key_bits(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1', + ], ] ) @@ -737,7 +769,10 @@ def test_milter_minimum_key_bits_fail(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=fail smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=fail smtp.remote-ip=127.0.0.1', + ], ] ) @@ -775,7 +810,10 @@ def test_milter_signaturettl(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=1; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890; x=1234567895;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1', + ], ] ) @@ -791,7 +829,10 @@ def test_milter_signaturettl(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567895;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1', + ], ] ) @@ -807,7 +848,10 @@ def test_milter_signaturettl(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=2; d=example\.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567896;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=2; example.com; arc=fail smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=2; example.com; \n\tarc=fail smtp.remote-ip=127.0.0.1', + ], ] ) @@ -828,6 +872,9 @@ def test_milter_softwareheader(run_miltertest): 'ARC-Message-Signature', IsStr(regex=r' i=1; d=example.com; s=elpmaxe; a=rsa-sha256;\s+c=relaxed/simple; t=1234567890;\s+h=From:Date:Subject;\s+(?s:.+)'), ], - ['ARC-Authentication-Results', ' i=1; example.com; arc=none smtp.remote-ip=127.0.0.1'], + [ + 'ARC-Authentication-Results', + ' i=1; example.com; \n\tarc=none smtp.remote-ip=127.0.0.1', + ], ] )