Skip to main content

mutt tips & tricks

I've been using mutt with offlineimap and msmtp (dead link, coming soon.) for a while now, and I want to use this post to collect some features and tips that I've found myself often searching for.

  1. Finding messages in the current folder
  2. Tagging messages and doing bulk actions
  3. Changing the filename of the PGP signature attachment
  4. "From"-specific signatures

Finding messages in the current folder

The default keybinding for searching the current folder is l. After you've entered search/limiting mode, you can use a wide variety of combinations of flags and regular expressions to match messages:

Note that limiting only matches the subject and the sender's name by default.

Common flags

~N New/unread messages

~F Flagged messages

~B Search the whole message, not only subject and sender's name

~A All messages (you can also use all)

See the official mutt documentation for a full list of available patterns.

Tagging messages

A common thing to do is to tag/mark all messages meeting certain criterias. This is very easy to do in mutt using the tag-pattern function. By default, this function is bound to T (that's shift+t). You can then use the same flags and regular expressions as you can when limiting messages.

tag-pattern only selects messages in the current folder/mailbox

After tagging messages, you'll most likely want to do something with them. This is where the tag-prefix operator comes into play. This operator tells mutt to apply the next operation to all tagged messages. The default keybinding for tag-prefix is ; (semicolon).

Here's an example of how to tag all unread messages and mark them as read:

T # Invokes the tag-pattern function
~N # Tags all unread messages
; # tag-prefix operator, next operation will be applied to all tagged messages
W # Clear flag
N # Clear the N (unread) flag

Untagging messages

In the beginning I often found myself searching for how to untag messages. It can be done the same as you tag messages, except that you have to use CTRL instead of SHIFT: ^t <pattern>. To untag all messages, type ^t all.

Changing the PGP signature attachment's filename

When using mutt with PGP, the default filename of the signature attachment is noname. Although this is a commonly used filename, I personally want it to be named signature.asc. To be able to do this, you'll need to install mutt with the pgp-verbose-mime-patch. I've covered how to install mutt on Mac OS X with this patch in the post My mutt setup (dead link, coming soon).

After you've installed mutt with this patch, it's very simple to change the signature attachment's filename. All you have to do is add the following line to your .muttrc:

set pgp_mime_signature_filename = 'signature.asc'

"From"-specific signatures

I have different email addresses based on what "role" I have. One (with several aliases) is for personal stuff, one is for work related stuff and one is for my freelance company. I'd like mutt to change my signature based on which address I send the email from. This is also fairly easy to accomplish. Just add the following line to .muttrc for each account you would like a specific signature for:

send-hook "~f from@address1.com" 'set signature=~/.mutt/signature_for_address1'

This will tell mutt that "whenever I send a message from from@address1.com, use the signature in the file ~/.mutt/signature_for_address1".

That's it for now. I'll continue to add useful mutt tips to this post.

Next steps

Here are a few things you can do:

2026

September

  • Note

    As quite evident by looking at my brand new reading page, I haven't read very much this year. Going forward I will do my very best to finish the books I'm currently reading and find some new exciting books to read. Currently only finished three, the goal is 10!

  • Note

    I just ordered a Fairphone 6+, Fairbuds and Fairbuds XL.

    I have an iPhone 17 as my daily driver, but I couldn't help but order this phone and headsets once I became aware it was a thing.

    My plan is to switch to all of these things, replacing my iPhone 17, AirPods Pro 3 and Bose QuietComfort Ultra. These will either be sold or given to someone who needs them.

    The initiative is great and their values even better. We need companies trying to counter the enormous pressure laid upon all of us to keep buying stuff all the time.

    I will post a thorough review of these items once I've used them for a while.

  • Tømmerneset rock carvings

2025

April

  • Note

    I will be posting changes to my website simply as notes tagged with changelog. This is the very first changelog of this site, and it summarizes the most important changes I've done since I started wiping the dust of this site in April this year.

    • I've added a Buttondown newsletter integration. Whenever I publish a new post on my blog, an email will be sent to my subscribers.
    • I've added a «Reply by email» button to all content. Do not hestitate to contact me if you have comments or feedback. Getting feedback is a big part of why I blog in the first place — I enjoy hearing from readers and being part of a thoughtful exchange now and then.
    • I've added a Search feature using Pagefind. It's not yet fully configured or customized, but it's working.
    • Added links to previous and next post, note and link.
    • Added a 404 page.
    • Reduced the size of uncompressed resources being loaded on the front page to 66 kB. Submitted a PR to be added to the 512kb.club website.
  • Our dog: Kento
  • Note

    This is the very first note on my new website. It's a GREAT note.

    It doesn't say much, but still – it marks the beginning of a new note-hosting era for this website.

  • Back to basics – again..