Jay Lee writes:
successfully blacklist them during the SMTP session. I'd also like to
be able to do some basic content checking of messages before accepting
them so for smtpfilter I have:
/^Subject: *!.*/:h
if (lookup($MATCH2, 'badsubj.dat'))
{
echo "That was not a nice thing to say"
EXITCODE=100
exit
}
EXITCODE=0
exit
However this doesn't seem to work, $MATCH2 doesn't seem to get set at
all. Does pattern matching of headers work differently with
localfilters than it does at local delivery time?
No.
What am I missing here?
A number of things must be carefully set up for rcptfilter and smtpfilter to get invoked.
First, verify that rcptfilter gets invoked in the first place. That should be easy to do -- just have it temporarily reject all mail.
Once you know it gets called, verify that the sample message does take the execution path that terminates with a 99 exit code, then temporarily modify smtpfilter to reject all mail too.
Once you know that both of them get processed, only then you can begin debugging the rest of the script.
pgpchtxnksvu3.pgp
Description: PGP signature
