autoproc-0.1.1: EDSL for Procmail scripts

Autoproc.Rules.Dagit

Synopsis

Documentation

dagitRules :: Writer [CExp] ()Source

Any rules that you create need to end up in the rules list. Other than that, feel free to define your own rules using these rules an examples.

A rule is something of the form:

 when condition action

Examples of condition might include:

 (from (Addr "foo@bar"))
 (subject "Hi again")

And example actions are things like:

 (insertMbox "steve")@, @(forward [Addr "friend@yahoo.com"])

I have created some aliases for commonly used constructions For example, simpleSortByFrom joe, is equivalent to:

 when (from (Addr "joe")) (insertMbox "joe")

For a full list of what is possible, check the Autoproc.Classifier module.

dagitDefaultRule :: Writer [CExp] ()Source

I use this rule to make sure any mail that is not sorted goes into my mail spool. It uses Autoproc.Classifier's defaultRule

sarah :: Writer [CExp] ()Source

If the email address contains sparish, then place the email into a folder by the name sparish. Actually, the name of the mailbox is created by appending boxPrefix which is defined in the Configuration module.

nwn :: Writer [CExp] ()Source

Similar to sarah, except we are sorting based on the subject line, and giving the mailbox. As above, boxPrefix will be added to nwn.

spamc :: Writer [CExp] ()Source

A filter is a special action that transforms the email for the benefit of future rules. This particular rule, hands the email off to spam assassin so that it can be checked for signs of spam.

sharing :: Writer [CExp] ()Source

An example that demonstrates forwarding an email.

fixReplyTo :: Writer [CExp] ()Source

This rules fixes the reply-to header of a mailing list. I don't recommend doing this unless you know what you are doing.

alsoTest :: Writer [CExp] ()Source

Sometimes we want just one condition, but we have multiple actions. In this case, use the also syntax. It allows multiple action for one rule.