- 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
+4
View File
@@ -1,3 +1,7 @@
1.0.2 UNRELEASED
- Fix message extraction so that signing in the same pass through the milter
as verifying works correctly
1.0.1 2019-02-11 1.0.1 2019-02-11
* Reorder milter start and dropping privileges so permissions on Unix socket * Reorder milter start and dropping privileges so permissions on Unix socket
are correct (LP: 1797720) are correct (LP: 1797720)
+2 -3
View File
@@ -174,20 +174,19 @@ class dkimMilter(Milter.Base):
except: except:
# Don't error out on unparseable AR header fiels # Don't error out on unparseable AR header fiels
pass pass
# Check or sign DKIM # Check and/or sign DKIM
self.fp.seek(0) self.fp.seek(0)
txt = self.fp.read()
if milterconfig.get('Domain'): if milterconfig.get('Domain'):
domain = milterconfig.get('Domain') domain = milterconfig.get('Domain')
else: else:
domain = '' domain = ''
if ((self.fdomain in domain) and not milterconfig.get('Mode') == 'v' if ((self.fdomain in domain) and not milterconfig.get('Mode') == 'v'
and not self.external_connection): and not self.external_connection):
txt = self.fp.read()
self.sign_dkim(txt) self.sign_dkim(txt)
if ((self.has_dkim) and (not self.internal_connection) and if ((self.has_dkim) and (not self.internal_connection) and
(milterconfig.get('Mode') == 'v' or (milterconfig.get('Mode') == 'v' or
milterconfig.get('Mode') == 'sv')): milterconfig.get('Mode') == 'sv')):
txt = self.fp.read()
self.check_dkim(txt) self.check_dkim(txt)
if self.arresults: if self.arresults:
h = authres.AuthenticationResultsHeader(authserv_id= h = authres.AuthenticationResultsHeader(authserv_id=