Postfix confixx spamassassin

tsaenger

Registered User
Hallo,

ich verstehe es einfach nicht.
Warum werden die SPAM-Einstellungen die ich in Confixx eintrage nicht umgesetzt.
Ich habe mal die Score auf 9 gesetzt. Aber wenn ich mir den Header einer Mail anschaue, steht da immer 5 drin.
Woran kann das liegen?

Ich verwende Postfix mit courier-imap/pop und procmail.

Meine main.cf sieht so aus:
PHP:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

myhostname = h1081716.serverkompetenz.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = h1081716.serverkompetenz.net, localhost.serverkompetenz.net, , localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_tls_clientcerts, permit_mynetworks, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_non_fqdn_hostname, reject_unknown_recipient_domain, reject_invalid_hostname,reject_unauth_pipelining, reject_unknown_hostname, reject_unknown_sender_domain, reject_non_fqdn_recipient, reject_unknown_recipient_domain, check_policy_service inet:127.0.0.1:60000, reject_unauth_destination


smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes

smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
virtual_mailbox_limit = 512000000
smtpd_helo_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_invalid_hostname, reject_unauth_pipelining
smtpd_sender_restrictions =
smtpd_client_restrictions =
smtpd_helo_required = yes
strict_rfc821_envelopes = yes
disable_vrfy_command = yes

home_mailbox = Maildir/
minimal_backoff_time = 300
queue_run_delay = 300
mailbox_command = /usr/bin/procmail -a "EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir
### CONFIXX POSTFIX ENTRY ###

virtual_maps = hash:/etc/postfix/confixx_virtualUsers, hash:/etc/postfix/confixx_localDomains

### /CONFIXX POSTFIX ENTRY ###

die Master.cf:
PHP:
smtp      inet  n       -       -       -       -       smtpd
#        -o content_filter=filter:dummy
submission inet n      -       -       -       -       smtpd
#       -o smtpd_etrn_restrictions=reject
#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
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
relay     unix  -       -       -       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
#
# 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}
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=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -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}

Und die procmailrc
PHP:
# SpamAssassin sample procmailrc
# ==============================

# The following line is only used if you use a system-wide /etc/procmailrc.
# See procmailrc(5) for infos on what it exactly does, the short version:
#  * It ensures that the correct user is passed to spamd if spamc is used
#  * The folders the mail is filed to later on is owned by the user, not
#    root.
DROPPRIVS=yes
LOGFILE=/var/log/procmail
SHELL=/bin/sh

:0 fw
* < 256000
| /usr/bin/spamc -f
# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
#:0:
#* ^X-Spam-Level: ***************
#/var/spool/mail/almost-certainly-spam
# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
#:0:
#* ^X-Spam-Status: Yes
#/var/spool/mail/probably-spam
# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped. This will re-add it.

:0 H
* ! ^From[ ]
* ^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "
:0 fhw
| sed -e 's/^rom /From /'
}
# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
# if you use the spamc/spamd combination)
#
# The condition line ensures that only messages smaller than 250 kB
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
#
:0fw: spamassassin.lock
* < 256000
| spamassassin

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0fw: spamassassin.lock
* < 256000
| spamassassin

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
almost-certainly-spam

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
probably-spam

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped.  This will re-add it.
# NOTE: This is probably NOT needed in recent versions of procmail
:0
* ^^rom[ ]
{
  LOG="*** Dropped F off From_ header! Fixing up. "

  :0 fhw
  | sed -e '1s/^/F/'
}
MAILDIR=$HOME/Maildir/
LOGFILE=$HOME/procmail.log
VERBOSE=on
:0
#Maildir/new/
Maildir/new
die spamassassin-File:
Code:
# /etc/default/spamassassin
# Duncan Findlay

# WARNING: please read README.spamd before using.
# There may be security risks.

# Change to one to enable spamd
ENABLED=1

# Options
# See man spamd for possible options. The -d option is automatically added.

# NOTE: version 3.0.x has switched to a "preforking" model, so you
# need to make sure --max-children is not set to anything higher than
# 5, unless you know what you're doing.

#OPTIONS="--create-prefs --max-children 5 --helper-home-dir"
OPTIONS="--sql-config --nouser-config --local --daemonize --max-children=5 --D"
SPAMD_ARGS="-d -x -q -L"
# Pid file
# Where should spamd write its PID to file? If you use the -u or
# --username option above, this needs to be writable by that user.
# Otherwise, the init script will not be able to shut spamd down.
PIDFILE="/var/run/spamd.pid"

