[As of version 0.9.4, this table is obsoleted by the new filtering system]
Contains the tests that are carried against each incoming message to apply automatic actions such as tagging, trashing, or discarding.
> Columns
action_type: integer (not null)
The action that will be applied if the test is positive.
Possible values are:
field: varchar(50)
Either 'header:' followed by the name of the field against which the
comparison is to be done, or 'body' if it is against the body.
Examples:
value: varchar(255)
Text value against which the field or body will be compared
match_type: integer (not null)
The kind of match that will be tested between field
and value. Possible values are
tag_id: integer
The internal identified of the tag that will be assigned to
the mail if action_type=3.
> Examples
Discard any message whose X-Spam-Status header starts with 'Yes' (this header is added by SpamAssassin):
INSERT INTO auto_action(action_type,field,value,match_type,tag_id) VALUES(1, 'header:X-Spam-Status', '^Yes', 2, null);
Assign the 'xfree86' tag to the incoming messages that have a 'Sender' header set to 'owner-xpert@XFree86.Org' (case insensitive)
INSERT INTO auto_action(action_type,field,value,match_type,tag_id) SELECT 3, 'header:Sender', 'owner-xpert@XFree86.Org', 3, tag_id FROM tags WHERE name='xfree86';
Assign the 'cvs' tag to the incoming messages whose subject contains the substring [cvs]. Note the double-quoting in the sql sentence: the [ character is preceded by a backslash to avoid being taken as a regular expression token, and the backslash itself is doubled for the psql interpreter.
INSERT INTO auto_action(action_type, field, value, match_type, tag_id) SELECT 2, 'header:Subject', '\\[cvs\\]', 3, tag_id FROM tags WHERE name='cvs';