Todd Lyons a écrit :
/^X-Spam-Status:.*/
if ( $MATCH =~ /Yes/ )
{
log "No vacation message: $MATCH"
exit
}
Beware the "common" bug here (I know it because it happened to me;-)
This would match:
X-Spam-Status: No, score=-2.464 required=5 tests=[BAYES_00=-2.599,
=> see the 'YES' in 'BAYES'.
use /^X-Spam-Flag: YES/ instead. or at least, /^X-Spam-Status: Yes/
one can even play with the score so as to not auto-respond if score >= 4
(for instance, because such message, while not tagged as spam, is
suspicious):
/^X-Spam-Level: \*\*\*\*/
or if one is a geek, he can set a non integral treshold here:
SPAM_NOAUTO_LEVEL = 3.6
/^X-Spam-Score: (\d+[\.\d+])/
if ($MATCH > $SPAM_NOAUTO_SCORE) ...
but this is over-engineering...
with regard to the TO/CC check, you may put the valid rcpt addresses are
in a file:
/^To: (.*)/
loop with getaddr
lookup($address, $file)
and if no lookup succeeds, don't send the vacation message.
another enhancement is to have 2 different vacation messages:
vacation.private and vacation.public. the first would contain private
infos (phone number, ...) and would only be sent to "trusted" people.
then have 3 files:
- list of "trusted" people: vacation.trusted
- list of "blocked" people (no vacation to these): vacation.bl
then again, lookup the sender in these files. if found in .bl, no
vacation. if found in .trusted, then send the private message.
otherwise, send the public message.