Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.