From e27fcc826d240d3f261a7652919142914a34f4df Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Sun, 11 Oct 2020 17:12:41 +0200 Subject: [PATCH] Fix Received header matching --- qmail-arc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qmail-arc.py b/qmail-arc.py index 7e5741d..936b5e4 100755 --- a/qmail-arc.py +++ b/qmail-arc.py @@ -37,8 +37,9 @@ privkey = open('/home/mbirth/.dkim-privkey', 'rb').read() message = sys.stdin.read().decode("utf-8") -#up_srv_ip_match = re.search(r"Received: from .* \(HELO (.*)\) \(([0-9a-f.:]+)\).*by ", message, re.MULTILINE | re.DOTALL) -up_srv_ip_match = re.search(r"Received: from (.*) \(([0-9a-f.:]+)\).*by ", message, re.MULTILINE | re.DOTALL) +up_srv_ip_match = re.search(r"Received: from (.*?) \(.*? \[([0-9a-f.:]+)\].*by ", message, re.MULTILINE | re.DOTALL) + +#sys.stdout.write(repr(up_srv_ip_match).encode("utf-8")) if not up_srv_ip_match: # Pass-thru message