Introduction

The process of filtering evaluates messages against criteria and for matching messages performs an action on the message.

Filter file

The filtering rules are defined in the file $HOME/.scythe/filter. You should edit this file in the editor of your choice.

Comment

Lines starting with # are comments and are ignored.

Rule

The format of a rule line is expression [quick] action [arguments]

Expression

expression is a normal expression which is evaluated for true/false, and if true the rule applies.

Actions

Possible actions are:

Name Description
drop The message is deleted.
goto label Testing is moved to the point defined by label. The quick argument is ignored.
none Nothing happens to the message.
refile folder The message is moved into the folder folder.

Quick

The optional quick argument controls the behaviour when a rule is matched. Without quick the last matching rule is the one used, whilst with quick when a rule is matched that is the rule used.

Consider two approaches to handling mail which is tagged as spam (by some separate spam filter) yet comes from a known address. The first approach leaves mail alone since the second rule takes precedence.

($subject contains "***SPAM***") drop
($from-address equals $friends) none

The second approach will drop mail since testing stops with the rule marked quick:

($subject contains "***SPAM***") quick drop
($from-address equals $friends) none

Label

Lines starting with a : are labels. Labels are destination points for goto actions. Labels can consist of a-z, 0-9 and underscore. Example:

($from-address equals $whitelist) goto skip
($subject contains "***SPAM***") quick drop
1 quick refile unknown
:skip
($from-address equals $family) refile family
1 refile inbox