PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Integration von Spamassassin in Fetchmail-Postfix-Cyrus-System



AndreasMeier
05.10.05, 22:51
Hallo zusammen,

ich suche ein aktuelles Howto zur Integration von Spamassassin in ein bereits laufendes Suse-System mit Postfix-Cyrus IMAP, Fetchmail.

Ich hab bereits gegoogelt, aber es finden sich vornehmlich ältere Howtos an, bzw. die nicht auf meine verwendeten Komponenten abzielen.

Ich möchte nämlich anstatt Procmail den Sieve-Filter verwenden.
Dazu noch ein Konstrukt von Amavis und einem Antiviren-Scanner,
wahrscheinlich ClamAV oder OpenAntivirus.
Abgeholt werden die Mails von Fetchmail.

Die Thematik ist ja bestimmt schon irgendwo ausführlich aufgearbeitet, vielleicht hat einer von euch einen Link dazu griffbereit.

Herzlichen Dank im voraus,
Gruß
Andreas

jac
06.10.05, 11:44
Siehe dazu Artikel in der c't 21/05:

"Reinwaschgang" - Mailserver sortiert Spam aus.

Beschreibt Postfix, Amavis, SpamAssassin & Sieve. Amavis kommt etwas kurz, wurde aber glaube ich in dem referenzierten Artikel aus der c't 17/05 behandelt.

Gruß

Fly
06.10.05, 12:25
Hallo zusammen,

ich suche ein aktuelles Howto zur Integration von Spamassassin in ein bereits laufendes Suse-System mit Postfix-Cyrus IMAP, Fetchmail.

Hallo Andreas! Ich habe in den letzten Tagen viel mit amavisd-new und spamassassin gemacht. Welche Version von Spamassassin und Amavisd-new verwendest du? Ich habe auch ein sehr interessanten Link von Roger Wilco: http://www.ijs.si/software/amavisd/#faq-spam

AndreasMeier
06.10.05, 14:41
@jac,

hab ich auch gelesen und es stimmt - die Amavis-Anbindung kommt in dem Artikel zumindest zu kurz.

@Fly,
danke für den Link, werd ich mir heut abend durchlesen.
Ebenso wie diesen Link :
http://www.bieli.de/main/
Da geht es auch um die Einbindung von Amavis / Spamassassin etc.

Welcher Mail-Virenscanner ist denn zur Einbindung zu empfehlen ?


Gruß
Andreas

Tomek
06.10.05, 15:53
Welcher Mail-Virenscanner ist denn zur Einbindung zu empfehlen ?
Ich kann den freien Clamav empfehlen. Allerdings gibt es noch viele andere Virenscanner. Benutze bitte mal dazu die Forensuche.

AndreasMeier
08.10.05, 12:53
Ok, nun hab ich folgendes laufen :
Zusätzlich zum Postfix-Cyrus hab ich Amavis sowie ClamAV installiert.
Die Mail bekommen einen zusätzlichen Headereintrag
"X-Virus-Scanned: by amavisd-new at home.int"

Aber was mir jetzt noch fehlt, ist die korrekte Weitergabe an SpamAssassin.
Ich dachte, dass Amavis das selbständig macht.
Bin aber durch den CT-Artikel verunsichert.
Dort wird nämlich in der master.cf für den Postfix mehrere Einträge aufgenommen, die den Transport von Postfix zuerst zum Amavis/Virenscanner, zurück zum Postfix, dann weiter zum SpamAssassin und wieder zurück zum Postfix und letztendlich in dei Postfächer.

Im Moment hab ich folgenden Eintrag in der main.cf erweitert:
content_filter = smtp-amavis:[127.0.01]:10024

In der master.cf steht u.a. folgendes:
smtp-amavis unis - - n - 2 - smtp
-o smtp_data_done_timeout=1800
-o disable_dns_lookups=yes
smtp inet n - n - - smtpd
localhost:10025 inet n - n - - smtp -o content_filter=

Damit klappt der Amavis/Virenscanner.

Meine amavis.conf schaut so aus (gekürzt soweit möglich):


