It can save mail to specified folders, run programs (with the mail message as input) or delete unwanted mail altogether. And all of this happend without any intervention of the user.
|/usr/local/bin/filter\ -ov /home/helium/jansen/.elm/filter.error(of course, you should specify your own home directory.
Alternatively, you can keep a copy of your mail in your incoming mail box, and send another copy through the filter:
\jansen, |/usr/local/bin/filter\ -ov /home/helium/jansen/.elm/filter.errorAnd yes, this first backslash (\) is quite important. Of course you should check your filter.error file on a regular basis to see if something is going wrong.
The structure of such a rule is:
if (condition) then action
This field is compared to a value, which is a quoted string.
Between field and value you can use a relational operator from this list (or leave it out, which is equivalent to using =):
if (from contains "shoppingplanet.com") then deleteIf you want to be a bit more safe, you could write them to a temporary garbage file, which you check from time to time to see if anything useful was thrown in by mistake, e.g.:
if (from contains "shoppingplanet.com") then save ~/Mail/garbage
And you are subscribed to a mailinglist, and you don't want to be bothered by every mail that is coming in from that list. So you want to save these messages to a folder, which you read when ever it suits you:
if (to contains "Multiple recipients of list RULWEB") then save ~/Mail/rulweb
A final example: if your thesis-supervisor sends you an e-mail, you want to be notified directly. Let's say her user name is bigboss, so you could write:
if (from = "bigboss") then executec "echo 'Mail from bigboss' >/dev/console"Assuming of course that you are sitting behind the console of the workstation, which you probably aren't.
if (subject = "test") then save ~/Mail/mailtests if (from = "bigboss") then save ~/Mail/frombigbossand bigboss sends you a message with the word "test" in the subject, the message will end up in the folder =mailtests and not in =frombigboss !!!!
More examples can be found in the ELM filter manual (computer library, room 508).
There are two ways to do that. If you type filter -r it will read and analyze your filter rules, checking the syntax, and displaying what it is actually making of it.
You can also feed saved messages to filter to see what it should have done with them using the current rule set. To do this from elm, type | filter -n with the cursor on a message. Note that this doesn't do anything; the existing message is unaffected, and no additional copies are saved or programs executed.
# # Anti-spam version - make sure to include all your addresses # if (from contains "strw.leidenuniv.nl") then leave if (to contains "strw.leidenuniv.nl") then leave if (to contains "jansen") then leave if (to contains "david") then leave # take care with our local group aliases: if (to contains "staff") then leave if (to contains "strwchem") then leave if (to contains "all") then leave always save ~/Mail/garbage... and check the ~/Mail/garbage file on a regular basis. Some things may end up there, e.g. mailing lists. But once you identify such a message, you can always add a rule to leave such mails in your incoming mailbox.