Précédent   Forum des professionnels en informatique > Systèmes > Linux > Applications
Applications Questions sur l'utilisation d'applications, du shell, et des interfaces graphiques (KDE, Gnome, XFCE... )
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 12/12/2007, 15h54   #1
Membre chevronné
 
Inscription : mai 2004
Messages : 818
Détails du profil
Informations forums :
Inscription : mai 2004
Messages : 818
Points : 706
Points : 706
Par défaut postfix et spamassassin

bonjour

j'ai installé recemment postfix et cela fonctionne
je lui ai adjoint spamassassin
en le configurant de la sorte :

dans le main.cf de postfix je place

smtp inet n - n - - smtpd -o content_filter=spamassassin:
et
spamassassin unix - n n - - pipe flags=Rq user=spamassassin argv=/usr/bin/spamassassin.sh -f ${sender}

spamassassin.sh est rendu executable et lancé
les daemons spamd , spamc et postfix sont lancés
les logs sont examinés , pas d'erreur

malgré cela , dans un message de test que je m'envoie à moi-même
je n'ai dans mes en-têtes , rien qui indique que spamassassin a filtré mon mail

voici un exemple pour un filtrage de mail =3
mes en-têtes;
Xaccount-key account=3

et aucune trace de spamassassin
il doit y avoir un moyen pour faire un test plus approfondi

merci pour votre aide
deny est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/12/2007, 16h16   #2
Membre chevronné
 
Inscription : mai 2004
Messages : 818
Détails du profil
Informations forums :
Inscription : mai 2004
Messages : 818
Points : 706
Points : 706
Je n'ai pas de reseau à l"exterieur pour m'envoyer un mail et tester spamassassin

(le webmail de mon provider envoie lui-même des test spamassassin)


peux t'on m'envoyer un mail avec comme text
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

merci
adresse:
deny@linux-pour-lesnuls.com
deny est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/12/2007, 16h53   #3
Membre confirmé
 
Inscription : mars 2007
Messages : 202
Détails du profil
Informations forums :
Inscription : mars 2007
Messages : 202
Points : 202
Points : 202
fais voir ton fichier local.cf et ce fameux /usr/bin/spamassassin.sh
__________________
Tutoriaux Postfix: www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: www.eole-its.com
mrtonio est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/12/2007, 17h11   #4
Membre chevronné
 
Inscription : mai 2004
Messages : 818
Détails du profil
Informations forums :
Inscription : mai 2004
Messages : 818
Points : 706
Points : 706
bien sur

script spamassassin.sh


#!/bin/bash
/usr/bin/spamc | /usr/sbin/sendmail -i "$@"
exit $?

(le démon spamc est bien lancé )
ps -aux | grep spamc
root 21384 0.0 0.0 9320 904 pts/5 R+ 17:10 0:00 grep --color spamc


local.cf

# SpamAssassin config file for version 3.x
# NOTE: NOT COMPATIBLE WITH VERSIONS 2.5 or 2.6
# See http://www.yrex.com/spam/spamconfig25.php for earlier versions
# Generated by http://www.yrex.com/spam/spamconfig.php (version 1.50)

# How many hits before a message is considered spam.
required_score 3

# Change the subject of suspected spam
rewrite_header subject *****SPAM*****

# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe 0

# Enable the Bayes system
use_bayes 1

# Enable Bayes auto-learning
bayes_auto_learn 1

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

# 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 fr


merci
deny est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/12/2007, 09h47   #5
Membre confirmé
 
Inscription : mars 2007
Messages : 202
Détails du profil
Informations forums :
Inscription : mars 2007
Messages : 202
Points : 202
Points : 202
c'est spamd le daemon, pas spamc.
spamc est le binaire qui permet d'appeler le demon spamd

donc:


tu peux t'envoyer un mail toi meme en ligne de commande avec le pattern gtube
__________________
Tutoriaux Postfix: www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: www.eole-its.com
mrtonio est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 14/12/2007, 22h00   #6
Membre chevronné
 
