Skip to content
Snippets Groups Projects
Commit a01c5d31 authored by Stuart Gathman's avatar Stuart Gathman
Browse files

Ignore HeaderParseError decoding header

parent 493741c8
Branches
Tags
No related merge requests found
#!/usr/bin/env python
# A simple milter that has grown quite a bit.
# $Log$
# Revision 1.9 2005/06/14 21:55:29 customdesigned
# Check internal_domains for outgoing mail.
#
# Revision 1.8 2005/06/06 18:24:59 customdesigned
# Properly log exceptions from pydspam
#
......@@ -460,9 +463,9 @@ def parse_addr(t):
return t.split('@')
def parse_header(val):
try:
h = decode_header(val)
if not len(h) or (not h[0][1] and len(h) == 1): return val
try:
u = []
for s,enc in h:
if enc:
......@@ -479,6 +482,7 @@ def parse_header(val):
except UnicodeError: continue
except UnicodeDecodeError: pass
except LookupError: pass
except email.errors.HeaderParseError: pass
return val
class bmsMilter(Milter.Milter):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment