From 64d87da3071c6c991e379c2c2221c264cb17fbdb Mon Sep 17 00:00:00 2001 From: Paul Rodger Date: Thu, 21 Nov 2002 22:57:13 +0000 Subject: Use the archive cut-off date rather than the current time with the --suffix option. --- archivemail.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'archivemail.py') 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 -- cgit v1.2.3