aboutsummaryrefslogtreecommitdiffstats
path: root/archivemail
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2010-07-31 15:35:31 +0200
committerNikolaus Schulz <microschulz@web.de>2010-07-31 20:49:29 +0200
commitf1f34ca46e9ea81e85d6728cb7c74cb815860cca (patch)
treed0a05b14ad686b4f991ccb70af055b6fdad3ed52 /archivemail
parent67f23e1af4a9adc43aea08790c4d3b349c75297d (diff)
downloadarchivemail-f1f34ca46e9ea81e85d6728cb7c74cb815860cca.tar.gz
archivemail-f1f34ca46e9ea81e85d6728cb7c74cb815860cca.tar.bz2
archivemail-f1f34ca46e9ea81e85d6728cb7c74cb815860cca.zip
Don't create hidden archives when archiving mailboxes with leading dots in the name
When archiving a mailbox with leading dots in the name and no archive name prefix specified, strip the dots off the archive name. This is targeting Maildir++ subfolders.
Diffstat (limited to 'archivemail')
-rwxr-xr-xarchivemail3
1 files changed, 3 insertions, 0 deletions
diff --git a/archivemail b/archivemail
index 2ca862f..92faa2a 100755
--- a/archivemail
+++ b/archivemail
@@ -1649,6 +1649,9 @@ def make_archive_name(mailbox_name):
archive_base = mailbox_name.rsplit('/', 1)[-1]
else:
archive_dir, archive_base = os.path.split(mailbox_name)
+ if not prefix:
+ # Don't create hidden archives, e.g. when processing Maildir++ subfolders
+ archive_base = archive_base.lstrip('.')
if options.output_dir:
archive_dir = options.output_dir
archive_name = os.path.join(archive_dir, prefix + archive_base + suffix)