PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : spamassassin prüft doppelt



abalorio
10.11.07, 14:33
Hi, ich hab folgendes Problem. Hin und wieder kommen Spam-eMails durch, weil sie offensichtlich von spamassassin doppelt geprüft werden:



Auszug aus einer Beispiel-eMail:
...
X-Spam-Level: **
X-Spam-Status: No, score=2.9 required=3.0 tests=BIZ_TLD,INVALID_MSGID, UNPARSEABLE_RELAY autolearn=no version=3.1.
...
Content preview: New Company Pick for November Monumental Marketing Inc (MNUM.OB)
OTCBB: MNUM.OB Firstly to inform you there is a huge PR campaign starting
today. Secondly this is not a fly by night company. [...]

Content analysis details: (5.1 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
1.7 INVALID_MSGID Message-Id is not valid, according to RFC 2822
3.4 FORGED_MUA_OUTLOOK Forged mail pretending to be from MS Outlook
...


Meine Postfix-Konfiguration:



alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter =
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
debug_peer_list = 127.0.0.1, 87.xx.xx.xx
defer_transports =
disable_dns_lookups = no
home_mailbox = Maildir/
inet_interfaces = all
local_recipient_maps =
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains = domain.de
masquerade_exceptions = root
message_size_limit = 104857600
mydestination = $myhostname, localhost.$mydomain, 87.xx.xx.xx, domain.de
mynetworks = 87.xx.xx.xx, 127.0.0.0/8
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relayhost =
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = no
smtp_use_tls = no
smtpd_banner = PostfixServer
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_use_tls = no
strict_rfc821_envelopes = no
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 450


Die Konfiguration von Postfix-master.cf



smtp inet n - n - - smtpd -o content_filter=spamd
#submission inet n - n - - smtpd
# -o smtpd_etrn_restrictions=reject
# -o smtpd_client_restrictions=permit_sasl_authenticate d,reject
#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_etrn_restrictions=reject
# -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 oqmgr
#tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
#localhost:10025 inet n - n - - smtpd -o content_filter=
scache unix - - n - 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}
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
procmail unix - n n - - pipe
flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}
spamd unix - n n - - pipe
user=spam argv=/usr/bin/spamc -f
-e /usr/sbin/sendmail -oi -f $(sender) ${recipient}
...




Meine Procmail-Konfig unter /home/user:



DROPPRIVS=yes
LOGFILE=$HOME/procmail.log
SHELL=/bin/sh

:0fw
* < 256000
| spamassassin

:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
/dev/null

:0:
* ^X-Spam-Status: Yes
$HOME/spam


:0 H
* ! ^From[ ]
* ^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "

:0 fhw
| sed -e 's/^rom /From /'
}

MAILDIR=$HOME/Maildir/
DEFAULT=$MAILDIR


Konfiguration von von .forward im User-Verzeichnis:


| /usr/bin/procmail

Hm... woran liegt es? DANKE für jede Hilfe!

Blade
10.11.07, 16:18
Welche Version von spamassassin setzt Du ein? So ganz verstehe ich noch nicht was da abläuft aber die folgenden Einträge passen nicht zusammen:

X-Spam-Status: No, score=2.9 required=3.0
Content analysis details: (5.1 points, 5.0 required)
1.7 INVALID_MSGID Message-Id is not valid, according to RFC 2822
3.4 FORGED_MUA_OUTLOOK Forged mail pretending to be from MS Outlook
--------
5.1

Hast Du spammassassin als root oder als user am Laufen? Laufen etwa zwei spamassassin-daemons?

abalorio
11.11.07, 12:55
Richtig, er scheint es zu prüfen - zu markieren und dann noch einmal zu prüfen und durch die Markierungen zu einem anderen Ergebnis zu kommen?!

Es sind folgende Prozesse gestartet:



