Spamassassin tut nix

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
marco.kobek
Posts: 40
Joined: 2004-06-11 20:45

Spamassassin tut nix

Post by marco.kobek » 2006-07-20 00:55

Ich bin nun so langsam aber sicher am verzweifeln.
Ich verusche nun schon seit einer Woche einen einfachen Spamassassin zum laufen zu kriegen aber bislang scheinbar ohne Erfolg.
Ich habe inzwischen ein paar Bücher hier und auch genügend Tutorials aus dem Netz - das Ziel wurde nie erreicht.

Aktuel habe ich hier das Buch "SpamAssassin" vom "Addison Wesley" Verlag und habe mich an Alles gehalten.
Da ich keinen Virenscanner will, habe ich mich entschieden ohne Amavis Spamassassin in Postfix zu integrieren. Das wurde jedoch schon vorher versucht und kam zu ebenso wenig Ergebnissen wie bislang.

In den Logfiles erscheint lediglich folgendes.
Jul 20 00:34:54 server1 spamd[25568]: server killed by SIGTERM, shutting down
Jul 20 00:35:12 server1 spamd[25855]: server started on port 783/tcp (running version 3.0.3)
Jul 20 00:35:12 server1 spamd[25855]: server successfully spawned child process, pid 25856
Jul 20 00:35:12 server1 spamd[25855]: server successfully spawned child process, pid 25857
Jul 20 00:35:12 server1 spamd[25855]: server successfully spawned child process, pid 25858
Jul 20 00:35:12 server1 spamd[25855]: server successfully spawned child process, pid 25859
Jul 20 00:35:12 server1 spamd[25855]: server successfully spawned child process, pid 25860
Jul 20 00:35:14 server1 postfix/smtpd[25845]: connect from vhcs1.domain.net[85.10.245.66]
Jul 20 00:35:14 server1 postfix/smtpd[25845]: 7951F740A4: client=vhcs1.domain.net[85.10.245.66]
Jul 20 00:35:14 server1 postfix/cleanup[25847]: 7951F740A4: message-id=<018001c6ab83$b07fd170$1e98a8c0@X20>
Jul 20 00:35:14 server1 postfix/qmgr[1825]: 7951F740A4: from=<testuser@domain.net>, size=3959, nrcpt=1 (queue active)
Jul 20 00:35:14 server1 postfix/smtpd[25845]: disconnect from vhcs1.domain.net[85.10.245.66]
Jul 20 00:35:14 server1 postfix/virtual[25848]: 7951F740A4: to=<test@domain.eu>, relay=virtual, delay=0, status=sent (delivered to maildir)
Jul 20 00:35:14 server1 postfix/qmgr[1825]: 7951F740A4: removed
Jul 20 00:37:37 server1 postfix/pickup[25862]: warning: dict_open_dlinfo: cannot open /etc/postfix/dynamicmaps.cf. No dynamic maps will be allowed.


Spamassassin läuft als Prozess und wurde in der master.cf von postfix wie folgt eingebunden.

smtp inet n - - - - smtpd -o content_filter=spamd
spamd unix - n n - - pipe user=spam argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} $/recipient}

So stand das im Buch.

Es hab auch noch die Option mit der Auslieferung an Procmail - das steht in der Main.cf wie folgt.

mailbox_command = /usr/bin/procmail


Wenn ich nun einen Header von eingehenden Mails ansehe steht da null und garnix von Spamassassin. Die Konfiguration local.cf in /etc/spamassasin sieht übrigens wie folgt aus:

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

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

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

# Enable the Bayes system
use_bayes 1

# Enable Bayes auto-learning
bayes_auto_learn 1

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

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

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

Wenn noch mehr Infos benötigt werden bitte kurz danach fragen - bin für jede Hilfe dankbar. Ist übrigens ein Debian 3.1 auf dem VHCS installiert ist (via apt)

Ich bitte um Hilfe und hoffe man kann mich hier von meinem Leiden erlösen - ich weiss nämlich langsam wirklich nicht mehr weiter.

Roger Wilco
Administrator
Administrator
Posts: 6001
Joined: 2004-05-23 12:53

Re: Spamassassin tut nix

Post by Roger Wilco » 2006-07-20 01:07

Poste die Ausgabe von `postconf -n`, deine komplette master.cf und ggf. die komplette procmailrc.

mutantx
Posts: 28
Joined: 2002-09-22 11:51

Re: Spamassassin tut nix

Post by mutantx » 2006-07-20 10:27

Wenn du eh schon über procmail die Mails auslieferst..

http://linux.duke.edu/~mstenner/docs/sa-docs/setup.html
Create the file /etc/procmailrc with the following contents:

:0fw
| /usr/bin/spamc

marco.kobek
Posts: 40
Joined: 2004-06-11 20:45

Re: Spamassassin tut nix

Post by marco.kobek » 2006-07-20 16:21

postconf -n ergibt folgendes:

