diff options
author | Paul Rodger <paul@paulrodger.com> | 2002-11-21 22:57:13 +0000 |
---|---|---|
committer | Paul Rodger <paul@paulrodger.com> | 2002-11-21 22:57:13 +0000 |
commit | 64d87da3071c6c991e379c2c2221c264cb17fbdb (patch) | |
tree | 14defb3290ee7fcb7e5597ebfa71886f894b3668 /archivemail.py | |
parent | 60f119d64a855895fc1309e3756568727293faef (diff) | |
download | archivemail-64d87da3071c6c991e379c2c2221c264cb17fbdb.tar.gz archivemail-64d87da3071c6c991e379c2c2221c264cb17fbdb.tar.bz2 archivemail-64d87da3071c6c991e379c2c2221c264cb17fbdb.zip |
Use the archive cut-off date rather than the current time with the
--suffix option.
Diffstat (limited to 'archivemail.py')
-rwxr-xr-x | archivemail.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/archivemail.py b/archivemail.py index e8f3aab..87fc33b 100755 --- a/archivemail.py +++ b/archivemail.py @@ -993,8 +993,13 @@ def archive(mailbox_name): os.umask(077) # saves setting permissions on mailboxes/tempfiles # allow the user to embed time formats such as '%B' in the suffix string + if options.date_old_max == None: + parsed_suffix_time = time.time() - options.days_old_max*24*60*60 + else: + parsed_suffix_time = options.date_old_max + parsed_suffix = time.strftime(options.archive_suffix, - time.localtime(time.time())) + time.localtime(parsed_suffix_time)) if mailbox_name[:7].lower() == 'imap://': final_archive_name = mailbox_name.split('/')[-1] + parsed_suffix |