<<< Date Index >>>     <<< Thread Index >>>

Re: Recommended mail filters for use with mutt?



Quoting Chris G (cl@xxxxxxxx):

> What do others here use, any recommendations that I might find useful?

> Oh, one other requirement, it needs to be driven from the .forward
> file,

Seems like you're on a system running a recent version of Exim:
| Received: from isbd by th-shell-1.gradwell.net with local (Exim 4.63)

You could use 'Exim filters' and have Exim do the work for you.

An 'Exim filter' is just a .forward file with '# Exim filter' on the
first line followed by a number of rules to sort mail around. It's
kind-of like Sieve, so i hear, but i'm not at all a Sieve expert.

These are really clear docs on the subject:
  http://exim.org/exim-html-current/doc/html/filter.html

And these are a few pieces of my .forward file to give you an idea:

| # Exim filter
| 
| # kinky-list-filter-thingy
| if $h_X-Mailing-List: matches "<?([^@>]+)" or
|    $h_List-Id: matches "<([^\.]+)" or
|    $h_X-List-Id: matches "<([^\.]+)" or
|    $h_Delivered-To: matches "mailing list ([^@]+)@"
| then
|       save Maildir/.lists.${perl{sanatize}{$1}}/
|       finish
| endif
| 
| if $h_Sender: matches "owner-mutt-users@xxxxxxxx" or
|    $h_To: matches "mutt-users@xxxxxxxx" or
|    $h_Cc: matches "mutt-users@xxxxxxxx"
| then
|       save Maildir/.lists.mutt-users/
|       finish
| endif
| 
| if error_message or
|    $h_Subject: matches "Cron" or
|    $h_From: matches "root@dot"
| then
|       save Maildir/.stuff.mailerdaemon/
|       finish
| endif
| 
| # default destination is my maildir.
| save Maildir/
| finish

In mutt i 'autogenerate' a list of mailboxes to subscribe to using a
simple oneliner shellscript.

HTH,
Sander.
-- 
| Just remember -- if the world didn't suck, we would all fall off.
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8  9BDB D463 7E41 08CE C94D