root 8942 0.0 3.8 66284 38660 ? Ss Nov10 0:04 /usr/sbin/spamd -d -c -L -r /var/run/spamd.pid
root 25151 0.3 4.5 73416 45944 ? S 10:23 0:45 spamd child
root 26652 0.0 4.0 68196 40624 ? S 12:05 0:01 spamd child
root 27914 0.0 0.2 38728 2816 ? Ss 13:36 0:00 sshd: root@pts/0
root 27926 0.0 0.2 9920 2308 pts/0 Ss 13:36 0:00 -bash
root 28301 0.0 0.2 21312 2168 ? Ss 13:48 0:00 /usr/lib/postfix/master
postfix 28314 0.0 0.2 21276 2100 ? S 13:48 0:00 pickup -l -t fifo -u
postfix 28315 0.0 0.2 21936 2800 ? S 13:48 0:00 qmgr -l -t fifo -u
postfix 28316 0.0 0.2 21424 2440 ? S 13:48 0:00 trivial-rewrite -n rewrite -t unix -u
postfix 28319 0.0 0.2 24516 2384 ? S 13:48 0:00 smtp -t unix -u
postfix 28330 0.0 0.2 21296 2068 ? S 13:48 0:00 bounce -z -n defer -t unix -u
postfix 28333 0.0 0.2 24520 2384 ? S 13:48 0:00 smtp -t unix -u
postfix 28336 0.0 0.2 21296 2092 ? S 13:48 0:00 bounce -z -n defer -t unix -u
postfix 28363 0.0 0.2 21276 2100 ? S 13:48 0:00 scache -l -t unix -u
postfix 28375 0.0 0.2 24516 2348 ? S 13:48 0:00 smtp -t unix -u
postfix 28406 0.0 0.2 24516 2356 ? S 13:48 0:00 smtp -t unix -u
postfix 28414 0.0 0.3 31368 3048 ? S 13:48 0:00 smtpd -n smtp -t inet -u -o content_filter spamd
postfix 28415 0.0 0.2 21280 2056 ? S 13:48 0:00 anvil -l -t unix -u
postfix 28418 0.0 0.2 21440 2512 ? S 13:48 0:00 cleanup -z -t unix -u
postfix 28420 0.0 0.2 21280 2112 ? S 13:48 0:00 pipe -n spamd -t unix user=spam argv=/usr/bin/spamc -f -e /usr/sbin
postfix 28425 0.0 0.2 21292 2124 ? S 13:48 0:00 bounce -z -n defer -t unix -u
postfix 28452 0.0 0.2 21292 2124 ? S 13:49 0:00 bounce -z -t unix -u
postfix 28463 0.0 0.2 29260 2940 ? S 13:49 0:00 smtpd -n smtp -t inet -u -o content_filter spamd
postfix 28475 0.0 0.2 21436 2508 ? S 13:50 0:00 cleanup -z -t unix -u
postfix 28479 0.0 0.2 21316 2488 ? S 13:50 0:00 local -t unix


Spamassassin-Version: 3.1.8 (2007-02-13)

Danke für die Hilfe, gruß Abalorio

Blade
11.11.07, 14:35
Ich nutze die gleiche spamassassin-Version. Die laufenden Dienste sehen für mich normal aus.
Den Dienst: pipe -n spamd -t unix user=spam argv=/usr/bin/spamc -f -e /usr/sbin kann ich bei mir nicht finden. Ich nutze allerdings sendmail. Der Eintrag smtpd -n smtp -t inet -u -o content_filter spamd existiert bei Dir 2 mal.

Poste mal den Inhalt Deiner local.cf Konfigutations-Datei und auch den Inhalt Deiner /root/.spamassassin/user_prefs . Im Moment weiß ich leider keinen besseren Tipp.

abalorio
14.11.07, 10:18
In /etc/mail/spamassassin/local.cf steht:



rewrite_header Subject ****SPAM(_SCORE_)****

# Set the score required before a mail is considered spam.
# required_score 5.00

# Enhance the uridnsbl_skip_domain list with some usefull entries
# Do not block the web-sites of Novell and SUSE

ifplugin Mail::SpamAssassin::Plugin::URIDNSBL
uridnsbl_skip_domain suse.de opensuse.org suse.com suse.org
uridnsbl_skip_domain novell.com novell.org novell.ru novell.de novell.hu novell.co.uk
endif # Mail::SpamAssassin::Plugin::URIDNSB



Und in user_prefs:


required_hits 3.0


Hier mal eine weitere eMail die heute durchgekommen ist:



Return-Path: <gonzasa10@spamserver.de>
X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on ns.server.de
X-Spam-Level: **
X-Spam-Status: No, score=2.2 required=3.0 tests=TLD,DATE_IN_PAST_48_96,
NO_REAL_NAME,UNPARSEABLE_RELAY autolearn=no version=3.1.8
X-Original-To: serveruser@ns.server.de
Delivered-To:serveruser@ns.server.de
Received: by ns.server.de (Postfix, from userid 1015)
id DF170100AF92; Wed, 14 Nov 2007 17:47:32 +0100 (CET)
Received: from localhost by ns.server.de
with SpamAssassin (version 3.1.8);
Wed, 14 Nov 2007 17:47:32 +0100
From: <gonzasa10@spamserver.de>
To: email@domain.de
Subject: Official Gold Market Report Issue 1134
Date: Mon, 12 Nov 2007 05:48:12 +0300
Message-Id: <4737BEEC.4010004@spamserver.de>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_473B26A4.5CE3C7EC"

