Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions vrfydmn
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,21 @@ class VrfyDmnMilter(Milter.Base):
else:
hval = "from"

# Messages may carry neither a From: nor a Sender: header (e.g.
# message-id=<>, common in spam and bounces). In that case the key
# was never populated by the header() callback, so looking it up
# would raise KeyError inside the milter callback. With no header
# there is no domain to verify, so skip the mail, mirroring the
# "<>"/empty-address skip path below.
if hval not in self.__header:
if config.debug:
print("id=%i %s unhandled=<no %s header> return_value=skip"
% (self.__id, self.getsymval('i'), hval))
syslog(LOG_INFO, "%s: unhandled=<no %s header> return_value=skip"
% (self.getsymval('i'), hval))

return Milter.CONTINUE

# Extract email from most right tuple
decoded_from = decode_header(self.__header[hval])[-1]

Expand Down