"Mutt is a fine command-line email client, but it lags Evolution and Thunderbird in its ability to do email filtering. The procmail mail processing utility can help. It is highly configurable, allows for far better email filtering than Thunderbird, and as is customary with command-line applications, it is fast. While procmail is most commonly employed on the server side, its ability to handle POP and IMAP protocols makes it useful for desktop users as well.
"Procmail is a Mail Delivery Agent (MDA), meaning it can be used along with a Mail Transfer Agent (MTA) such as mutt or sendmail to filter messages..."