Ticket #357 (closed defect: fixed)
load-sa-rules.pl skips rules that lack description lines
| Reported by: | rjl | Owned by: | rjl |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.3 |
| Component: | Perl scripts | Version: | 1.0.0 |
| Severity: | minor | Keywords: | load-sa-rules.pl describe description |
| Cc: |
Description
The load-sa-rules script currently ignores rules that don't contain the "describe" line that the SpamAssassin docs stipulate. A well-formed header rule, for instance, should look something like:
header FOO_BAR X-Foo =~ /bar/ score FOO_BAR 1.0 describe FOO_BAR X-Foo header contains the string 'bar'
Without the "describe" line, SpamAssassin will leniently process the rule anyway, but no descriptive text will appear in its spam report header next to the rule name. Since load-sa-rules doesn't load such rules at all, however, these rules will not appear in the report section of Maia's mail viewer when they're triggered, and no stats will be tracked for them on the SpamAssassin statistics page.
While it is possible to parse rules without "describe" lines, it is not always clear when the rule author has omitted the description intentionally (e.g. in the case of a sub-test that is only significant if it triggers in combination with certain other rules, which collectively get one "describe" line in the form of a meta-rule), or out of carelessness. load-sa-rules should make a better effort at distinguishing these two cases, or resort to loading all rules, sub-tests and all.

