Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parserutils.php on line 202

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parserutils.php on line 205

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parserutils.php on line 314

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parserutils.php on line 454

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/auth.php on line 146

Warning: Cannot modify header information - headers already sent by (output started at /home/www/web535/html/dokuwiki/inc/parserutils.php:202) in /home/www/web535/html/dokuwiki/inc/auth.php on line 236

Warning: Cannot modify header information - headers already sent by (output started at /home/www/web535/html/dokuwiki/inc/parserutils.php:202) in /home/www/web535/html/dokuwiki/inc/actions.php on line 128
linux:spamassassin-howto [wiki.BerndLux.de]
 

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/parser.php on line 66

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 292

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/handler.php on line 22

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/handler.php on line 44

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/handler.php on line 208

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/handler.php on line 236

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/handler.php on line 290

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/handler.php on line 323

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/handler.php on line 560

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Function split() is deprecated in /home/www/web535/html/dokuwiki/inc/parser/lexer.php on line 510

Deprecated: Assigning the return value of new by reference is deprecated in /home/www/web535/html/dokuwiki/inc/parser/xhtml.php on line 980

MTA server mit Spamassassin

Ein kleines HowTo wie man eine Mail Server für Spamassassin configuriert.
Diese HowTo bezieht sich auf Debian testing etch (4.0-pre)
mit:

  • der Server sollte so weit configuriert sein und sicher funktionieren
  • Mails werden in $HOME/Maildir/ im Maildir format abgelegt

:!:Achtung: Diesese Beispiele beziehen sich auf meine Server, und müssen eventuell angepasst werden :!:

Configuration

  1. SpamAssassin Installieren

unter Debian reicht ein

apt-get install spamassassin
  1. als root eine Datei /usr/bin/postfixfilter mit dem folgendem Inhalt erstellen
#!/bin/bash
/usr/bin/spamc | /usr/sbin/sendmail -i "$@"
exit $?
  1. Rechte auf ausführbar setzen
chmod 755 /usr/bin/postfixfilter
  1. einen Benutzer “spamfilter” mit loginshell und home verzeichnis anlegen (mit adduser zB)
  1. In /etc/postfix/master.cf in der Section “Services” folgendes einfügen (-o in neuer Zeile !)
# -----------------------------------------------------------------------------------
smtp inet n - n - - smtpd
  -o content_filter=spamfilter:
# -----------------------------------------------------------------------------------
  1. wieder in /etc/postfix/master.cf in der Section “Interfaces to non-Postfix software” hinzufügen
# -----------------------------------------------------------------------------------
spamfilter unix - n n - - pipe
  flags=Rq user=spamfilter argv=/usr/bin/postfixfilter -f ${sender} -- ${recipient}
# -----------------------------------------------------------------------------------
  1. postfix neu starten und kontrollieren ob der mailemfang immernoch funktiniert
  1. Globals Spamfiltern sollte nun schon Funktionieren!

Aller spamm wird jetzt Markiert. Für die weitere configuration vom spamassassin die Seite http://www.spamassassin.org besuchen.

Locales Filtern der nachrichten

Möchte man nun das die als Spam Markierten mails aussortiert werden hier fortfahren.

  1. wenn noch nicht installiert, procmail installieren
  1. Für jeden User dessen Mails gefiltert werden sollen eine Datei ~/.procmail erstellen

Die Mails werden im Maildir Format abgelegt und spam wird in den unterordner junk-mail sortiert. Am besten verwendet man ab jetzt IMAP um die mails abzurufen, das unter umständen der Ordner junk-mail vom POP3 nicht berücksichtigt wird.
Auch muss man unter Mozilla das Verzeichnis explizit Abonieren um diese Mails zu erhalten.

# -----------------------------------------------------------------------------------
#VERBOSE=yes
#LOGABSTRACT=all
# add to see more logging
# 
#MAILDIR=$HOME/Mail
#PROCMAILDIR=$HOME/.Procmail

 MAILDIR=$HOME/Maildir/
 DEFAULT=$HOME/Maildir/
 LOGFILE=$HOME/Maildir/proc.log
 
 # Catch SPAM
# :0
# * ^X-Spam-Flag: YES
# * ^X-Spam-Level: \*\*\*\*\*\*
# $MAILDIR/.junk-mail/
# add to catch spam in an extra folder
# it has to be "abonomentet" if youll see the spam
# not usabele with pop3!!
# bernd http://berndlux.de 2006.12.05
# # -----------------------------------------------------------------------------------

Explanation of the above -

  • MAILDIR is the location of mailbox folders
  • DEFAULT is the default mailbox.
  • “* ^X-Spam-Flag: YES” makes sure the email is marked as spam before doing anything with it.
  • “* ^X-Spam-Level: \*\*\*\*\*\*” make sure the spam received a ‘spam score’ of at least 6 before doing anything with it. This ensures that ‘borderline’ cases that are more likely to be ‘false positives’ (meaning they have been falsely marked as spam) do not go into the spam mailbox.
  • ‘junk-mail’ is the name of the mailbox they are going into.
  1. Create a file in their home directory, owned by them, called ‘.forward’. Enter the following into it, changing eventually ‘$USER’ to their username. Include the quotes and the pound (”#”) symbol!
"|IFS=' ' && exec /usr/bin/procmail || exit 75 #$USER"
  1. eventuell beide Dateien nach /etc/skel/ kopieren, so werden diese beim erstellen neuer Benutzer gleich in deren Home Verzeichnisse kopiert.

Hinweise

:!:spamassassin immer Aktuell Halten! :!:

:!:Ein anghängter slash in einem Mailbox Pfad setzt bei Procmail und den meisten anderen hier beschrieben Programmen das Speicherformat von mbox zu Maildir! :!:

Quellen und Links

 
linux/spamassassin-howto.txt · Zuletzt geändert: 2006/12/05 14:52 von bernd
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki