Attaching messages to outgoing mail in mutt

When I want to forward an email to someone as an attachment (usually because I want them to reply to it without having to snip gunky forward ‘headers’ in the body and preserving Message-ID and such) I can’t always forward-as-attachment, sometimes because I’m replying rather than starting a new mail, sometimes because I’m forwarding messages from multiple folders.

Up until today, I’ve resorted to all kinds of tricks to add other messages as attachments to mutt messages. One old favourite was copying them (shift+c) to a new maildir, attaching the individual files and manually setting their MIME type to message/rfc822. This does actually work but there is an easier way, the attach-message function, bound to shift+a by default.

On the screen where you normally add attachments, press shift+a. Navigate to the folder containing the messages you wish to attach (if they’re in different folders, just do this once per folder). Tag all the messages you want to attach (the default keybinding for tagging a message is ‘t’). Quit from the folder browser (‘q’). All tagged messages will be attached to the outgoing mail.