From 7ec97a6001214d1f7d8d81c91397923b245c5565 Mon Sep 17 00:00:00 2001 From: Scott Kitterman Date: Thu, 5 Sep 2019 23:52:07 -0400 Subject: [PATCH] - Fix message extraction so that signing in the same pass through the milter as verifying works correctly --- CHANGES | 4 ++++ dkimpy_milter/__init__.py | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 15e4a50..f6d0c8e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1.1.1 UNRELEASED + - Fix message extraction so that signing in the same pass through the milter + as verifying works correctly + 1.1.0 2019-04-12 - Add SubDomains option to enable signing for sub-domains (LP: #1811535) - Port to python3 (LP: #1815502) diff --git a/dkimpy_milter/__init__.py b/dkimpy_milter/__init__.py index 64f12df..0da066b 100644 --- a/dkimpy_milter/__init__.py +++ b/dkimpy_milter/__init__.py @@ -177,8 +177,9 @@ class dkimMilter(Milter.Base): except: # Don't error out on unparseable AR header fiels pass - # Check or sign DKIM + # Check and/or sign DKIM self.fp.seek(0) + txt = self.fp.read() if milterconfig.get('Domain'): domain = milterconfig.get('Domain') else: @@ -187,12 +188,10 @@ class dkimMilter(Milter.Base): self.fdomain = _get_parent_domain(self.fdomain, domain) if ((self.fdomain in domain) and not milterconfig.get('Mode') == 'v' and not self.external_connection): - txt = self.fp.read() self.sign_dkim(txt) if ((self.has_dkim) and (not self.internal_connection) and (milterconfig.get('Mode') == 'v' or milterconfig.get('Mode') == 'sv')): - txt = self.fp.read() self.check_dkim(txt) if self.arresults: h = authres.AuthenticationResultsHeader(authserv_id=