Sometimes I want to send a colleague a bunch of emails (for example, all
the emails I've tagged todo or all the emails from an awesome
contributor.  Although notmuch usually speaks the language of maildirs,
I find mboxes most convenient for attaching to emails.  Their tools can
usually handle it well.

I've put a bit of elisp and python up:
https://github.com/jvasile/notmuch2mbox

The python's help screen:

> Usage: 
> notmuch2mbox.py [options] [search terms]
>
> This program uses notmuch to search for the search terms, then outputs
> any found emails in mbox format.
> 
> 
> Options:
>   -h, --help            show this help message and exit
>   -n NOTMUCH, --notmuch=NOTMUCH
>                         Path to notmuch binary.
>   -o OUTFILE, --outfile=OUTFILE
>                         Write mbox to specified path instead of stdout

The python script does a search and spits out an mbox containing
anything it finds in that search.  The emacs function performs that task
on the current search, saving the result to a file, which you can attach
to an email, open in mutt or whatever.  The elisp is in the starting
comments to the python.

I hope this is useful to somebody.  It does the trick for me in working
with mbox-dependent colleagues (e.g. mutt users).  I prefer mutt's
threaded view to notmuch's conversation view, so I've used it to browse
emails too.

Regards,
James

Reply via email to