- Fix message extraction so that signing in the same pass through the milter

as verifying works correctly
This commit is contained in:
Scott Kitterman
2019-09-05 23:52:07 -04:00
parent 51c8fdcb6c
commit 721da801fe
2 changed files with 6 additions and 3 deletions
+2 -3
View File
@@ -174,20 +174,19 @@ 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:
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=