Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I get a lot automated e-mail alerts, and I would like to be able to configure mutt to remove the new message flag (N) from new messages received from specific senders. Basically, I don't want to have to manually press 'N' on hundreds of auto-generated messages in my inbox, so the N flag will be meaningful again.

My intuition tells me to use message-hook in the .muttrc file, and this is what I have so far, but it doesn't seem to do anything:

 message-hook '~f \"automation-account@domain.com\"' 'push "N"'
share|improve this question
up vote 1 down vote accepted

A message-hook would only apply when you go to view a message which matches the pattern. Once you do that, the N flag would be removed automatically so that isn't likely to be helpful. Mutt doesn't have support for modifying messages as they come in, that would need to be done by whatever you have that delivers messages into your mailbox.

The closest that you could come in mutt would be to use a macro or folder hook to execute the commands to tag matching messages and then remove the new flag. Something like:

macro index G "<tag-prefix-cond><tag-message><end-cond><tag-pattern>~f automation-account@domain.com\n<tag-prefix-cond><clear-flag>N"

The part before <tag-pattern> is to ensure that it doesn't apply to any messages which had previously been tagged.

A similar command string could be used with the push command in a folder-hook to automatically do that when you first open a folder.

share|improve this answer

You must log in to answer this question.

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