- Added protection for malformed From addresses. If the From does not at

least have an '@' in the address, then the signing domain is not extracted
   and the message will not be signed
This commit is contained in:
Scott Kitterman
2018-03-15 20:42:49 -04:00
parent 7a3a7bfb43
commit f9483fea8c
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -130,7 +130,10 @@ class dkimMilter(Milter.Base):
self.has_dkim += 1
if lname == 'from':
fname, self.author = parseaddr(val)
self.fdomain = self.author.split('@')[1]
try:
self.fdomain = self.author.split('@')[1]
except IndexError as er:
self.fdomain = '' # self.author was not a proper email address
if (milterconfig.get('Syslog') and
milterconfig.get('debugLevel') >= 1):
syslog.syslog("{0}: {1}".format(name, val))