Because it is a database, you will be able to update it without
having to restart sendmail. In fact, because the righthand side says REJECT, you simply
have to change that word to OK to allow a header. This allows you to maintain a
history of spam subjects for later review or reuse.
* Depending on your shell, you might have to prefix the tab with a control-V character to embed it into your
command line.
This is the Title of the Book, eMatter Edition
Copyright ?© 2007 O??™Reilly & Associates, Inc. All rights reserved.
266 | Chapter 7: How to Handle Spam
The rules for the use of this database can be added to your mc configuration file like
this:
LOCAL_CONFIG
Kspamsubjdb hash /etc/mail/spamsubjects
HSubject: $>ScreenSubject
LOCAL_RULESETS
SScreenSubject
R $* $: $(spamsubjdb $&{currHeader} $: OK $) $1
R REJECT $* $#error $: "553 Subject:" $1 ": Indicates virus, rejected"
Here, the LOCAL_CONFIG part defines a database map called spamsubjdb of type
hash that will use the database file you created earlier. The second line under
LOCAL_CONFIG defines the Subject: header, and says that the value of that header
should be passed (the $ > operator) through the ScreenSubject rule set.
In the LOCAL_RULESETS part of your mc file, the S configuration line defines the
ScreenSubject rule set, which has just two rules.
The first rule looks up the entire workspace (the $* operator) in the LHS (lefthand
side, ?§18.
Pages:
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494