use strict;
#
# Section I - Essential daemon and MTA settings
#
$MYHOME = '/var/spool/amavis';
$mydomain = 'home.int';
$daemon_user = 'vscan';
$daemon_group = 'vscan';
$TEMPBASE = $MYHOME; # (must be set if other config vars use is)
#$TEMPBASE = "$MYHOME/tmp"; # prefer to keep home dir /var/amavis clean?
#$helpers_home = $MYHOME; # (defaults to $MYHOME)
$ENV{TMPDIR} = $TEMPBASE; # wise to set TMPDIR, but not obligatory
# MTA SETTINGS, UNCOMMENT AS APPROPRIATE,
$forward_method = 'smtp:127.0.0.1:10025'; # where to forward checked mail
$notify_method = $forward_method; # where to submit notifications
$max_servers = 2; # number of pre-forked children (default 2)
$max_requests = 10; # retire a child after that many accepts (default 10)
$child_timeout=5*60; # abort child if it does not complete each task in n sec
# (default: 8*60 seconds)
# Check also the settings of @av_scanners at the end if you want to use
# virus scanners. If not, you may want to delete the whole long assignment
# to the variable @av_scanners, which will also remove the virus checking
# code (e.g. if you only want to do spam scanning).
# Here is a QUICK WAY to completely DISABLE some sections of code
# that WE DO NOT WANT (it won't even be compiled-in).
# For more refined controls leave the following two lines commented out,
# and see further down what these two lookup lists really mean.
#
# @bypass_virus_checks_acl = qw( . ); # uncomment to DISABLE anti-virus code
# @bypass_spam_checks_acl = qw( . ); # uncomment to DISABLE anti-spam code
@local_domains_acl = qw( ".$mydomain" ); # you may want to use qw() to check all in and out <== ist neu
#
# Section II - MTA specific (defaults should be ok => hab ich auch so belassen !!!)
#
#
# Section III - Logging => hab ich auch so belassen !!!
#
#
# Section IV - Notifications/DSN, BOUNCE/REJECT/DROP/PASS destiny, quarantine
#
$final_virus_destiny = D_DISCARD; # (defaults to D_BOUNCE) <== ist neu
$final_banned_destiny = D_REJECT; # (defaults to D_BOUNCE) <== ist neu
$final_spam_destiny = D_PASS;
$final_bad_header_destiny = D_PASS; # (defaults to D_PASS), D_BOUNCE suggested
# Notify virus sender?
#$warnvirussender = 1; # (defaults to false (undef))
# Notify spam sender?
#$warnspamsender = 1; # (defaults to false (undef))
# Notify sender of banned files?
#$warnbannedsender = 1; # (defaults to false (undef))
# Notify sender of syntactically invalid header containing non-ASCII characters?
#$warnbadhsender = 1; # (defaults to false (undef))
# Notify virus (or banned files) RECIPIENT?
# (not very useful, but some policies demand it)
#$warnvirusrecip = 1; # (defaults to false (undef))
#$warnbannedrecip = 1; # (defaults to false (undef))
# Notify also non-local virus/banned recipients if $warn*recip is true?
# (including those not matching local_domains*)
#$warn_offsite = 1; # (defaults to false (undef), i.e. only notify locals)
# similar for spam
# (the default value is undef, meaning no quarantine)
#
$spam_quarantine_to = undef;
#$spam_quarantine_to = "spam-quarantine\@$mydomain";
#$spam_quarantine_to = new_RE( # per-recip multiple quarantines
# [qr'^(.*)@example\.com$'i => 'spam-${1}@example.com'],
# [qr/.*/ => 'spam-quarantine'] );
# Add X-Virus-Scanned header field to mail?
$X_HEADER_TAG = 'X-Virus-Scanned'; # (default: undef)
# Leave empty to add no header field # (default: undef)
$X_HEADER_LINE = "by amavisd-new at $mydomain";

# a string to prepend to Subject (for local recipients only) if mail could
# not be decoded or checked entirely, e.g. due to password-protected archives
$undecipherable_subject_tag = '***UNCHECKED*** '; # undef disables it

