SpamAssassin : Différence entre versions

De Wiki NCad
Aller à : navigation, rechercher
(Installation)
Ligne 3 : Ligne 3 :
 
== Installation ==
 
== Installation ==
  
=== Ubuntu ===
+
* Il est nécessaire d'installer '''spamassassin''' mais aussi les paquets '''razor''' et '''pizor''' pour la détection des messages considérés comme SPAM :
  
* Installation du paquet Spamassassin :
+
{{ Box_Console | objet=sudo apt-get install spamassassin pyzor razor}}
  
{{ Box_Console | objet=sudo apt-get install spamassassin }}
+
== Configuration de base ==
  
 
=== Configuration de /etc/default/spamassassin ===
 
=== Configuration de /etc/default/spamassassin ===

Version du 6 février 2014 à 13:05

ICON boxWarning.png

Suite à la nouvelle version de l'article Postfix, cet article doit être mis à jour.


Installation

  • Il est nécessaire d'installer spamassassin mais aussi les paquets razor et pizor pour la détection des messages considérés comme SPAM :
ICON Terminal.png

sudo apt-get install spamassassin pyzor razor

Configuration de base

Configuration de /etc/default/spamassassin

Pour que le service puisse être lancé :

  • Modifier :
ENABLED=0
  • Par :
ENABLED=1

Configuration de /etc/spamassassin/local.cf

Renseigner le fichier comme tel :

rewrite_header Subject [***** SPAM _SCORE_ *****]
required_score           2.0
#to be able to use _SCORE_ we need report_safe set to 0
#If this option is set to 0, incoming spam is only modified by adding some "X-Spam-" headers and no changes will be made to the body.
report_safe     0

# Enable the Bayes system
use_bayes               1
use_bayes_rules         1
# Enable Bayes auto-learning
bayes_auto_learn        1

# Enable or disable network checks
skip_rbl_checks         0
use_razor2              0
use_dcc                 0
use_pyzor               0

Intégration pour Postfix

Configuration de /etc/postfix/master.cf

  • En début de fichier, modifier :
smtp      inet  n       -       -       -       -       smtpd
  • Par :
smtp      inet  n       -       -       -       -       smtpd
       -o content_filter=spamassassin
  • En fin de fichier ajouter :
spamassassin unix -     n       n       -       -       pipe
       user=spamd argv=/usr/bin/spamc -f -e
       /usr/sbin/sendmail -oi -f ${sender} ${recipient}

Finalisation de l'installation

Démarrer / Redémarrer Spamassassin

ICON Terminal.png

/etc/init.d/spamassassin stop
/etc/init.d/spamassassin start

Redémarrer Postfix

ICON Terminal.png

/etc/init.d/postfix restart