Inscription : mai 2004
Messages : 818
Détails du profil
Informations forums :
Inscription : mai 2004
Messages : 818
Points : 706
Points : 706
c'est spamd le daemon, pas spamc.
spamc est le binaire qui permet d'appeler le demon spamd

oui je sais
et spamd et spamc sont lancés tout deux , donc je ne crois pas que cela soit le problème

tu peux t'envoyer un mail toi meme en ligne de commande avec le pattern gtube


je l'ai fait aussi , sans aucun resultat , aucun test de spam
je pense que je vais m'orienter vers amavis

a+
deny est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/12/2007, 07h21   #7
Membre chevronné
 
Inscription : mai 2004
Messages : 818
Détails du profil
Informations forums :
Inscription : mai 2004
Messages : 818
Points : 706
Points : 706
j'ai fais un autre test de spam en ligne de commande avec spamassassin

spamassassin -t < /usr/share/doc/spamassassin/sample-spam.txt > spam.out

et voici le resultat de spam.out

Citation:
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on localhost
X-Spam-Level: **************************************************
X-Spam-Status: Yes, score=1000.0 required=3.0 tests=GTUBE,NO_RECEIVED,
NO_RELAYS autolearn=no version=3.2.3
X-Spam-Report: =?ISO-8859-1?Q?
* -0.0 NO_RELAYS Informational: message was not relayed via SMTP
* 1000 GTUBE BODY: Test g=e9n=e9rique de courrier non sollict=e9 en masse
* -0.0 NO_RECEIVED Informational: message has no Received headers?=
Subject: *****SPAM***** Test spam mail (GTUBE)
Message-ID: <GTUBE1.1010101@example.net>
Date: Wed, 23 Jul 2003 23:30:00 +0200
From: Sender <sender@example.net>
To: Recipient <recipient@example.net>
Precedence: junk
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Prev-Subject: Test spam mail (GTUBE)

This is the GTUBE, the
Generic
Test for
Unsolicited
Bulk
Email

If your spam filter supports it, the GTUBE provides a test by which you
can verify that the filter is installed correctly and is detecting incoming
spam. You can send yourself a test mail containing the following string of
characters (in upper case and with no white spaces and line breaks):

XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

You should send this test mail from an account outside of your network.

------------------ D�but de Rapport SpamAssassin ---------------------
Ce message est probablement du SPAM (message non sollicit� envoy� en
masse, publicit�, escroquerie...).

Cette notice a �t� ajout�e par le syst�me d'analyse "SpamAssassin" sur
votre serveur de courrier "localhost", pour vous
aider � identifier ce type de messages.

Le syst�me SpamAssassin ajoute un en-t�te "X-Spam-Flag: YES" aux
messages qu'il consid�re comme �tant probablement du Spam.
Vous pouvez si vous le souhaitez utiliser cette caract�ristique
pour r�gler un filtre dans votre logiciel de lecture de courrier,
afin de d�truire ou de classer � part ce type de message.

Si ce robot a classifi� incorrectement un message qui vous �tait
destin�, ou pour toute question, veuillez contacter l'administrateur
du syst�me par e-mail � the administrator of that system .

Voir http://spamassassin.apache.org/tag/ pour plus de d�tails (en anglais).

D�tails de l'analyse du message: (1000.0 points, 3.0 requis)
-0.0 NO_RELAYS Informational: message was not relayed via SMTP
1000 GTUBE BODY: Test g�n�rique de courrier non sollict� en masse
-0.0 NO_RECEIVED Informational: message has no Received headers

-------------------- Fin de Rapport SpamAssassin ---------------------
j'ai donc l'impression que spamassassin passe correctement , mais que le probleme se situe au niveau du smtp

* -0.0 NO_RELAYS Informational: message was not relayed via SMTP
deny est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/12/2007, 10h35   #8
Membre confirmé
 
Inscription : mars 2007
Messages : 202
Détails du profil
Informations forums :
Inscription : mars 2007
Messages : 202
Points : 202
Points : 202
si tu galeres de cette facon, amavisd serait effectivement une bonne idée
__________________
Tutoriaux Postfix: www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: www.eole-its.com
mrtonio est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/12/2007, 12h21   #9
Membre chevronné
 
