From 5a68cf9e254bb4f09bab4a77295c2644ae7c01ed 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 | 2 ++ dkimpy_milter/__init__.py | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 9210699..f4c998f 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,8 @@ - Fix startup logging so it provides information at a useful time - Fix verify processing so missing (optional) i= tag doesn't cause the milter to fail + - 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) diff --git a/dkimpy_milter/__init__.py b/dkimpy_milter/__init__.py index 6052b85..eceb7e7 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=