I’ve been a longtime mutt user, but have gotten somewhat annoyed of having to open a new terminal when I want to read or reply to a Debian bug with mutt (using ‘bts show 123456’). How nice it would be to be able to fetch a bug report from within mutt! And so, ladies and gentlemen, I present to you mutt-fetchbug. It’s extensively based on Zack’s mutt-notmuch script (a nice interface between mutt and notmuch for searching mail, I highly recommend it).

By adding a line like the following to your ~/.muttrc, you can simply press “F7” and enter a bug number from your mutt index in order to fetch and display a bug report’s mbox file:

macro index <F7> \
    "<enter-command>unset wait_key<enter><shell-escape>~/bin/mutt-fetchbug --prompt search<enter><change-folder-readonly>~/.cache/mutt_btsresults<enter><enter-command>set wait_key<enter>" \
    "fetch bug(s) (using bts show)"

The above presupposes you’ve downloaded mutt-fetchbug and placed it with executable permissions in ~/bin.

Those interested in making improvements or extending mutt-fetchbug are more than welcome to do so, it’s licensed under the GPLv3+. It can be fetched from my git branch.

Update: Fixed the broken link to mutt-fetchbug, thanks Christian for the heads up.