This is a multi-part message in MIME format.

------------=_473B26A4.5CE3C7EC
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Spam detection software, running on the system "ns.server.de", has
identified this incoming email as possible spam. The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email. If you have any questions, see
postmaster for details.

Content preview: The Gold News American Dollar continues to drop as Gold breaks
$800/ounce. Hemisphere Gold (HPGI) $1.00 Gold prices are climbing twice as
fast as last years predictions. Lack of exploration in the 90's has caused
a depleted gold supply and the US dollar has pushed investors to a more secure
investment. [...]

Content analysis details: (7.6 points, 3.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
3.8 HELO_DYNAMIC_DHCP Relay HELO'd using suspicious hostname (DHCP)
3.9 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr
1)
0.4 DATE_IN_PAST_48_96 Date: is 48 to 96 hours before Received: date
1.8 RCVD_ILLEGAL_IP Received: contains illegal IP address
-2.3 BAYES_00 BODY: Bayesian spam probability is 0 to 1%
[score: 0.0000]
...

Blade
14.11.07, 21:22
Füge mal in die /etc/mail/spamassassin/local.cf folgenden Befehl ein:
report_save 1

Ich denke Dein Problem liegt daran, dass spamassassin ohne den Eintrag im Fall eines Spamverdachts eine neue Mail erstellt und diese nochmals prüft. Dieser Eintrag verhindert das und packt die verdächtige Spam-Mail und fügt sie der Infomail als Anhang bei.

Und dann wäre grundsätzlich noch zu empfehlen, unabhängig vom Problem:
use_bayes 1

Damit der Bayes-Filter aber losläuft, musst Du ihn aber zunächst mit Hams und Spams genug füttern. Dann ist er aber unschlagbar gut :-)

abalorio
16.11.07, 06:30
Danke für den Tipp, ich habe es gleich mal eingestellt und teste es nun.

Für den Bayes-Filter ist es möglich folgendes zu realisieren?

1. eMail-Einrichung von spam@domain.de --> /home/root/spam
2. eMail-Einrichtung von ham@domain.de --> /home/root/ham

Anschließend lasse ich per cronjob "sa-learn --spam /home/root/spam" und "sa-lern --ham /home/root/ham" laufen? Oder gerade dann die Daten des eMail-Usere (als ggf. meine eigene eMail unter Spam-Verdacht)? Hast Du da Erfahrungen?

DANKE!!

Blade
16.11.07, 17:47
Das klappt, so ähnlich habe ich spamassassin in unserer Firma auch trainiert. Ich habe User spambox und hambox angelegt an die die Spams und Hams weitergeleitet werden. Nachts per cronjob lernt dann spamassassin mit dem Befehl: sa-learn --spam --mbox /var/spool/mail/spambox die Spams. Hams funktionieren ebenso. Danach wird das mbox-file geleert. Die spambox existiert immer noch, denn wenn mal eine spam durchschlüpft wird sie postwendend an spambox weiter geleitet. Spamassassin benötigt 200 Hams und 100 Spams bevor der Bayes-Filter zu arbeiten beginnt. Wenn der Filter aktiv ist, steht ein Hinweis im Mail-Header drin.

abalorio
20.11.07, 11:25
ABER funktioniert das auch, wenn der User seine eMail schon abgerufen hat... lokal feststellt - DAS IST SPAM - und diese dann an spam@domain.de weiterleitet?

Die eMail ist ja dann durch z.B: "-------- Original-Nachricht -------- xxx-Infos" verfälscht.

Dank DIR für diese ganzen nützlichen Infos und deine Mühen!!!

Blade
20.11.07, 17:51
Ja das funktioniert trotzdem. Ich hatte die gleichen Bedenken. Doch diese Verfälschungen ignoriert spamassassin irgendwie, frag mich aber nicht wie. :o Egal, das einzige was ich vor der Weiterleitung wegmache ist die Zeile:
-------- Original-Nachricht --------
und bei Spams meine eigene
To-Mail-Adresse
Bei Hams lasse ich diese Adresse drin stehen.

Zur Klarstellung. In der Firma haben wir nur POP3-Postfächer, d.h. sie werden vom User richtig geleert. Spamassassin wurde nur mit weitergeleiteten Mails gefüttert und kappiert auch im Nu jede neu gelernte Spam oder Ham.