Filtering Unwanted E-mail in Mutt Using VT Mail
Time to Complete (in minutes):  5

Question:
How do I create a rule in Mutt that will filter unwanted e-mail messages from my VT Mail account?
Answer:

The Virginia Tech mail servers tag all incoming e-mail that they suspect to be unsolicited messages (also known as spam) with a special header string beginning with "X-Junkmail" or "X-JunkMail". Mutt does not have a rule function that will automatically route e-mail messages--that function is usually performed by procmail. Procmail is typically installed by default in most Linux distributions. See your system administrator for more information.

As a workaround, you can configure Mutt to change the color of headers in messages containing "X-Junkmail" and "X-JunkMail". This will allow you to easily identify unwanted e-mail messages and delete them. To do this:
  1. Open the .muttrc file.
  2. Copy and paste the following text to the .muttrc file:
    # flagged as spam
        color index blue black "~h 'X-Junkmail: UCE([0-9]*)'"
        color index blue black "~h 'X-Junkmail: Blacklisted)'"
        color index blue black "~h 'X-Junkmail: RBL)'"
    # unset whitelist
        color index default black "~h 'X-Junkmail-Whitelisted: yes'"
For more information information on changing the color of message headers, see the Using Color and Mono Video Attributes section of the Mutt documentation(http://www.mutt.org/doc/manual/manual-3.html#ss3.7).