Examples
========

Here are a few ideas of how to implement features using this ruleset system.

1. Spam WhiteList

   Set "Is Definitely Not Spam = /opt/MailScanner/etc/rules/whitelist.rules".
   Set addresses to be whitelisted using rules such as
   From:	user@good.domain.com	yes
   From:	*@friendly.domain.com	yes
   # A lot of mailing lists use a magic number on the end of the sender address
   From:	bounce-opa-intelligence*@mailing.list.com yes
   # Don't mark any internal message as spam
   From:	123.234.		yes
   From:	/^192\.168\.13[4567]\./	yes
   FromOrTo:	default			no

2. Spam BlackList

   Set "Is Definitely Spam = /opt/MailScanner/etc/rules/blacklist.rules".
   Set addresses to be blacklisted using rules such as
   From:	user@nasty.domain.com	yes
   From:	*@spammers.com		yes
   # Mark an entire network used by spammers
   From:	123.231.3.		yes
   FromOrTo:	default			no

3. Only sign outgoing messages

   Set "Sign Clean Messages = /opt/MailScanner/etc/rules/signing.rules".
   If your messages come from "yourdomain.com", then try this:
   From:	192.168.		yes
   FromOrTo:	default			no
   where your network is the whole of 192.168.xxx.xxx.

4. Use different signatures for different domains

   Set "Inline Text Signature = /opt/MailScanner/etc/rules/sig.text.rules" &
   set "Inline HTML Signature = /opt/MailScanner/etc/rules/sig.html.rules".
   Use rules for each file that look like this:
   From:	*@domain1.com	/opt/MailScanner/etc/reports/domain1.sig.txt
   From:	*@domain2.com	/opt/MailScanner/etc/reports/domain2.sig.txt
   with equivalent rules in the "sig.html.rules" file.

5. Only virus scan some domains

   Set "Virus Scanning = /opt/MailScanner/etc/rules/virus.scanning.rules".
   FromOrTo:	*@scanme.com		yes
   FromOrTo:	*@scanme-too.com	yes
   FromOrTo:	default			no

6. Send system administrator notices to several people

   Set "Notices To = /etc/MailScanner/rules/notices.to.rules".
   To:		@abc.com		postmaster@me.com george@abc.com
   To:		@def.com		postmaster@me.com bill@def.com
   FromOrTo:	default			postmaster@me.com

7. Only quarantine some viruses

   Set "Quarantine Infections = /etc/MailScanner/rules/quarantine.rules".
   Virus:	sobig			no
   Virus:	default			yes

8. Use 2 conditions in the rule

   Set "Spam Actions = /etc/MailScanner/rules/spam.actions.rules".
   From: trapme.com and To: abuse@*	deliver
   FromOrTo: domain.com and FromOrTo: domain2.com	deliver
   FromOrTo:	default			store notify

9. Use perl's pattern matching to make more advanced rules:

   # Match user@domain.com as well as user@sub.domain.com, but not
   # foo-domain.com@spammer.com:
   From:   /[\@\.]domain\.com$/		yes

   # Match all US .gov traffic:
   From:   /\.gov$/			yes


I will add more ideas as I think of them.
All suggestions for clever tricks are most welcome!