# Set nice level of spamd
#NICE="--nicelevel 15"

und die local.cf:
Code:
################### CONFIXX SPAMASSASSIN CONFIG FILE #####################
# created at Fri Apr 27 14:47:51 2007
#
#            !!! Do not make any changes in this file !!!
# All your changes will be lost after the file is auto updated next time.
#
#   If you want to add here any custom directive, you should include it
#   to '/root/confixx/safe/spamassassin.inc' file. Its content will be automatically
#   included during the file is autoupdated.
##########################################################################

# START CUSTOM INCLUSION (see /root/confixx/safe/spamassassin.inc)

# SpamAssassin config file for version 3.x

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

# Whether to change the subject of suspected spam
rewrite_header subject  *****SPAM*****

# Encapsulate spam in an attachment
report_safe             1

# Add report into headers
add_header spam Report _REPORT_

# 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              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

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


# END OF CUSTOM INCLUSION

# START CONFIXX GENERATED SECTION

all_spam_to                     *@xxx.de

allow_user_rules 1

user_scores_dsn                 DBI:mysql:confixx:localhost;mysql_socket=/var/run/mysqld/mysqld.sock
user_scores_sql_username        confixx
user_scores_sql_password        xxxx

user_scores_sql_custom_query SELECT preference, value FROM spampref WHERE (username = _USERNAME_ OR username = '@GLOBAL') AND server_id='d98ad8a96916b13ec88d54f69e398408' ORDER BY username ASC

In meiner mail.info und mail.err habe ich keine fehlereinträge finden können.

Gruß

TObias
 
Last edited by a moderator:
Ich hab das in der default stehen:

Code:
226# cat /etc/default/spamassassin
# /etc/default/spamassassin
# Duncan Findlay

# WARNING: please read README.spamd before using.
# There may be security risks.

# Change to one to enable spamd
ENABLED=1

# Options
# See man spamd for possible options. The -d option is automatically added.

# SpamAssassin uses a preforking model, so be careful! You need to
# make sure --max-children is not set to anything higher than 5,
# unless you know what you're doing.

OPTIONS="--setuid-with-sql --nouser-config --daemonize --max-children=5"

# Pid file
# Where should spamd write its PID to file? If you use the -u or
# --username option above, this needs to be writable by that user.
# Otherwise, the init script will not be able to shut spamd down.
PIDFILE="/var/run/spamd.pid"
An Deiner Stelle würde ich den Mist aus der procmailrc entfernen, sonst bekommste jede Menge Mails in eine Datei, die keiner abruft.
 
Code:
OPTIONS="--setuid-with-sql

Die Config soll ja mit dem Datenbankzugang aus der local.cf die Scores aus der Datenbank lesen. Das stellst Du in Confixx ein

Code:
Apr 28 11:19:02 server4 spamd[16844]: spamd: connection from localhost [127.0.0.1] at port 34568
Apr 28 11:19:02 server4 spamd[16844]: spamd: setuid to web8p1 succeeded, reading scores from SQL
 
Hi,

vielen Dank für eure Antworten.

Wenn ich die Einträge aus der Procmail deaktiviere, dann wird gar nicht mehr auf Spam geprüft.
Muss ich dann den Spamassassin direkt in Postfix ansprechen lassen?

Tobias
 
Hat doch keiner gesagt, dass Du alle deaktivieren sollst! Stell das schnell wieder um, wenn Du kenen Maildir parameter in der postfix config hast
 
Hi,

also ich habe alles bis auf:
MAILDIR=$HOME/Maildir/
LOGFILE=$HOME/procmail.log
VERBOSE=on
:0
#Maildir/new/
Maildir/new

:0fw: spamassassin.lock
* < 256000
| /usr/bin/spamassassin
aus der procmailrc gelöscht.

Gruß

Tobias
 
Wo soll man nur ansetzen Dir zu helfen?
Ich würde mal sagen, Du bringst es erst auf die Reihe, daß die Mails vernünftig ausgeliefert werden. Dazu reicht ganz allein diese Zeile:
Code:
MAILDIR=$HOME/Maildir/
Jede weitere Zeile (wie z.B. "Maildir/new") bringt nur Müll mit sich.
Das Du das Loggin einschaltest ist grundsätzlich auch nicht schlecht. Die 2 Zeilen können also auch bleiben.
Aber warum rufst Du nun "spamassassin" auf? Das steht glaub ich oben nicht einmal so. Bleib doch einfach beim "spamc".

huschi.
 
Back
Top