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

Delete unparseable timestamps when loading address cache. These have

arisen because of failure to parse MAIL FROM properly.   Will have to
tighten up MAIL FROM parsing to match RFC.
parent 021ea967
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,9 @@
# CBV results.
#
# $Log$
# Revision 1.7 2007/01/25 22:47:26 customdesigned
# Persist blacklisting from delayed DSNs.
#
# Revision 1.6 2007/01/19 23:31:38 customdesigned
# Move parse_header to Milter.utils.
# Test case for delayed DSN parsing.
......@@ -66,13 +69,17 @@ class AddrCache(object):
for ln in fp:
try:
rcpt,ts = ln.strip().split(None,1)
try:
l = time.strptime(ts,AddrCache.time_format)
t = time.mktime(l)
if t < too_old:
changed = True
continue
cache[rcpt.lower()] = (t,None)
except:
except: # unparsable timestamp - likely garbage
changed = True
continue
except: # manual entry (no timestamp)
cache[ln.strip().lower()] = (now,None)
wfp.write(ln)
if changed:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment