From s23
Jump to navigation Jump to search

To filter out spam on your accounts:

We have AmaVis running, which already marks the Spam and Virii it finds in the mail subject for you.

Now you just want to sort that out automatically?

You can use an Exim filter file, to sort it out before it arrives in your Inbox:

Make a file called .forward in your /home directory:

If the first line looks like this:

  1. Exim filter <<== do not edit or remove this line!

it becomes a filter , rather than just a regular forwarding.

Here is a simple example i use to sort out the messages from amavis:

#   Exim filter   <<== do not edit or remove this line!
if $header_from: contains "amavisd" then save ~/Mail/Spam

you can make very extensive filtering rules, using all variables explained here:

you can also do things like this of course:

if $h_To: contains "debate" then save ~/Mail/CCC
elif $header_from: contains "amavisd" then save ~/Mail/Spam
... and so on..

if you make your own filter remember to test it first, using the -bf option:

read here:

/usr/lib/sendmail -bf new-filter <test-message

more examples: