I'm filtering spams with procmail. It will read scripts that you have in or call from .procmailrc in your home directory. The syntax can be pretty horrible, but I got it to work. Read more about it at the
Procmail Documentation Project web site.
To kill mails that don't come from domains that you like, the $HOME/.procmailrc file should contain these lines:
Code:
:0h
* ! ^From:.*\/(allowed.domain.no1|allowed.domain.no2|and.so.on)
/dev/null
If you have only one domain that you like to get mails from and you know that those email addressed have the structure "friend@allowed.domain.foo", then you can change it to
Code:
:0h
* ! ^From:.*@allowed.domain.foo
/dev/null
Be warned however: (1) This will kill the email completely. The general advice seems to save at least the header of
every mail somewhere. This is what the change in warn item (2) will do
(2) I'm a bit rusty when it comes to procmail scripting, so I'm not entirely sure if this does the right thing. You should test the script by changing the ":0h" to ":0fw:", and change /dev/null to some email folder, e.g. $HOME/Mail/Test if your mail directory is $HOME/Mail.
Also, that's a ZERO not an O on the first line!
Anyone, please correct me if this is wrong