Inscription : mai 2004
Messages : 818
Détails du profil
Informations forums :
Inscription : mai 2004
Messages : 818
Points : 706
Points : 706
ca y est
j'ai installé amavis et j'ai lancé amavisd

mon main.cf ressemble à

# Please be sure to read the /usr/share/doc/postfix/README.MDK file
# to learn about differences from stock postfix to Mandriva package.
# This file contains only the parameters changed from a default install
# see /etc/postfix/main.cf.dist for a commented, fuller version of this file.

# These are changed by postfix install script
readme_directory = /usr/share/doc/postfix/README_FILES
html_directory = /usr/share/doc/postfix/html
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
command_directory = /usr/sbin
manpage_directory = /usr/share/man
daemon_directory = /usr/lib64/postfix
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
queue_directory = /var/spool/postfix
mail_owner = postfix
mail_spool_directory = /var/spool/mail
home_mailbox = Maildir/
# User configurable parameters
myhostname = linux-pour-lesnuls.com
mydomain = linux-pour-lesnuls.com
myorigin = $mydomain
inet_interfaces = all
#mynetworks_style = host
relayhost = [smtp.numericable.fr]
sender_canonical_maps = hash:/etc/postfix/canonical
#delay_warning_time = 4h
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandriva Linux)
unknown_local_recipient_reject_code = 450
smtp-filter_destination_concurrency_limit = 2
lmtp-filter_destination_concurrency_limit = 2

mynetworks = 127.0.0.0/8, 192.168.1.0/24, localhost, localhost.localdomain
#ne pas autoriser le relaying
#smtpd_recipient_restrictions = permit_mynetworks,check_relay_domains
#relay_domain = linux-pour-lesnuls.com
#smtpd_client_restrictions = reject_unknown_client, permit_mynetworks
# -----------------------------------------------------------------------------------
smtp inet n - n - - smtpd
-o content_filter=spamassassin

# Amavisd-new
#

smtp-amavis unix - - n - 2 smtp -o
smtp_data_done_timeout=12000 -o
disable_dns_lookups=yes
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


spamassassin unix - n n - - pipe
user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

malgré cela aucune trace de message marqué par spamassassin , tout passe , meme le test par gtube

les logs complets d'un message envoyé et recu

Citation:
Dec 15 12:19:05 localhost postfix/smtpd[2789]: connect from smtp1.tech.numericable.fr[82.216.111.37]
Dec 15 12:19:05 localhost postfix/smtpd[2789]: 82A70135872: client=smtp1.tech.numericable.fr[82.216.111.37]
Dec 15 12:19:05 localhost postfix/cleanup[2793]: 82A70135872: message-id=<4763B828.6080605@linux-pour-lesnuls.com>
Dec 15 12:19:05 localhost postfix/qmgr[1081]: 82A70135872: from=<deny@linux-pour-lesnuls.com>, size=812, nrcpt=1 (queue active)
Dec 15 12:19:05 localhost postfix/smtpd[2789]: disconnect from smtp1.tech.numericable.fr[82.216.111.37]
Dec 15 12:19:05 localhost postfix/local[2794]: 82A70135872: to=<deny@linux-pour-lesnuls.com>, relay=local, delay=0.06, delays=0.05/0.01/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Dec 15 12:19:05 localhost postfix/qmgr[1081]: 82A70135872: removed
Dec 15 12:19:07 localhost pop3d: Connection, ip=[::ffff:82.216.186.154]
Dec 15 12:19:07 localhost pop3d: LOGIN, user=deny, ip=[::ffff:82.216.186.154]
Dec 15 12:19:07 localhost pop3d: LOGOUT, user=deny, ip=[::ffff:82.216.186.154], top=0, retr=3190, rcvd=72, sent=3572, time=0
deny est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 07h18.


 
 
 
 
Partenaires

Hébergement Web