summaryrefslogtreecommitdiff
path: root/mbox2maildir
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-05-03 21:08:09 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-05-03 21:51:41 -0700
commitb0aa9fc4b5d6fffda94e68a8e21b337789d117fa (patch)
tree1949b5034cd5a5d38d2225ae8ba86a5f8987fbdb /mbox2maildir
parenteb46ea661857465629e06e4ca3527a38de3aeea7 (diff)
downloadmailscripts-b0aa9fc4b5d6fffda94e68a8e21b337789d117fa.tar.gz
mbox2maildir: acquire a lock, and flush after copying all messages
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'mbox2maildir')
-rwxr-xr-xmbox2maildir2
1 files changed, 2 insertions, 0 deletions
diff --git a/mbox2maildir b/mbox2maildir
index 25f68df..351a37c 100755
--- a/mbox2maildir
+++ b/mbox2maildir
@@ -42,5 +42,7 @@ dest_path = sys.argv[2]
source = mailbox.mbox(source_path)
dest = mailbox.Maildir(dest_path)
+dest.lock()
for message in source:
dest.add(message)
+dest.close()