aboutsummaryrefslogtreecommitdiffstats
path: root/archivemail.py
diff options
context:
space:
mode:
authorPaul Rodger <paul@paulrodger.com>2002-08-18 12:17:56 +0000
committerPaul Rodger <paul@paulrodger.com>2002-08-18 12:17:56 +0000
commit5264ab35cdf5c3f0aca660f3d5e3ed52290e6007 (patch)
tree83f809ed090f30924e157e79fd94610957206fe0 /archivemail.py
parent604e11428f16fe5696bac15ae6cdd7158f52b397 (diff)
downloadarchivemail-5264ab35cdf5c3f0aca660f3d5e3ed52290e6007.tar.gz
archivemail-5264ab35cdf5c3f0aca660f3d5e3ed52290e6007.tar.bz2
archivemail-5264ab35cdf5c3f0aca660f3d5e3ed52290e6007.zip
Fixed a bug where we would throw an exception if a message was dated
exactly on the unix epoch. Also fixed a bug where trailing slashes were being passed to the archive file name.
Diffstat (limited to 'archivemail.py')
-rwxr-xr-xarchivemail.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/archivemail.py b/archivemail.py
index d82892e..a9c882a 100755
--- a/archivemail.py
+++ b/archivemail.py
@@ -22,7 +22,7 @@ Website: http://archivemail.sourceforge.net/
"""
# global administrivia
-__version__ = "archivemail v0.4.8"
+__version__ = "archivemail v0.4.9"
__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
@@ -679,7 +679,6 @@ def guess_delivery_time(message):
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 (IndexError, ValueError, OverflowError): pass
@@ -915,6 +914,12 @@ def archive(mailbox_name):
"""
assert(mailbox_name)
+ # strip any trailing slash (we could be archiving a maildir or MH format
+ # mailbox and somebody was pressing <tab> in bash) - we don't want to use
+ # the trailing slash in the archive name
+ mailbox_name = re.sub("/$", "", mailbox_name)
+ assert(mailbox_name)
+
set_signal_handlers()
os.umask(077) # saves setting permissions on mailboxes/tempfiles