aboutsummaryrefslogtreecommitdiffstats
path: root/archivemail.py
diff options
context:
space:
mode:
authorPaul Rodger <paul@paulrodger.com>2002-05-07 12:14:29 +0000
committerPaul Rodger <paul@paulrodger.com>2002-05-07 12:14:29 +0000
commit7c8b58dea309e334dc67c34c4758ac318107cd18 (patch)
treea9fc672f20c9b1dd79be0cb6b917b50d6dde6aa1 /archivemail.py
parente4adb7b2228533cde7936b44b5d61e422c81bb6b (diff)
downloadarchivemail-7c8b58dea309e334dc67c34c4758ac318107cd18.tar.gz
archivemail-7c8b58dea309e334dc67c34c4758ac318107cd18.tar.bz2
archivemail-7c8b58dea309e334dc67c34c4758ac318107cd18.zip
Fixed a bug where archivemail would abort if it got a date header
with a completely blank value.
Diffstat (limited to 'archivemail.py')
-rwxr-xr-xarchivemail.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/archivemail.py b/archivemail.py
index 8020e89..dd19e0d 100755
--- a/archivemail.py
+++ b/archivemail.py
@@ -22,7 +22,7 @@ Website: http://archivemail.sourceforge.net/
"""
# global administrivia
-__version__ = "archivemail v0.4.6"
+__version__ = "archivemail v0.4.7"
__cvs_id__ = "$Id$"
__copyright__ = """Copyright (C) 2002 Paul Rodger <paul@paulrodger.com>
This is free software; see the source for copying conditions. There is NO
@@ -670,14 +670,14 @@ def guess_delivery_time(message):
# try to guess the delivery date from various headers
# get more desparate as we go through the array
for header in ('Delivery-date', 'Date', 'Resent-Date'):
- date = message.getdate(header)
- if date:
- try:
+ try:
+ date = message.getdate(header)
+ if date:
time_message = time.mktime(date)
assert(time_message)
vprint("using valid time found from '%s' header" % header)
return time_message
- except (ValueError, OverflowError): pass
+ except (IndexError, ValueError, OverflowError): pass
# as a second-last resort, try the date from the 'From_' line (ugly)
# this will only work from a mbox-format mailbox
if (message.unixfrom):