I use mutt as my email reader or mail user agent, MUA. I'm getting mail from countries that have no business addressing me. Examples: China .cn, Russia .ru, Argentina .ar. I want to mark all messages for deletion by searching the bodies of the messages for any reference to those country-code top-level domains, but I'm having problems crafting a regexp. I have tried ~B\.ar and ~B'.ar' (using Argentina as an example) but these seem to not be properly interpreting my attempt to specify a period.

2 Answers 2


According to the mutt Advanced Usage manual Patterns:

~B EXPR messages which contain EXPR in the whole message

There needs to be a space between the ~B and the EXPR.

I would suggest trying:

~B \.ar$

Which will match any word that ends in .ar in the whole message.


Search patterns use regex, so .ar would match kar, xar, etc. Use \.ar to specify (escape) the period.

I suggest searching using ~f \.ar, which will match .ar addresses in the From field, which is more specific than using ~B, which searches both the header and the entire message.

Other useful patterns:

  • ~e: Matches in the Sender field.
  • ~L: Matches "messages either originated or received by"
  • ~s: Matches the subject.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .