I've installed Spamassassin and configured Postfix to use it as a mail filter.
The log reports show that SPAM is being reported correctly. However, header
rewrites configured in /etc/spamassassin/local.cf seem to be ignored.:

local.cf:

rewrite_header Subject ****SPAM(_SCORE_)****
report_safe 1
lock_method flock

# How many hits before a message is considered spam.
required_hits           5.0

Logfile:

Mar 27 08:05:00 ettin spamd[16687]: connection from localhost [127.0.0.1] at port 36500
Mar 27 08:05:00 ettin spamd[16687]: info: setuid to filter succeeded
Mar 27 08:05:00 ettin spamd[16687]: processing message <[EMAIL PROTECTED]> for filter:1004.
Mar 27 08:05:01 ettin postfix/smtpd[27914]: disconnect from gd202157043232.b21.kcn-tv.ne.jp[202.157.43.232]
Mar 27 08:05:03 ettin spamd[16687]: identified spam (11.8/5.0) for filter:1004 in 2.3 seconds, 1495 bytes.
Mar 27 08:05:03 ettin spamd[16687]: result: Y 11 - DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,HTML_20_30,HTML_MESSAGE,RCVD_IN_XBL,URIBL_OB_SURBL,URIBL_SBL,URIBL_SC_SURBL scantime=2.3,size=1495,mid=<[EMAIL PROTECTED]>,autolearn=no


I am using a filter as suggested by the Postfix documentation:

#!/bin/bash

# see http://www.postfix.org/FILTER_README.html for details

# Simple shell-based filter. It is meant to be invoked as follows:
#       /path/to/script -f sender recipients...

# Localize these.
INSPECT_DIR=/var/spool/filter
SENDMAIL="/usr/sbin/sendmail -i"

# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69

# Clean up when done or when aborting.
trap "rm -f in.$$" 0 1 2 3 15

# Start processing.
cd $INSPECT_DIR || {
   echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }

cat >in.$$ || {
   echo Cannot save mail to file; exit $EX_TEMPFAIL; }

# Specify your content filter here.
/usr/bin/spamc <in.$$ || {
  echo Message content quarantined; cat >> /var/spool/mail/quarantine; }

$SENDMAIL "$@" <in.$$

exit $?

The mail is delivered as normal with no rewrites. What have I missed?

--
Neil Watson               | Gentoo Linux
Network Administrator     | Uptime 12 days
http://watson-wilson.ca   | 2.6.11.4 AMD Athlon(tm) MP 2000+ x 2

Reply via email to