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