aboutsummaryrefslogtreecommitdiff
path: root/b4/mbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'b4/mbox.py')
-rw-r--r--b4/mbox.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/b4/mbox.py b/b4/mbox.py
index f34b887..e9a2ab2 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -511,7 +511,14 @@ def main(cmdargs):
return
else:
if os.path.exists(cmdargs.localmbox):
- threadmbox = cmdargs.localmbox
+ msgid = b4.get_msgid(cmdargs)
+ if os.path.isdir(cmdargs.localmbox):
+ in_mbx = mailbox.Maildir(cmdargs.localmbox)
+ else:
+ in_mbx = mailbox.mbox(cmdargs.localmbox)
+ out_mbx = mailbox.mbox(savefile)
+ b4.save_strict_thread(in_mbx, out_mbx, msgid)
+ threadmbox = savefile
else:
logger.critical('Mailbox %s does not exist', cmdargs.localmbox)
os.unlink(savefile)