From 5264ab35cdf5c3f0aca660f3d5e3ed52290e6007 Mon Sep 17 00:00:00 2001 From: Paul Rodger Date: Sun, 18 Aug 2002 12:17:56 +0000 Subject: 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. --- archivemail.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'archivemail.py') 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 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 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 -- cgit v1.2.3