Le Tue, 20 Jan 2004 17:33:02 +0000, [EMAIL PROTECTED] a d�cor� sont
�cran avec :

> Bonsoir,

Bonsoir,

> Existe-il une documentation fran�aise permettant le couple
> postfix/clamav/spamassassin ?
> J'ai bien r�ussi � installer postfix/clamav mais spamassassin me pose
> qque souci.
> J'aimerai utiliser spamd pour rediriger les spam vers /dev/null :)
> Mais je ne trouve pas la ligne � rajouter dans master.cf / main.cf
>
> Si la doc n'existe pas je veux bien la faire !

J'ai pas utilis� de doc mais les man.

2 possibilit�s :

La premi�re :

- Utiliser Amavis avec Clamav et Spamassassin
Dans ce cas, il faut juste dire � postfix de faire passer tes mails 
dans Amavis et configurer Amavis pour qu'il utilise Clamav et
Spamassassin. Par contre, je sais pas si Amavis utilise spamd ou si 
il utilise spamassassin.

==========================
== /etc/postfix/master.cf: (Morceau choisit)
==========================
# Le SMTP qui passe par inet est renvoy� au demonn amavisd sur
# le port 10024 en local
smtp      inet  n       -       -       -       -       smtpd
        -o content_filter=smtp-amavis:[127.0.0.1]:10024
# Le SMTP qui passe par unix passe pas par Amavis
smtp      unix  -       -       -       -       -       smtp

# config du content_filter
smtp-amavis unix -      -       n       -       2  smtp
    -o smtp_data_done_timeout=1200
    -o disable_dns_lookups=yes

# Ecoute le r�sultat d'amavisd sur le port 10025 et le fait transit�
# en SMTP
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_client_restrictions=
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -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
==============================
== Fin /etc/postfix/master.cf:
==============================

====================================================================
== Amavisd.conf (morceau choisit le amavid.conf est assez d�taill�):
====================================================================
# POSTFIX, or SENDMAIL in dual-MTA setup, or EXIM V4
# (set host and port number as required; host can be specified
# as IP address or DNS name (A or CNAME, but MX is ignored)
$forward_method = 'smtp:127.0.0.1:10025';  # where to forward checked mail
$notify_method = $forward_method;          # where to submit notifications

# Commenter la ligne suivante pour utiliser spamassassin
[EMAIL PROTECTED]  = qw( . ); 

# Mes r�glages a 4 spam det�ct�, a 8 je drop
# default values, can be overridden by more specific lookups, e.g. SQL
#$sa_tag_level_deflt  = 4.0; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 4.0; # add 'spam detected' headers at that level
$sa_kill_level_deflt = 8.0; # triggers spam evasive actions
                           # at or above that level: bounce/reject/drop,
                           # quarantine, and adding mail address extension
========================================================================
== Fin Amavisd.conf (morceau choisit le amavid.conf est assez d�taill�):
========================================================================


Le probl�me c'est que les ent�tes antispams sont mis par Amavis et j'aime pas
ne pas avoir le d�tail sur les spams donc j'ai fais :

2eme solution :

Amavis avec Clamav puis passage dans spamd.
==========================
== /etc/postfix/master.cf: (Morceau choisit)
==========================
# Le SMTP qui passe par inet est renvoy� au demonn amavisd sur
# le port 10024 en local
smtp      inet  n       -       -       -       -       smtpd
        -o content_filter=smtp-amavis:[127.0.0.1]:10024
# Le SMTP qui passe par unix passe pas par Amavis
smtp      unix  -       -       -       -       -       smtp

# config du content_filter
smtp-amavis unix -      -       n       -       2  smtp
    -o smtp_data_done_timeout=1200
    -o disable_dns_lookups=yes

# Ecoute le r�sultat d'amavisd sur le port 10025 et le fait transit�
# en SMTP
127.0.0.1:10025 inet n  -       n       -       -  smtpd
    -o content_filter=spamassassin # <---- Changement par rapport � avant
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o smtpd_restriction_classes=
    -o smtpd_client_restrictions=
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -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

# R�gle pour spamassassin
spamassassin unix -     n       n       -       -       pipe
   user=spamassassin argv=/etc/postfix/spamfilter.sh -f ${sender} -- 
${recipient}
==============================
== Fin /etc/postfix/master.cf:
==============================


==============================
== /etc/postfix/spamfilter.sh: 
==============================
#!/bin/sh
#
SENDMAIL="/usr/lib/sendmail -i"
SPAMASSASSIN=/usr/bin/spamc

EX_UNAVAILABLE=69

$SPAMASSASSIN -f 2>/dev/null \
        | $SENDMAIL "$@" || \
        { echo Message content rejected; exit $EX_UNAVAILABLE; }

exit 0
==================================
== Fin /etc/postfix/spamfilter.sh:
==================================


=================
== Amavisd.conf : (Morceau choisit)
=================
# POSTFIX, or SENDMAIL in dual-MTA setup, or EXIM V4
# (set host and port number as required; host can be specified
# as IP address or DNS name (A or CNAME, but MX is ignored)
$forward_method = 'smtp:127.0.0.1:10025';  # where to forward checked mail
$notify_method = $forward_method;          # where to submit notifications

# D�commenter la ligne suivante pour pas utiliser spamassassin
@bypass_spam_checks_acl  = qw( . ); 
=====================
== Fin Amavisd.conf :
=====================

==============================
== /etc/spamassassin/local.cf:
==============================
# This is the right place to customize your installation of SpamAssassin.
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
# tweaked.
#
###########################################################################
#

# How many hits before a message is considered spam.
required_hits           5.0

# Whether to change the subject of suspected spam
rewrite_subject         1

# Text to prepend to subject if rewrite_subject is used
subject_tag             [**SPAM**]

# Encapsulate spam in an attachment
always_add_report 1
report_safe             0

# Use terse version of the spam report
use_terse_report        1

# Enable the Bayes system
use_bayes               1

# Enable Bayes auto-learning
auto_learn              1

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

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages            all

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales              all


# Check WillSpamForFood RBL
header RCVD_IN_WSFF             eval:check_rbl('wsff', 
'will-spam-for-food.eu.org.')
describe RCVD_IN_WSFF           Received from will-spam-for-food, see 
http://www.rfc1149.net/wsff
tflags RCVD_IN_WSFF             net
score RCVD_IN_WSFF              3.0

# Disabling OSIRUSOFT
score RCVD_IN_OSIRUSOFT_COM 0
score X_OSIRU_DUL 0
score X_OSIRU_DUL_FH 0
score X_OSIRU_OPEN_RELAY 0
score X_OSIRU_SPAMWARE_SITE 0
score X_OSIRU_SPAM_SRC 0
score RCVD_IN_ORBS 0
==================================
== Fin /etc/spamassassin/local.cf:
==================================



Voil� mes solutions. Personnelement j'utilise la 2eme solution car 
j'aime bien avoir le d�tail sur les notes de spamassassins.
J'utilise procmail pour d�placer les spams vers une bo�te IMAP s�par�
qui est utilis� pour mon sa-learn.

D�sol� si c'est un peu brouillons.
En esp�rant que cela r�pond � ta demande.

Cordialement,

ME� S�bastien

Répondre à