Table of Contents

Spam Filter Rules: DefineRule

Statement DefineRule
Version 2.1.9+
Purpose Defines a rule name, default weighting and description. See Rule names and weights

The DefineRule statement requires a name, default weight and description, in the format

DefineRule "<name>" <default weights> "<description>"

Defining rules like this allows the filter script to be customisable by the user without them having to edit the script itself, as the rule weightings can be modified via Settings → Spam Filter → General → Rule Weights in VPOP3's Administration Settings.

In Version 2.2.1 and later, you can have multiple 'default weight' values, the ${WeightBank} variable specifies which to use. If ${WeightBank} is 0, the first value is used, if it is 1, the second is used and so on. If ${WeightBank} is greater than the number of values for a particular rule, then the last one is used.

It is unusual to define more than two default weights, as these are commonly just used for deciding whether or not the message has a high Bayes score.

Examples

The following example defines a rule called 'surbl.org' with a default weighting of 1.2 and an associated description.

DefineRule "surbl.org" 1.2 "URL in message in multi.surbl.org"

The following example defines a rule called 'MyMultipleWeightRule' with two default weights.

DefineRule "MyMultipleWeightRule" 0.5 0.8 "This rule has default weights of 0.5 and 0.8"

Using

When adding values to the spam score variable: ${Score}, you can tell VPOP3 to associate that score change with the rule, by adding the rule name in square brackets afterwards, for instance

${Score} += 50 [MyMultipleWeightRule]