Fix Received header matching

This commit is contained in:
Markus Birth 2020-10-11 17:12:41 +02:00
parent 76bb0e9c0a
commit e27fcc826d

View File

@ -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