4 There is one file per user. (If there is no rules file for an user, mail are
5 just delivered to its default folder 'INBOX'.)
7 You can check configuration file from command line by using mail.filter '-c'
8 option. mail.filter will report any syntax error found in the file given as
9 argument. It's HIGHLY recommended to test change with this method prior to
10 "commiting" change to user's configuration.
15 The syntax is very simple.
17 expr = keyword string* { expr* }
20 In english, that mean that an expression is a keyword followed by optionally
21 one or more "string", then followed by end of expression character ';', or
22 followed by nested expression enclosed by {}.
26 folder 'Spam' { spam ; }
31 The file contains a set of actions. Each action contains a match description.
33 Some examples of action:
36 header 'from' contains '<some@email.address.com>' ;
37 header 'from' match '@joedomain\.(com|net|org)>' ;
38 header 'subject' contains '[joe]' ;
41 folder 'Store.Amazon' {
42 header 'to' is 'some@email.address.com' ;
45 header 'from' is 'confirmation-commande@amazon.fr' ;
46 header 'from' is 'confirmation-envoi@amazon.fr' ;
47 header 'from' is 'modification-commande@amazon.fr' ;
49 header 'to' is 'another@email.address.com' ;
54 header 'from' contains '<some@email.address>' ;
58 In the current mail.filter, there is two possible action.
60 Either 'folder' or 'reject'.
66 Syntax: folder <folder-name> { matches.. }
68 The 'folder' action instruct mail.filter to file the mail into a particular
69 folder. So, folder take one argument that give the folder name.
75 Syntax: reject <error-code> { matches.. }
77 The 'reject' action instruct mail.filter to not file the mail, and instead
78 return an error code to sendmail.
80 Supported textual error code are: nouser, tempfail and dataerr.
82 But, reject can also take a numeral error code.
88 For matches listed in action, only one need to match for the action to be
89 taken (logical 'or' by default.)
91 The following matches are supported:
96 Syntax: header <HEADER-NAME> <MATCH-TYPE> <MATCH-ARGUMENT> ;
100 * HEADER-NAME name a header, where all blanks character sequence are
101 considered as just one space character.
103 * MATCH-TYPE give the type of match to perform against the header.
104 Each match type take an argument.
106 * 'is' test if the header is equal to the argument (case
108 * 'contains' test if argument appear in header (case insensitive.)
109 * 'match' test if regular expression defined by argument match
117 Test if the mail was parsed correctly. Usefull to move such mail apart from the
118 INBOX, since most of the time they are spams or viruses.
125 Test with clamav if the mail contains a virus.
132 Test with spamprobe if the mail *could* be a spam.
134 Note that spamprobe need to be "enseigner"(fr->en?).
136 Match 'and', 'or' and 'not'
137 ---------------------------
139 These matches allow you to build logical conditions.
145 For 'and', everything inside it must match.
146 For 'or', only one match is required.
147 For 'not', everything inside must don't match.
153 folder 'Store.Amazon' {
154 header 'to' is 'some@email.address.com' ;
157 header 'from' is 'confirmation-commande@amazon.fr' ;
158 header 'from' is 'confirmation-envoi@amazon.fr' ;
159 header 'from' is 'modification-commande@amazon.fr' ;
161 header 'to' is 'another@email.address.com' ;
165 Here we fill mail to 'Store.Amazon' IMAP folder for the user specified on
166 command line (which sendmail automatically set when calling the script)
167 when mail match the following:
171 - The mail is destined to 'some@email.address.com',
172 - OR The mail is both:
173 - destined to 'another@email.address.com'
174 - AND from one of the three emails address listed.