Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 08a13fea9e | |||
| 52c7ee02af |
@@ -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
|
1.2.2 2020-08-09
|
||||||
- Improve README.md formating for markdown display on pypi
|
- Improve README.md formating for markdown display on pypi
|
||||||
- Improve documentation in dkimpy-milter.conf (5) and README.md for signing
|
- Improve documentation in dkimpy-milter.conf (5) and README.md for signing
|
||||||
|
|||||||
@@ -107,10 +107,9 @@ class dkimMilter(Milter.Base):
|
|||||||
# envfrom (MAIL FROM in the SMTP protocol) seems to mark the start
|
# envfrom (MAIL FROM in the SMTP protocol) seems to mark the start
|
||||||
# of each message.
|
# of each message.
|
||||||
@Milter.noreply
|
@Milter.noreply
|
||||||
def envfrom(self, f, *stri):
|
def envfrom(self, f, *str):
|
||||||
if self.conf.get('Syslog') and self.conf.get('debugLevel') >= 2:
|
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, str))
|
||||||
syslog.syslog("mail from: {0} {1}".format(f, stri))
|
|
||||||
self.fp = io.BytesIO()
|
self.fp = io.BytesIO()
|
||||||
self.mailfrom = f
|
self.mailfrom = f
|
||||||
t = parse_addr(f)
|
t = parse_addr(f)
|
||||||
@@ -134,8 +133,7 @@ class dkimMilter(Milter.Base):
|
|||||||
if lname == 'dkim-signature':
|
if lname == 'dkim-signature':
|
||||||
if (self.conf.get('Syslog') and
|
if (self.conf.get('Syslog') and
|
||||||
self.conf.get('debugLevel') >= 1):
|
self.conf.get('debugLevel') >= 1):
|
||||||
val2 = str(bytes(val, encoding='utf-8', errors='replace'))[2:-1]
|
syslog.syslog("{0}: {1}".format(name, val))
|
||||||
syslog.syslog("{0}: {1}".format(name, val2))
|
|
||||||
self.has_dkim += 1
|
self.has_dkim += 1
|
||||||
if lname == 'from':
|
if lname == 'from':
|
||||||
fname, self.author = parseaddr(val)
|
fname, self.author = parseaddr(val)
|
||||||
@@ -145,8 +143,7 @@ class dkimMilter(Milter.Base):
|
|||||||
pass # self.author was not a proper email address
|
pass # self.author was not a proper email address
|
||||||
if (self.conf.get('Syslog') and
|
if (self.conf.get('Syslog') and
|
||||||
self.conf.get('debugLevel') >= 1):
|
self.conf.get('debugLevel') >= 1):
|
||||||
val2 = str(bytes(val, encoding='utf-8', errors='replace'))[2:-1]
|
syslog.syslog("{0}: {1}".format(name, val))
|
||||||
syslog.syslog("{0}: {1}".format(name, val2))
|
|
||||||
elif lname == 'authentication-results':
|
elif lname == 'authentication-results':
|
||||||
self.arheaders.append(val)
|
self.arheaders.append(val)
|
||||||
if self.fp:
|
if self.fp:
|
||||||
@@ -184,8 +181,7 @@ class dkimMilter(Milter.Base):
|
|||||||
self.chgheader('authentication-results', i, '')
|
self.chgheader('authentication-results', i, '')
|
||||||
if (self.conf.get('Syslog') and
|
if (self.conf.get('Syslog') and
|
||||||
self.conf.get('debugLevel') >= 1):
|
self.conf.get('debugLevel') >= 1):
|
||||||
val2 = str(bytes(val, encoding='utf-8', errors='replace'))[2:-1]
|
syslog.syslog('REMOVE: {0}'.format(val))
|
||||||
syslog.syslog('REMOVE: {0}'.format(val2))
|
|
||||||
except:
|
except:
|
||||||
# Don't error out on unparseable AR header fiels
|
# Don't error out on unparseable AR header fiels
|
||||||
pass
|
pass
|
||||||
@@ -432,8 +428,7 @@ class dkimMilter(Milter.Base):
|
|||||||
if self.conf.get('Syslog'):
|
if self.conf.get('Syslog'):
|
||||||
if d.domain:
|
if d.domain:
|
||||||
syslog.syslog('DKIM: Fail ({0})'
|
syslog.syslog('DKIM: Fail ({0})'
|
||||||
.format(str(d.domain.lower(), 'UTF-8',
|
.format(d.domain.lower()))
|
||||||
errors='replace')))
|
|
||||||
else:
|
else:
|
||||||
syslog.syslog('DKIM: Fail, unextractable domain')
|
syslog.syslog('DKIM: Fail, unextractable domain')
|
||||||
if res:
|
if res:
|
||||||
@@ -443,13 +438,13 @@ class dkimMilter(Milter.Base):
|
|||||||
res = False
|
res = False
|
||||||
if self.header_d:
|
if self.header_d:
|
||||||
self.arresults.append(
|
self.arresults.append(
|
||||||
authres.DKIMAuthenticationResult(result=result[2:-1],
|
authres.DKIMAuthenticationResult(result=result,
|
||||||
header_i=self.header_i,
|
header_i=self.header_i,
|
||||||
header_d=self.header_d,
|
header_d=self.header_d,
|
||||||
header_a=self.header_a,
|
header_a=self.header_a,
|
||||||
result_comment=
|
result_comment=
|
||||||
self.dkim_comment)
|
self.dkim_comment)
|
||||||
)
|
)
|
||||||
self.header_a = None
|
self.header_a = None
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ except ImportError: # If PyDNS is not installed, prefer dnspython
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='dkimpy-milter',
|
name='dkimpy-milter',
|
||||||
version='1.2.1',
|
version='1.2.2',
|
||||||
author='Scott Kitterman',
|
author='Scott Kitterman',
|
||||||
author_email='scott@kitterman.com',
|
author_email='scott@kitterman.com',
|
||||||
url='https://launchpad.net/dkimpy-milter',
|
url='https://launchpad.net/dkimpy-milter',
|
||||||
|
|||||||
Reference in New Issue
Block a user