Amavis bayesien

Bonjour à tous,

j’aimerai vérifier avec vous la bonne mise en place que m’a GW email surtout au niveau de l’apprentissage bayesien! voila le mikmak

ma passerelle email vat chercher dans un dossier spam les emails du meme nom ainsi de des non spam!
en suite je lui donne tout ça a manger. mais malheureusement je n’ai jamais vu passer un email taggué en spam grasse a mon bayesien chérie :wink: voici mon script. merci pour vos retours

[code]#!/bin/bash
#################################################

Mise a jour de la base anti spam

#################################################
date="$(date +"%Y%m%d")“
heur=”$(date +"%T")"
LOG=/var/log/
exec > $LOG/sa-learn-$date.log 2>&1

PATH_SPAM=/root/admin/sa-learn/spam
PATH_NOSPAM=/root/admin/sa-learn/nospam
PATH_BACKUP=/root/admin/sa-learn/backup/
NOM_BACKUP=bayes-$date-$heur.bck

backup de la base bayes

echo -e "## backup de la base bayes $PATH_BACKUP$NOM_BACKUP"
chown -R amavis:amavis $PATH_BACKUP
su amavis -c ‘sa-learn --backup’ > $PATH_BACKUP$NOM_BACKUP

Copie des emails en local

echo -e "## copie des spams"
scp -v root@srv_mail:/home/vbox/mon.domaine/spam/.spam/cur/* $PATH_SPAM
echo -e "## copie des nospams"
scp -v root@srv_mail:/home/vbox/mon.domaine/spam/.nospam/cur/* $PATH_NOSPAM

Changement des permissions pour le sa-learn

chown -R amavis:amavis $PATH_SPAM
chown -R amavis:amavis $PATH_NOSPAM

on deplace les email ds la boite old

echo -e "## Deplacement des email ds dossier old"
ssh root@srv_mail 'bash -c “mv /home/vbox/mon.domaine/spam/.spam/cur/* /home/vbox/mon.domaine/spam/.old_spam/cur/”'
ssh root@srv_mail ‘bash -c “mv /home/vbox/mon.domaine/spam/.nospam/cur/* /home/vbox/mon.domaine/spam/.old_nospam/cur/”’

affiche les stats

echo -e "# STATS"
su amavis -c 'sa-learn --dump magic’
echo -e “#”

on donne a manger a spamassassin

su amavis -c 'sa-learn --no-sync -D --spam --dir /root/admin/sa-learn/spam/'
su amavis -c 'sa-learn --no-sync -D --ham --dir /root/admin/sa-learn/nospam/'
su amavis -c ‘sa-learn --sync’

affiche les stats

echo -e "# STATS"
su amavis -c 'sa-learn --dump magic’
echo -e “#”

archivage des emails

mv /root/admin/sa-learn/spam/* /root/admin/sa-learn/old_spam/
mv /root/admin/sa-learn/nospam/* /root/admin/sa-learn/old_nospam/

echo -e “# FIN”[/code]

Salut j’ai déplacé de T&A à Programmation (script).
Modo, si tu juges que c’est mieux dans support n’hésite pas. :wink:

Le filtre bayesien ne fonctionne qu’à partir de plusieurs milliers de messages analysés, avant spamassassin laisse tout passer.

a partir de 1000 c’est bien ça?

et a quoi correspond le su amavis -c ‘sa-learn --dump magic’ ?

0.000 0 3 0 non-token data: bayes db version 0.000 0 206717 0 non-token data: nspam 0.000 0 139179 0 non-token data: nham 0.000 0 203820 0 non-token data: ntokens 0.000 0 1293084864 0 non-token data: oldest atime 0.000 0 1293462858 0 non-token data: newest atime 0.000 0 1293462860 0 non-token data: last journal sync atime 0.000 0 1293427513 0 non-token data: last expiry atime 0.000 0 169886 0 non-token data: last expire atime delta 0.000 0 19731 0 non-token data: last expire reduction count

Au fait que tu as beaucoup de mails analysés et que ça devrait marcher. Tu as fait un test

$ su amavis $ spamc -t 60 < Exemple_de_mail_avec_entetes_et_tout | less

alors :wink:

[code] spamc -t 60 < 1293442441.M190811P628.mon.domain.fr,S=8807,W=8939:2,a

Return-Path: 1891590z8455@bounce.express-fax.fr
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on srv.mondomaine.fr
X-Spam-Level: ***
X-Spam-Status: No, score=3.8 required=5.0 tests=HTML_IMAGE_RATIO_04,
HTML_MESSAGE,MIME_HTML_ONLY autolearn=no version=3.2.5
X-Original-To: email@mondomaine.fr
Delivered-To: email@mondomaine.fr
Received: from srv.mondomaine.fr (srv.mondomaine.fr [x.x.x.x])
by srv.mondomaine.fr (Postfix) with ESMTP id AAD2496E04E;
Fri, 24 Dec 2010 20:20:53 +0100 (CET)
Received: from localhost (localhost.localdomain [127.0.0.1])
by srv.mondomaine.fr (Postfix) with ESMTP id DAFEE43A4BC;
Fri, 24 Dec 2010 20:28:25 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at srv.mondomaine.fr
Received: from srv.mondomaine.fr ([127.0.0.1])
by localhost (srv.mondomaine.fr [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id HANCZCL5CXhC; Fri, 24 Dec 2010 20:28:24 +0100 (CET)
Received: by srv.mondomaine.fr (Postfix, from userid 1000)
id 9D4BF43A958; Fri, 24 Dec 2010 20:28:24 +0100 (CET)
Received: from mx10.express-fax.fr (mx10.express-fax.fr [195.43.150.217])
by srv.mondomaine.fr (Postfix) with ESMTP id 709A543A4BC
for email@mondomaine.fr; Fri, 24 Dec 2010 20:28:16 +0100 (CET)
Received: by mx10.express-fax.fr (Postfix, from userid 0)
id 9D587D6D3FF; Fri, 24 Dec 2010 19:54:08 +0100 (CET)
Content-Disposition: inline
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Date: Fri, 24 Dec 2010 19:54:08 +0100
From: Alfred DUPONT alfred-dupont-@express-train.ru
To: email@mondomaine.fr
Subject: Calendriers Gestion de Projets 2011 pour votre entreprise
Errors-To: bounce@express-train.ru
X-Feas-Surl: http://mx10.express-fax.fr
Content-Type: text/html; charset=iso-8859-1;
X-Mailer: mx10expressfaxfr
Message-Id: 20101224190858.9D587D6D3FF@mx10.express-fax.fr

PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs
Ly9FTiIgImh0dHA6Ly93d3cudzNjLm9yZy9UUi8xOTk5L1JFQy1odG1sN+
[/code]

avec un fichier test spam

Return-Path: dev_null_sample_spam@example.com X-Spam-Flag: YES X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on srv.mondomaine.fr X-Spam-Level: ******** X-Spam-Status: Yes, score=8.6 required=5.0 tests=DATE_IN_PAST_12_24, DNS_FROM_RFC_DSN,INVALID_DATE,INVALID_MSGID autolearn=no version=3.2.5 X-Spam-Report: =?ISO-8859-1?Q? * 1.7 INVALID_DATE L'en-t=eate Date: est incorrect (il contient AM/PM) * 2.5 DNS_FROM_RFC_DSN RBL: Envelope sender in dsn.rfc-ignorant.org * 1.8 DATE_IN_PAST_12_24 Date: est 12 =e0 24 heures avant la date de * l'en-t=eate Received: * 2.6 INVALID_MSGID Le Message-ID est invalide, selon la RFC-2822?= Delivery-Date: Mon, 22 Jan 2001 12:36:25 +0000 Return-Path: <dev_null_sample_spam@example.com> Delivered-To: dev_null_sample_spam@netnoteinc.com Received: from dogma.slashnull.org (dogma.slashnull.org [212.17.35.15]) by mail.netnoteinc.com (Postfix) with ESMTP id F138F114121 for <dev_null_sample_spam@netnoteinc.com>; Mon, 22 Jan 2001 12:36:21 +0000 (Eire) Received: (from dev_null_sample_spam@localhost) by dogma.slashnull.org (8.9.3/8.9.3) id MAA17343 for dev_null_sample_spam@netnoteinc.com; Mon, 22 Jan 2001 12:36:21 GMT Received: from XeNT.ics.uci.edu (xent.ics.uci.edu [128.195.21.213]) by dogma.slashnull.org (8.9.3/8.9.3) with ESMTP id MAA17336 for <dev_null_sample_spam@jmason.org>; Mon, 22 Jan 2001 12:36:16 GMT From: xl6Ety00V@fismat1.fcfm.buap.mx Received: from blue.mydomain.com (blue.mydomain.com [208.184.130.52]) by XeNT.ics.uci.edu (8.8.5/8.8.5) with ESMTP id EAA16254 for <fork@xent.ics.uci.edu>; Mon, 22 Jan 2001 04:38:11 -0800 (PST) Received: from ns.fundch.cl (unknown [200.28.105.254]) by blue.mydomain.com (Postfix) with ESMTP id C32333424F for <fork@xent.com>; Sun, 21 Jan 2001 20:33:02 -0500 (EST) X-Antispam: rblchk: (RSS) 3 Relayed through blacklisted site 200.28.105.254 Received: from y068k3017 [63.10.249.142] by ns.fundch.cl (SMTPD32-6.00) id A92614DC012A; Sun, 21 Jan 2001 22:21:26 -0400 DATE: 21 Jan 01 8:24:27 PM Message-ID: <N1msdrbJXNPfV4wg9> Subject: /!\ SPAM /!\ Home Based Business for Grownups To: undisclosed-recipients: ; Sender: dev_null_sample_spam@example.com X-Spam-Prev-Subject: Home Based Business for Grownups
alors doc?

[edit: J’ai viré le nom de Chloë et l’adresse email récupérable]

Le deuxième porte bien un drapeau «X-Spam-Flag: YES», c’est donc au niveau du traitement de ce drapeau que ça coince dans ta chaine de traitement. Les règles bayésiennes fonctionnent