Compare commits

..

2 Commits

Author SHA1 Message Date
Scott Kitterman 08a13fea9e Update version in setup.py to 1.2.2, prepare for release 2020-08-09 14:21:50 -04:00
Scott Kitterman 52c7ee02af Minimal fix for dnspython 2.0.0 compatibility (still works with 1.16.0) 2020-08-09 14:12:05 -04:00
3 changed files with 9 additions and 19 deletions
-5
View File
@@ -1,8 +1,3 @@
1.2.3
- Logging fixups: Don't traceback for non-UTF-8 data in mail headers and
don't put byte string markers in logs (some remain, but are from dkimpy
and should be fixed there), related to LP: #1980821.
1.2.2 2020-08-09
- Improve README.md formating for markdown display on pypi
- Improve documentation in dkimpy-milter.conf (5) and README.md for signing
+8 -13
View File
@@ -107,10 +107,9 @@ class dkimMilter(Milter.Base):
# envfrom (MAIL FROM in the SMTP protocol) seems to mark the start
# of each message.
@Milter.noreply
def envfrom(self, f, *stri):
def envfrom(self, f, *str):
if self.conf.get('Syslog') and self.conf.get('debugLevel') >= 2:
f = str(bytes(f, encoding='utf-8', errors='replace'))[2:-1]
syslog.syslog("mail from: {0} {1}".format(f, stri))
syslog.syslog("mail from: {0} {1}".format(f, str))
self.fp = io.BytesIO()
self.mailfrom = f
t = parse_addr(f)
@@ -134,8 +133,7 @@ class dkimMilter(Milter.Base):
if lname == 'dkim-signature':
if (self.conf.get('Syslog') and
self.conf.get('debugLevel') >= 1):
val2 = str(bytes(val, encoding='utf-8', errors='replace'))[2:-1]
syslog.syslog("{0}: {1}".format(name, val2))
syslog.syslog("{0}: {1}".format(name, val))
self.has_dkim += 1
if lname == 'from':
fname, self.author = parseaddr(val)
@@ -145,8 +143,7 @@ class dkimMilter(Milter.Base):
pass # self.author was not a proper email address
if (self.conf.get('Syslog') and
self.conf.get('debugLevel') >= 1):
val2 = str(bytes(val, encoding='utf-8', errors='replace'))[2:-1]
syslog.syslog("{0}: {1}".format(name, val2))
syslog.syslog("{0}: {1}".format(name, val))
elif lname == 'authentication-results':
self.arheaders.append(val)
if self.fp:
@@ -184,8 +181,7 @@ class dkimMilter(Milter.Base):
self.chgheader('authentication-results', i, '')
if (self.conf.get('Syslog') and
self.conf.get('debugLevel') >= 1):
val2 = str(bytes(val, encoding='utf-8', errors='replace'))[2:-1]
syslog.syslog('REMOVE: {0}'.format(val2))
syslog.syslog('REMOVE: {0}'.format(val))
except:
# Don't error out on unparseable AR header fiels
pass
@@ -432,8 +428,7 @@ class dkimMilter(Milter.Base):
if self.conf.get('Syslog'):
if d.domain:
syslog.syslog('DKIM: Fail ({0})'
.format(str(d.domain.lower(), 'UTF-8',
errors='replace')))
.format(d.domain.lower()))
else:
syslog.syslog('DKIM: Fail, unextractable domain')
if res:
@@ -443,13 +438,13 @@ class dkimMilter(Milter.Base):
res = False
if self.header_d:
self.arresults.append(
authres.DKIMAuthenticationResult(result=result[2:-1],
authres.DKIMAuthenticationResult(result=result,
header_i=self.header_i,
header_d=self.header_d,
header_a=self.header_a,
result_comment=
self.dkim_comment)
)
)
self.header_a = None
return
+1 -1
View File
@@ -89,7 +89,7 @@ except ImportError: # If PyDNS is not installed, prefer dnspython
setup(
name='dkimpy-milter',
version='1.2.1',
version='1.2.2',
author='Scott Kitterman',
author_email='scott@kitterman.com',
url='https://launchpad.net/dkimpy-milter',