Re: real time content filtering - is there hope?
[ cc-ed back to debian-isp because others may find it useful ]
On Thu, Jun 01, 2006 at 10:05:34AM +1200, Bruce Parkinson wrote:
> >IMO, it is better to accept the mail into the queue, scan it with
> >amavis/clamav/spamassassin/etc and either Tag+Deliver or Discard
> >detected spams/viruses (*do not* bounce as the sender address is most
> >likely forged).
i also Hold (in the postfix queue) messages with a score between 5 & 10. i
examine held messages with my qvmenu.pl queue browser and decide whether to
unhold them or delete them. OK to do on a little home server like mine,
but not if you have thousands of email accounts or if there are privacy
i also use any held spams to refine my anti-spam rules. ditto for the
> I'm about to roll out a new Postfix and I'm hoping to do something
> _very_ similar to this - would you mind pointing me in the right
> direction to RTFM or share a config or two? The bit I've not been
> able to get in the past is Tag+Deliver or Discard based on score, and
> have had to chose between one or the other.
the trick is to have a separate header_checks file which is used for the
re-injection smtpd (i.e the one on port 10025) which has the discard
rule for high SA scores.
you also need to be reasonably good at constructing regular expressions.
e.g. something like this:
127.0.0.1:10025 inet n - n - - smtpd
and header_checks.tiny looks like this:
# discard nigerian and lottery scams
# i.e some SA codes that you really dont want to see...
# discard most image spams
# discard scores >=10.0, hold if score >= 5.0 & <10
#/^X-Spam-Status: Yes, (?:hits|score)=([1-9][0-9][0-9.]*|1[0-9][0-9][0-9.]+)/ DISCARD SpamAssassin Score far too high ($1)
/^X-Spam-Status: Yes, (?:hits|score)=([5-9]\.\d+)/ HOLD SpamAssassin Score too high ($1)
# discard viruses
/^X-Amavis-Alert: INFECTED/ DISCARD
you could have these rules in your main header checks file, but that's just a
waste of CPU cycles - the message has alreasy passed through your main header
checks file there's no point in applying all those rules again...so have a
tiny one with just the post-amavis rules.
hope that helps.
craig sanders <email@example.com> (part time cyborg)