alias_database = hash:/etc/aliases
append_at_myorigin = yes
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
inet_interfaces = all
local_destination_recipient_limit = 1
local_recipient_maps = unix:passwd.byname $alias_database
local_transport = local
mail_spool_directory = /var/mail
mailbox_command = /usr/bin/procmail
mailbox_size_limit = 0
mydestination = $myhostname, $mydomain
mydomain = server1.pv.de
myhostname = server1.pv.de
mynetworks_style = host
myorigin = $mydomain
setgid_group = postdrop
smtpd_banner = $myhostname
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_non_fqdn_sender, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, rejec
t_rbl_client relays.ordb.org, reject_rbl_client cbl.abuseat.org, reject_rbl_client list.dsbl.org, reject_rbl_client opm.blitzed.org, reject_rbl_client sbl.spamhaus.o
rg, reject_rhsbl_client blackhole.securitysage.com, reject_rhsbl_sender blackhole.securitysage.com
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = vhcs.net
smtpd_sasl_security_options = noanonymous
transport_maps = hash:/etc/postfix/vhcs2/transport
virtual_alias_maps = hash:/etc/postfix/vhcs2/aliases
virtual_gid_maps = static:8
virtual_mailbox_base = /var/mail/virtual
virtual_mailbox_domains = hash:/etc/postfix/vhcs2/domains
virtual_mailbox_limit = 0
virtual_mailbox_maps = hash:/etc/postfix/vhcs2/mailboxes
virtual_minimum_uid = 108
virtual_transport = virtual
virtual_uid_maps = static:108


die Datei /etc/procmailrc sieht so aus:

:0fw

| /usr/bin/spamc


die master.cf sieht so aus:

# Postfix master process configuration file. For details on the format
# of the file, see the Postfix master(5) manual page.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - - - - smtpd
#submission inet n - - - - smtpd
# -o smtpd_etrn_restrictions=reject
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps inet n - - - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - - - - smtpd
# -o smtpd_etrn_restrictions=reject
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - - 300 1 qmgr
#qmgr fifo n - - 300 1 oqmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - - - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - - - - smtp
-o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
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=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - - n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}

#
# vhcs delivery agent.
#

vhcs2-arpl unix - n n - - pipe flags=O user=vmail argv=/var/www/vhcs2/engine/messager/vhcs2-arpl-msgr


die main.cf sieht so aus:

command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix

#
# Some common configuration parameters;
#

inet_interfaces = all
mynetworks_style = host

myhostname = server1.pv-marktplatz.de
mydomain = server1.pv-marltplatz.de
myorigin = $mydomain

smtpd_banner = $myhostname powered by dynetix-networks
setgid_group = postdrop

#
# Receiving messages parameters;
#

mydestination = $myhostname, $mydomain
append_dot_mydomain = no
append_at_myorigin = yes
local_transport = local
virtual_transport = virtual
transport_maps = hash:/etc/postfix/vhcs2/transport

#
# Delivering local messages parameters;
#

mail_spool_directory = /var/mail
mailbox_size_limit = 0
mailbox_command = /usr/bin/procmail

biff = no

alias_database = hash:/etc/aliases

local_destination_recipient_limit = 1
local_recipient_maps = unix:passwd.byname $alias_database

#
# Delivering virtual messages parameters;
#
virtual_mailbox_base = /var/mail/virtual
virtual_mailbox_limit = 0

virtual_mailbox_domains = hash:/etc/postfix/vhcs2/domains
virtual_mailbox_maps = hash:/etc/postfix/vhcs2/mailboxes

virtual_alias_maps = hash:/etc/postfix/vhcs2/aliases

virtual_minimum_uid = 108
virtual_uid_maps = static:108
virtual_gid_maps = static:8

#
# SASL paramters;
#

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_local_domain = vhcs.net

broken_sasl_auth_clients = yes

smtpd_recipient_restrictions =
reject_unknown_sender_domain,
reject_non_fqdn_sender,
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
reject_rbl_client relays.ordb.org,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client list.dsbl.org,
reject_rbl_client opm.blitzed.org,
reject_rbl_client sbl.spamhaus.org,
reject_rhsbl_client blackhole.securitysage.com,
reject_rhsbl_sender blackhole.securitysage.com



und die local.cf von Spamassassin sieht so aus.

# SpamAssassin config file for version 3.x
# NOTE: NOT COMPATIBLE WITH VERSIONS 2.5 or 2.6
# See http://www.yrex.com/spam/spamconfig25.php for earlier versions
# Generated by http://www.yrex.com/spam/spamconfig.php (version 1.50)

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

# Change the subject of suspected spam
rewrite_subject 1
subject_tag *****SPAM*****

# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe 0
report_header 1
# Enable the Bayes system
use_bayes 1

# Enable Bayes auto-learning
bayes_auto_learn 1

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

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

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



WEnn ich via spamassassin < datei eine mail übergebe, wird diese im header markiert. Jedoch nicht über Postfix - egal ob ich es via procmail einbinde oder als content-filter. Ich verzweifle langsam aber sicher :o)

adjustman
Posts: 1132
Joined: 2003-03-26 23:29
Location: SA

Re: Spamassassin tut nix

Post by adjustman » 2006-07-23 02:19

warum nimmst du nicht amavisd-new, das ist viel einfacher und effizienter.
EDIT: Sorry
Last edited by adjustman on 2006-07-23 02:21, edited 1 time in total.

adjustman
Posts: 1132
Joined: 2003-03-26 23:29
Location: SA

Re: Spamassassin tut nix

Post by adjustman » 2006-07-23 02:20

@marco.kobek
warum nimmst du nicht amavisd-new, das ist viel einfacher und effizienter.