PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Spamassassin local.cf



eckerth
05.10.04, 07:50
Hi,
hab da mal ne Verständnisfrage.
Wenn SA installiert ist, so werden doch alle *.cf files in der /etc/mail/spamassassin/ verarbeitet.

In dieser local.cf kann ich doch auch ein rewrite des headers vornehmen.

Nun finde ich auf http://www.ijs.si/software/amavisd/ folgendes statement:


amavisd-new does not modify mail body or lets SA do it (with the exception of defanging, introduced with amavisd-new-2.0). All mail (header) editing is done by amavisd-new and not by SA. Even though SA does observe options in its configuration file to rewrite mail body and modify mail header, the result is purposely not used by amavisd-new. There are two reasons for that: SA is only called once per message regardless of the number of recipients, and secondly, to be able to offer a guarantee the mail body will not be altered, This means the per-recipient handling of mail relaying and header editing needs to be done entirely in amavisd-new, as there are no provisions in SA to analyze mail once and then prepare different modifications for different recipients, based on the same spam analysis. It is a tradeoff: speed for multi-recipient mail versus the full per-recipient flexibility. It would make no sense to fully duplicate the spamc/spamd functionality in amavisd-new. If you need such features, just disable calling SA from amavisd-new, and use the spamc/spamd or other backend interface to SA.

Versteh ich das nun richtig, das amavis den header umschreiben kann, nicht aber die local.cf oder ist da bei mir doch noch was falsch eingestellt ?

Was will ich erreichen ?
- Meine Mails sollen mit SPAM+Hits im Subject in die Mailbox kommen
- Wenn der Hit > 5 ist soll die mail im Body in ein txt.attachement umkopiert werden und der genaue SA-bericht in der mail stehen.

Was hab ich:
- suse 9.1
- fetchmail --> postfix --> amavis --> spamassassin --> cyrus

Was geht:
bis amavis funzt alles richtig, die mails werden (von amavis) auch als
spam getagged, nicht aber von der local.cf.


und hier die wesentlichen cf-datein:


main.cf
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
default_transport = smtpreadme_directory = /usr/share/doc/packages/postfix/README_FILES
mailbox_command = /usr/lib/cyrus/bin/deliver
mailbox_transport = cyrus
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, $mydomain
mydomain = sol
myhostname = mars.sol
mynetworks = 192.168.0.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
relayhost = smtp.hamburg.de
sample_directory = /usr/share/doc/packages/postfix/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
unknown_local_recipient_reject_code = 450


master.cf
command + args
# (yes) (yes) (yes) (never) (100)
# ================================================== ========================
#smtp inet n - y - 2 smtpd
smtp inet n - y - 2 smtpd -o content_filter=smtp:[localhost]:10024
#smtps inet n - n - 2 smtpd -o smtpd_tls_wrappermode=yes -o content_filter=smtp:[localhost]:10024
# -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 oqmgr
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
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
anvil unix - - n - 1 anvil
localhost:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipent_maps=
-o mynetworks=127.0.0.0/8
-o smtpd_helo_restrictions=
-o smtpd_client_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,rej ect
smtp-amavis unix - - y - 50 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
#
# 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 - 4 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}




amavis.conf
# SpamAssassin settings

$sa_local_tests_only = 0;
$sa_auto_whitelist = 1;
$sa_timeout = 30;
$sa_mail_body_size_limit = 150*1024;

$sa_tag_level_deflt = 1.0;
$sa_tag2_level_deflt = 2.5;
$sa_kill_level_deflt = 20.0;
$sa_dsn_cutoff_level = 10;

# string to prepend to Subject header field when message exceeds tag2 level
$sa_spam_subject_tag = '[SPAM]';

$sa_spam_modifies_subj = 1;

danke schonmal.
tom

eckerth
08.10.04, 19:10
*** schieb *** weiss jemand rat ?

Ikarisan
01.01.05, 22:56
Hi!

Hast du eine Lösung gefunden?
Ich habe mir nämlich eben auch Amavis, Spamassassin 3 und ClamAV installiert. Der Virenscanner funktioniert einwandfrei, nur die Spammails werden nicht als solche markiert. Im Header fehlen die "X-Spam-*:" Zeilen komplett. Ich habe mir jetzt folgendermaßen beholfen:

master.cf


smtp inet n - - - - smtpd
-o content_filter=spamassassin

[...]

# Spamassassin
spamassassin unix - n n - - pipe
user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f $(sender) $(recipient)

[...]

# Amavis
smtp-amavis unix - - y - 2 smtp
-o smtp_data_done_timeout=1200
-o disable_dns_lookups=yes


[...]

127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_restriction_classes=
-o smtpd_helo_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,rej ect
-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

[...]


Sollte amavis-new doch Spamassassin aufrufen ruft Postfix selber spamc halt noch mal auf. Als Übergangslösung funktioniert das momentan. Aber wenn erst einmal viele Mails aufkommen wird das dadurch alles bestimmt sehr langsam werden.

Was machen wir denn falsch?

Gruß
Thorsten

eckerth
01.01.05, 23:50
Hi Thorsten,

die local.cf hab ioch nicht zum laufen gekriegt, habe aber in /etc/amavisd.conf
folgende einträge und mit denen findet SA allen SPAM und markiert diesen dann auch wunderbar.

# default values, can be overridden by more specific lookups, e.g. SQL
$sa_tag_level_deflt = -999; # jeder header wird geändert
# default: 3.0 add spam info headers if at, or above that level
$sa_tag2_level_deflt = 2.5;
$sa_kill_level_deflt = 20.0; # ab diesem level wird direkt gelöscht
#$sa_tag2_level_deflt; # triggers spam evasive actions
# at or above that level: bounce/reject/drop,
# quarantine, and adding mail address extension


gr
thomas

Blade
02.01.05, 12:08
Hallo Thomas,
bei Deiner geschilderten Konstellation kannst Du auf Amavis ganz verzichten. Dann funzt auch spamassassin wieder ganz normal.

Ich setzte folgedes Szenario ein ... ohne Amavis:
- suse 8.2
- fetchmail --> spamassassin -->AntiVir --> sendmail --> qpopper

Ich habe ganz einfach AntiVir als milter-Paket installiert und eingerichtet und im Nachgang dann spamassassin und per local.cf konfiguriert, so wie Du es gesagt hast.