summaryrefslogtreecommitdiff
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
parenteb46ea661857465629e06e4ca3527a38de3aeea7 (diff)
downloadmailscripts-b0aa9fc4b5d6fffda94e68a8e21b337789d117fa.tar.gz
mbox2maildir: acquire a lock, and flush after copying all messages
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--debian/changelog8
-rw-r--r--mailscripts.el2
-rwxr-xr-xmbox2maildir2
3 files changed, 11 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 41d4180..067f965 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+mailscripts (0.8-1) UNRELEASED; urgency=medium
+
+ * mbox2maildir: acquire a lock before touching the Maildir, and be sure
+ to flush after copying messages.
+ Per the docs for Python's mailbox module.
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Fri, 03 May 2019 21:08:09 -0700
+
mailscripts (0.7-1) unstable; urgency=high
* notmuch-slurp-debbug: Fix the --bts-server argument.
diff --git a/mailscripts.el b/mailscripts.el
index c68f7a9..2ab871c 100644
--- a/mailscripts.el
+++ b/mailscripts.el
@@ -1,7 +1,7 @@
;;; mailscripts.el --- functions to access tools in the mailscripts package
;; Author: Sean Whitton <spwhitton@spwhitton.name>
-;; Version: 0.7
+;; Version: 0.8
;; Package-Requires: (notmuch)
;; Copyright (C) 2018 Sean Whitton
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()