You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Mathias Homann <ad...@eregion.de> on 2006/12/06 11:36:37 UTC
trouble calling spamc from within postfix
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=<ad...@maximus.linotype.com>,
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 <ad...@maximus.linotype.com> 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.
here's postconf -n output:
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter =
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
local_recipient_maps = $alias_maps
mail_name = Linotype Mail System
mailbox_size_limit = 1048576000
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_queue_lifetime = 10d
message_size_limit = 104857600
mydestination = localhost maximus.fonts.de maximus.linotype.com $myhostname
localhost.$mydomain $mydomain fonts.de linotypelibrary.com linolib.com linofonts.com
fontexplorer.de fontexplorer.com e-linotype.com linotype.com localhost.fonts.de
maxneu.fonts.de maxneu.linotype.com
myhostname = www.fonts.de
mynetworks = 127.0.0.0/8 10.1.0.0/16 10.0.1.0/24 10.0.2.0/24 10.0.4.0/24 193.103.125.0/24
myorigin = fonts.de
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.0.16/README_FILES
relay_domains = $mydestination
relayhost = [10.0.1.50]
sample_directory = /usr/share/doc/postfix-2.0.16/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 450
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
#<KIS55>
127.0.0.1:10030 inet n n n - 20 spawn
user=kluser argv=/opt/kav/5.5/kav4mailservers/bin/smtpscanner
127.0.0.1:10031 inet n - n - 21 smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o myhostname=maxneu.fonts.de
#<KIS55>
# spamassassin
when i invoke the spamassassin pipe as defined in master.cf from a shell, it works just fine
and the mail gets delivered.
when i change the "-o content_filter=" line in the kaspersky backport definition to invoke
that spamassassin filter, i get bounces.
anyone got an idea for me?
bye,
MH
--
Die unaufgeforderte Zusendung einer Werbemail an Privatleute verstößt gegen §1 UWG und §823 I
BGB (Beschluß des LG Berlin vom 2.8.1998 Az: 16 O 201/98). Jede kommerzielle Nutzung der
übermittelten persönlichen Daten sowie deren Weitergabe an Dritte ist ausdrücklich untersagt!
Re: trouble calling spamc from within postfix
Posted by Mathias Homann <ad...@eregion.de>.
Noel Jones schrieb:
> * 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}".
[...]
> 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.
thanks a lot, that did it.
bye,
MH
--
Die unaufgeforderte Zusendung einer Werbemail an Privatleute verstößt gegen §1 UWG und §823 I
BGB (Beschluß des LG Berlin vom 2.8.1998 Az: 16 O 201/98). Jede kommerzielle Nutzung der
übermittelten persönlichen Daten sowie deren Weitergabe an Dritte ist ausdrücklich untersagt!
Re: trouble calling spamc from within postfix
Posted by Noel Jones <no...@gmail.com>.
On 12/6/06, Mathias Homann <ad...@eregion.de> 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=<ad...@maximus.linotype.com>,
> 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 <ad...@maximus.linotype.com> 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