# Description: add and document --archive-name option # Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=247340 # Author: Serafeim Zanikolas # Last-Update: 2008-08-15 Index: archivemail/archivemail =================================================================== --- archivemail.orig/archivemail 2008-08-15 20:38:03.000000000 +0100 +++ archivemail/archivemail 2008-08-15 21:39:57.000000000 +0100 @@ -172,6 +172,7 @@ class Options: """Class to store runtime options, including defaults""" archive_suffix = "_archive" + archive_name = None days_old_max = 180 date_old_max = None delete_old_mail = 0 @@ -210,6 +211,7 @@ opts, args = getopt.getopt(args, '?D:S:Vd:hno:F:P:qs:uv', ["date=", "days=", "delete", "dry-run", "help", "include-flagged", "no-compress", "output-dir=", + "archive-name=", "filter-append=", "pwfile=", "dont-mangle", "preserve-unread", "quiet", "size=", "suffix=", "verbose", "version", "warn-duplicate", "copy"]) @@ -262,6 +264,8 @@ self.mangle_from = 0 if o in ('-v', '--verbose'): self.verbose = 1 + if o in ('--archive-name'): + self.archive_name = os.path.expanduser(a) if o == '--copy': if self.delete_old_mail: user_error("found conflicting options --copy and --delete") @@ -663,6 +667,8 @@ -P, --pwfile=FILE file to read imap password from (default: None) -F, --filter-append=STRING append arbitrary string to the IMAP filter string -s, --suffix=NAME suffix for archive filename (default: '%s') + --archive-name=NAME specify whole archive filename, overrides prefix + and suffix -S, --size=NUM only archive messages NUM bytes or larger -n, --dry-run don't write to anything - just show what would be done -u, --preserve-unread never archive unread messages @@ -1102,6 +1108,8 @@ final_archive_name = mailbox_name.split('/')[-1] + parsed_suffix else: final_archive_name = mailbox_name + parsed_suffix + if options.archive_name: + final_archive_name = options.archive_name if options.output_dir: final_archive_name = os.path.join(options.output_dir, os.path.basename(final_archive_name)) Index: archivemail/archivemail.sgml =================================================================== --- archivemail.orig/archivemail.sgml 2008-08-15 20:38:03.000000000 +0100 +++ archivemail/archivemail.sgml 2008-08-15 21:38:49.000000000 +0100 @@ -238,6 +238,15 @@ + + + +Specify whole archive filename, overrides prefix and suffix. + + + + + Only archive messages that are