$remove_existing_x_scanned_headers = 0; # leave existing X-Virus-Scanned alone
#$remove_existing_x_scanned_headers= 1; # remove existing headers
# (defaults to false)
#$remove_existing_spam_headers = 0; # leave existing X-Spam* headers alone
$remove_existing_spam_headers = 1; # remove existing spam headers if
# spam scanning is enabled (default)
#
# Section V - Per-recipient and per-sender handling, whitelisting, etc. => alles so belassen
#
#
# Section VI - Resource limits => alles so belassen
#
#
# Section VII - External programs, virus scanners
#
# SpamAssassin settings
# $sa_local_tests_only is passed to Mail::SpamAssassin::new as a value
# of the option local_tests_only. See Mail::SpamAssassin man page.
# If set to 1, SA tests are restricted to local tests only, i.e. no tests
# that require internet access will be performed.
#
$sa_local_tests_only = 1; # (default: false)
#$sa_auto_whitelist = 1; # turn on AWL (default: false)
$sa_timeout = 30; # timeout in seconds for a call to SpamAssassin
# (default is 30 seconds, undef disables it)
$sa_mail_body_size_limit = 150*1024; # don't waste time on SA if mail is larger
# (less than 1% of spam is > 64k)
# default: undef, no limitations
# default values, can be overridden by more specific lookups, e.g. SQL
$sa_tag_level_deflt = 3.0; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 5.0;
$sa_kill_level_deflt = $sa_tag2_level_deflt; # triggers spam evasive actions
# at or above that level: bounce/reject/drop,
# quarantine, and adding mail address extension
$sa_dsn_cutoff_level = 10; # spam level beyond which a DSN is not sent,
# effectively turning D_BOUNCE into D_DISCARD;
# undef disables this feature and is a default;
$sa_spam_subject_tag = '***SPAM*** '; # (defaults to undef, disabled)
# (only seen when spam is not to be rejected
# and recipient is in local_domains*)
$sa_spam_modifies_subj = 1; # may be a ref to a lookup table, default is true
# => Rest so belassen !!!!
#
# Section VIII - Debugging => alles so belassen
#
1; # insure a defined return


Kann ich an der amavis.conf noch irgendwas ändern, damit gleich dort der SpamAssassin mit angesprochen wird.
Die nötigen Tags sind ja m.E. bereits enthalten.
So kam ich auch zu der Meinung, dass ich in der main.cf sowie master.cf nix weiter machen müsste.

Bitte um ein paar Tips, wie ich SpamAssassin noch aktivieren kann bzw. was ich auch noch verbessern könnte.

Herzlichen Dank im voraus,
Gruß
Andreas

Fly
11.10.05, 16:49
Ist dein Problem noch aktuell? Mein System läuft mit SA sehr gut, die SPAMs werden jetzt sehr gut erkannt bzw. markiert! Wenn du mir die Version von amavisd-new bzw. SA bekannt gibst, kann ich dir vielleicht weiterhelfen.

AndreasMeier
11.10.05, 20:14
Ja, leider ist mein Problem noch brandaktuell.
Hab gestern bis 1 Uhr nachts dran rumgedoktert,
leider mit negativem Erfolg :mad:
Jetzt musste ich die allerursprüngliche Konfig ohne Amavis wieder herstellen, ansonsten wäre hier nix mehr gelaufen.

Zu meinen Versionen :
Suse 9.1
Postfix v2.1.1
Amavisd-new v20030616p9
Spamassassin v2.64
Cyrus-imapd v2.2.3

Du würdest mir nen sehr grossen Gefallen tun, wenn Du mir Deine main.cf, master.cf, spamd.conf und die amavis.conf posten/mailen könntest. Die beiden letzteren sind allerdings nicht so das Problem, Hauptproblem ist und bleibt meine master.cf.
Diese Transporte machen mich echt verrückt.

Sag mal, verwendest Du den spamd oder evtl. den spampd.
Letzterer ist ein SpamAssassinProxyDaemon.
Spamd verwendet ja nur pipes zur Mailweitergabe.
In dem oben diskutierten CT-Artikel wird der spampd zum Download (http://www.heise.de/ct/ftp/05/21/210/) angeboten.
Allerdings komm ich damit auch nicht zurecht.

Herzlichen Dank im voraus,
Gruß
Andreas

Fly
12.10.05, 08:13
Ich habe schon vor kurzem meine master.cf bzw. main.cf gepostet. Poste du mal deine master.cf, wenn du meinst, dass da was nicht stimmt. So können wir alle hier im Forum dir helfen. Beschreib doch mal dein Problem. Ich verwende fast die gleiche Versionen wie du, jedoch dein Spamassassin ist sehr alt. Lade hier (http://spamassassin.apache.org/downloads.cgi?update=200504281430) die aktuelle Version von SA herunter.

AndreasMeier
14.10.05, 10:13
Hi Fly,

danke für Dein Angebot.
Ich muß heut abend erstmal Amavis wieder einbinden, da ich meine Uralt-Konfig (die ohne Amavis und SpamAssassin lief) wieder herstellen musste.

Danach kann ich meine Master.cf posten.

Bis dann,
Gruß
Andreas