On 12/6/06, Mathias Homann <[EMAIL PROTECTED]> wrote:
Hi,


I'm trying to use spamassassin 3.1.7 from within postfix 2.2.10 on a redhat ES4 
server,
(loosely) following the directions in
http://www.debuntu.org/postfix-and-pamassassin-how-to-filter-spam (loosely, 
because 1. its
redhat and nbot ubuntu, and 2. there's a kaspersky antivirus involved as well).

Anyways, I've got spamassassin itself up and running, i can filter from the 
commandline just
fine, either using spamassassin or spamc. Also, I have the MTA set up with 
kaspersky just
fine, mails get passed through kaspersky, and then either delivered to local 
mailboxes, or
passed on towards our internal notes server.

when I add the spamassassin content filter to the chain, things start flying 
apart on me.
All the info I get is a line like the following in /var/log/maillog, 
accompanied by the
resulting bounces.
postfix/lmtp[22540]: 8C4AE19C1BA: to=<[EMAIL PROTECTED]>,
relay=127.0.0.1[127.0.0.1], delay=0, status=bounced (host 127.0.0.1[127.0.0.1] 
said: 55
2 <[EMAIL PROTECTED]> Error ! (in reply to end of DATA command))

But a few lines up in /var/log/maillog, I see the mail going through 
spamassassin just fine,
getting tagged and all.

...

and here are the relevant parts of /etc/postfix/master.cf:

smtp      inet  n       -       n       -       -       smtpd
##<KIS55> ## Added by Kaspersky Anti-Virus Installer ##
               -o content_filter=lmtp:127.0.0.1:10030
## Added by Kaspersky Anti-Virus Installer ##<KIS55>
#smtps    inet  n       -       n       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission     inet    n       -       n       -       -       smtpd
#  -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628      inet  n       -       n       -       -       qmqpd
pickup    fifo  n       -       n       60      1       pickup
##<KIS55> ## Added by Kaspersky Anti-Virus Installer ##
               -o content_filter=lmtp:127.0.0.1:10030
## Added by Kaspersky Anti-Virus Installer ##<KIS55>
spamassassin unix -     n       n       -       -       pipe
       user=spamd argv=spamc -u spamd -e /usr/sbin/sendmail -oi -t

AHHH!
* NEVER * use "sendmail -t" to reinject mail coming from the network.
Doing so will send mail to everyone listed in the To: header, which
doesn't have anything to do with who should receive the mail.

As the guide said, use "sendmail -oi -f ${sender} -- ${recipient}".

But you need to rethink the whole thing.
Using two content_filters in postfix can be complex - either one
filter must feed the next, as in
postfix -> filter1 -> filter2 -> postfix -> destination
or use postfix between the two filters as in:
postfix -> filter1 -> postfix -> filter2 -> postfix -> destination

In your case, probably the easiest solution is to add -o
content_filter=spamassassin to the 127.0.0.1:10031 ... smtpd entry,
and remove the content_filter from the pickup entry, and don't set
content_filter in master.cf.
This means that mail submitted locally on the machine via sendmail(1)
will not be filtered at all.  If you need local mail filtered, you
will need a different setup, such as using amavisd-new to call both
spamassassin and Kaspersky.


--
Noel Jones

Reply via email to