Introduction
In another blog entry I posted hints, tips and tricks for running Mutt on OS X. BBEdit factors prominently in this mail workflow. It’s my editor for replies and such, and piping a message into BBEdit means various useful tools are in my reach
From the BBEdit side
Install the email package
The email package for BBEdit provides a language module for email. This provides some color coding for replies and headers.
It also provides some Applescripts to make email composing easier. BBEdit has some great tools itself, but I’ve added a few extra tools.
Set up BBEdit to use the email package
BBEdit’s Language Preferences let you set up prefixes, in addition to suffixes (like the interface makes you think). Set up your Custom Extension Mappings to associate the “suffix” “mutt-*” with the Email language module (from the Email package).
Cool tricks from the BBEdit Email Package
Why should I install the email package? Some cool utilities in the package include:
- View HTML from Email: dealing with a message that’s in HTML (and might not have a plain text component?) This script extracts the HTML part of the message and displays it in your default browser.
- Get Email for Name: the script isn’t perfect, but it’ll try to find - and insert - the email address for the selected text in BBEdit (which it assumes is someone’s name)
- Delete until .sig: finish your reply, and now want to delete everything from your cursor to your .sig line? That’s what this script is for :)
From the Command line side
On the command line side, you may want to install some tools to make your life better:
Searching through messages (with BBEdit)
Something I miss from my previous client is excellent search abilities. Mutt’s quick search (the / key) seems to search only headers.
To solve this problem I wrote a simple shell script:
#!/bin/sh
bbfind '$1' --gui ~/Mail/$2.mbox
I named this shell script mail_grep and call it like:
mail_grep "Ryan, come here I need you" INBOX
Which will search for the phrase “Ryan, come here I need you”, in INBOX.mbox.
The --gui flag shows the results in the Search Results window in BBEdit. Using the Search Results window lets me go right to the text in question, and see the rest of the saved mail message quicker than a command line grep.
Open referenced messages (in BBEdit)
Messages I sent are placed in the [Gmail]/Sent Mail folder (this is half due to the Gmail centric setup article I stared Mutt with, and half because a single “outgoing” mailbox is what I’ve used in the past.)
However, I have a problem: I’m reading a message in Mutt, and realize I need to reference something else that was said, by me, in the email thread.
Because I said it, the text is probably in the Sent Mail folder. (And because I’m conversing with someone who trims their email replies, that text is not in this email).
So I wrote a script to bring up the referenced message in BBEdit, via the bbfind command line tool. In Mutt I can pipe my current message to this script, and bingo.
Find the script at: mutt_open_origin.