[Postfixbuch-users] Spamassassin und postfix laufen nicht zusammen

Michael Fried michael at palm-fried.de
Mo Feb 11 10:33:39 CET 2008


Hallo,
ich verfolge schon seit einiger Zeit die Mailingliste finde leider 
hierzu keine richtige Lösung.
ich habe eine Groupware der E-Mailversand funktieniert gut, aber die 
Spamms werden immer schlimmer. Daraufhin habe ich den Spamassassin  
installiert. Habe die entsprechende Einträge durchgeführt. Entwerder 
lässt er alles durch oder es kommt garnicht mehr an.
Wenn ich den  "content_filter = spamassassin:[127.0.0.1]:10024" 
aktiviere, kommen keine Mail mehr durch.

Die main.cf  sieht wie folgt aus:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix
mail_spool_directory = /var/mail

sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = maildrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/packages/postfix/samples

debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         xxgdb $daemon_directory/$process_name $process_id & sleep 5


mail_owner = postfix
#default_privs = nobody

myhostname = ox-s020.herz-jesu.dmz
#myhostname = mail.se-wh.de
mydomain = herz-jesu.dmz
myorigin = $myhostname
mydestination = mail.se-wh.de,ox,ox-s020.herz-jesu.dmz,localhost

inet_interfaces = all
local_recipient_maps =
unknown_local_recipient_reject_code = 450

#mynetworks = 172.16.120.20 smtp.kamp-dsl.de
#mynetworks = 172.16.120.20
mynetworks = 192.168.120.0/24,172.16.120.0/24, 127.0.0.1/8
#relay_domains = $mydestination
#relayhost = smtp.kamp-dsl.de
relayhost =

recipient_delimiter = +
 

mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
#content_filter = spamassassin:[127.0.0.1]:10024
#content_filter = spamassassin:

#fallback_transport = lmtp:unix:/file/name
#luser_relay = $user at other.host
smtpd_banner = $myhostname

transport_maps = ldap:ldaptrans
virtual_alias_maps = hash:/etc/postfix/virtual,ldap:ldapaliases
virtual_alias_domains = ldap:ldapvdom
alias_maps = hash:/etc/aliases,ldap:ldapsharedfolder

disable_dns_lookups = no
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
defer_transports =

# message_size_limit = 10485760
message_size_limit = 20971520
mailbox_size_limit = 0

smtpd_recipient_restrictions = 
permit_mynetworks,permit_tls_clientcerts,permit_sasl_authenticated,reject_unauth_destination

################ SASL config ##############
#smtpd_sasl_auth_enable = yes
smtpd_sasl_auth_enable = no
#broken_sasl_auth_clients = yes
broken_sasl_auth_clients = no
smtpd_sasl_security_options = noanonymous
###########################################


################ TLS config ################
smtp_use_tls = yes
smtpd_use_tls = yes
smtpd_tls_ask_ccert = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file  = /etc/postfix/tls/OX-S020.HERZ-JESU.DMZ.key
smtpd_tls_cert_file = /etc/postfix/tls/OX-S020.HERZ-JESU.DMZ.crt
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
tls_daemon_random_source = dev:/dev/urandom
#############################################


ldaptrans_server_host= 127.0.0.1
ldaptrans_server_port= 389
ldaptrans_bind= no
ldaptrans_timeout= 20
ldaptrans_search_base= 
ou=MailTransports,ou=SMTPObjects,ou=AdminObjects,ou=OxObjects,dc=SE-WH,dc=DE
ldaptrans_query_filter= 
(&(objectclass=OXMailTransportObject)(smtpDomain=%s))
ldaptrans_result_attribute= smtpDomainTransportNexthop
ldaptrans_scope= one
:
:

Hier nun meine master.cf

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
#smtp      inet    n    -    n    -    -    smtpd
smtp      inet    n    -    n    -    -    smtpd -o 
content_filter=spamassassin:nobody
smtps      inet    n    -    n    -    -    smtpd -o 
smtpd_tls_wrappermode=yes
#  -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
cleanup      unix    n    -    n    -    0    cleanup
qmgr      fifo    n    -    n    300    1    qmgr
#qmgr      fifo    n    -    n    300    1    nqmgr
#tlsmgr   fifo  -       -       n       300     1       tlsmgr
rewrite      unix    -    -    n    -    -    trivial-rewrite
bounce      unix    -    -    n    -    0    bounce
defer      unix    -    -    n    -    0    bounce
flush      unix    n    -    n    1000?    0    flush
proxymap  unix    -    -    n    -    -    proxymap
smtp      unix    -    -    n    -    -    smtp
relay      unix    -    -    n    -    -    smtp
#    -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix    n    -    n    -    -    showq
error     unix    -    -    n    -    -    error
local      unix    -    n    n    -    -    local
virtual      unix    -    n    n    -    -    virtual
lmtp      unix    -    -    n    -    -    lmtp
#localhost:10025 inet    n    -    n    -    -    smtpd -o content_filter=
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# maildrop. See the Postfix MAILDROP_README file for details.
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
cyrus      unix    -    n    n    -    -    pipe
  user=cyrus argv=/usr/lib/cyrus/bin/deliver -e -r ${sender} -m 
${extension} ${user}
uucp      unix    -    n    n    -    -    pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail 
($recipient)
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop 
$recipient
vscan     unix  -       n       n       -       10       pipe
  user=vscan argv=/usr/sbin/amavis ${sender} ${recipient}
procmail  unix  -       n       n       -       -       pipe
  flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc 
${sender} ${recipient}

###### SPAMASSASIN #####
spamassassin unix  -       n       n       -       -       pipe 
user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f 
${sender} ${recipient}


Hier meine local.cf vom spamassassin:


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

# Change the subject of suspected spam
rewrite_header subject         *****SPAM*****

# Auto-Whitelist-Funktion ist per Default aktiviert
#use_auto_whitelist 1
#auto_whitelist_path /var/cache/spam/awl/

# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe             1

# Enable the Bayes system
use_bayes               1

# Enable neu erlernte in die Journal-Datei abzuspeichern
bayes_learn_to_journal 1

# Enable Bayes auto-learning
bayes_auto_learn              1

# Enable or disable network checks
# skip_rbl_checks         0
# use_razor2              1
# use_dcc                 1
# use_pyzor               1

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
# ok_languages            all
ok_languages            en de

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
#ok_locales              all
 ok_locales              en

Damit der spamassassin lernt lass ich alle Stunde diese Routine laufen:

find /var/spool/imap/ -iname spam -exec sa-learn --no-sync --spam {} \; 
&& sa-learn --sync


So, hier bin ich mit meinem Latain am Ende. Hat jemand eine Idee, warum 
der spamassassin nicht greift.
Für jede Hilfe dankbar.
Grüße Michael




Mehr Informationen über die Mailingliste Postfixbuch-users