WIP for invalid UTF-8 resilience
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
1.2.2
|
1.3.0 WARNING LAST COMMIT IS WIP
|
||||||
- Improve resilience to malformed email addresses
|
- Improve resilience to malformed email addresses
|
||||||
- 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,9 +107,11 @@ 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, *str):
|
def envfrom(self, f, *moredata):
|
||||||
|
f = str(codecs.encode(f, 'UTF-8', 'replace'), 'UTF-8', 'ignore')
|
||||||
|
moredata = str(codecs.encode(str(moredata), 'UTF-8', 'replace'), 'UTF-8', 'ignore')
|
||||||
if self.conf.get('Syslog') and self.conf.get('debugLevel') >= 2:
|
if self.conf.get('Syslog') and self.conf.get('debugLevel') >= 2:
|
||||||
syslog.syslog("mail from: {0} {1}".format(f, str))
|
syslog.syslog("mail from: {0} {1}".format(f, moredata))
|
||||||
self.fp = io.BytesIO()
|
self.fp = io.BytesIO()
|
||||||
self.mailfrom = f
|
self.mailfrom = f
|
||||||
t = parse_addr(f)
|
t = parse_addr(f)
|
||||||
|
|||||||
@@ -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.3.0',
|
||||||
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',
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function connect_and_send (sockname, headers, body)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- mt.macro(conn, SMFIC_MAIL, "i", "simple-message")
|
-- mt.macro(conn, SMFIC_MAIL, "i", "simple-message")
|
||||||
if mt.mailfrom(conn, "<alice@example.net>") ~= nil then
|
if mt.mailfrom(conn, "<alicüe@example.net> (Alicþþÿÿe)") ~= nil then
|
||||||
error "mt.mailfrom() failed"
|
error "mt.mailfrom() failed"
|
||||||
end
|
end
|
||||||
if mt.getreply(conn) ~= SMFIR_CONTINUE then
|
if mt.getreply(conn) ~= SMFIR_CONTINUE then
|
||||||
|
|||||||
Reference in New Issue
Block a user