Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Postfix]Problème de linkage entre Postfix et Spamassasin !!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
kernings
n00b
n00b


Joined: 14 Nov 2007
Posts: 36

PostPosted: Tue Nov 20, 2007 2:15 pm    Post subject: [Postfix]Problème de linkage entre Postfix et Spamassasin !! Reply with quote

BOnjour à tous,

j'ai un petit soucis sur la configuration de mon serveur de mail. J'ai déjà reussi à configurer simplement Postfix, authlib et ma webmail roundcube avec gestion des mails en IMAP. j'arrive à envoyer et recevoir des mails. Maintenant j'essai de mettre en place Spamassassin, mais lorsque je souhaite recevoir des mails, j'ai l'erreur suivant :

Code:

Nov 20 13:57:15 ks352777 postfix/smtpd[5563]: connect from unknown[127.0.0.1]
[b]Nov 20 12:57:15 ks352777 postfix/smtpd[5563]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld.sock[/b]


Voila ce que j'ai modifié

/etc/postfix/master.cf
Code:
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}

smtp-amavis unix   -   -   y   -   2   smtp
 -o smtp_data_done_timeout=1200
 -o disable_dns_lookups=yes

127.0.0.1:10025   inet   n   -   y   -   -   smtpd
 -o content_filter=
 -o local_recipient_maps=
 -o relay_recipient_maps=
 -o smtpd_restriction_classes=
 -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



/etc/conf.d/spamd
Code:
SPAMD_OPTS="-m 5 -u vmail"


/etc/spamassassin/local.cf
Code:
use_bayes 1
bayes_auto_learn 1
bayes_auto_learn_threshold_nonspam -1
bayes_auto_learn_threshold_spam 14.00
bayes_ignore_header X-Bogosity
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status



/etc/spamassassin/secrets.cf
Code:
bayes_store_module              Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn                   DBI:mysql:spamassassin:localhost:3306
bayes_sql_username              spamassassin
bayes_sql_password              password


/etc/amavisd.conf
Code:
$mydomain = 'example.com'; #fdqn of this server
$myhostame = 'example.com'; #fqdn of this server



/etc/maildroprc
Code:
DEFAULT = "$HOME/mail"
MAILDIR = $DEFAULT

#Drop spam in junk folder
if      (/^X-Spam-Status: Yes/)
{
    exception {
        to $DEFAULT/.Junk/
    }
}




Si je vire toute cette config, ça remarche comme avant ...

Merci de votre aide


Last edited by kernings on Tue Nov 20, 2007 3:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
yoyo
Bodhisattva
Bodhisattva


Joined: 04 Mar 2003
Posts: 4273
Location: Lyon - France

PostPosted: Tue Nov 20, 2007 3:19 pm    Post subject: Reply with quote

Bonjour,

Peux-tu formater ton titre afin qu'il suive nos conventions.

Enjoy !

PS : Désolé de ne pas pouvoir t'aider mais je n'ai aucune compétence dans ce domaine.
_________________
La connaissance s'accroît quand on la partage.
JCB
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Tue Nov 20, 2007 3:33 pm    Post subject: Reply with quote

Poste le résultat d'un "postconf -n" stp
Back to top
View user's profile Send private message
kernings
n00b
n00b


Joined: 14 Nov 2007
Posts: 36

PostPosted: Tue Nov 20, 2007 3:35 pm    Post subject: Reply with quote

Voila :wink:

ks352777 postfix # postconf -n
biff = no
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10025
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
disable_vrfy_command = yes
home_mailbox = .maildir/
html_directory = /usr/share/doc/postfix-2.2.10/html
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 25000000
mydestination = $myhostname, localhost
mydomain = $myhostname
myhostname = ks352777.kimsufi.com
mynetworks_style = host
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.10/readme
relay_domains = $mydestination
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_helo_required = yes
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual_aliases, mysql:/etc/postfix/mysql-forwards.cf
virtual_gid_maps = static:2004
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql-domains.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = mysql:/etc/postfix/mysql-mailboxes.cf
virtual_minimum_uid = 2003
virtual_uid_maps = static:2003

Au fait, en réponse à ce problème je reçois sur mon email du compte root :
Code:
Return-Path: <double-bounce@ks352777.kimsufi.com>
X-Original-To: postmaster
Delivered-To: user@conseil-juridique.net
Received: by ks352777.kimsufi.com (Postfix)
   id 702F1E7BE; Tue, 20 Nov 2007 14:32:46 +0000 (UTC)
Date: Tue, 20 Nov 2007 14:32:46 +0000 (UTC)
From: MAILER-DAEMON@ks352777.kimsufi.com (Mail Delivery System)
To: postmaster@ks352777.kimsufi.com (Postmaster)
Subject: Postfix SMTP server: errors from unknown[127.0.0.1]
Message-Id: <20071120143246.702F1E7BE@ks352777.kimsufi.com>

Transcript of session follows.

 Out: 220 ks352777.kimsufi.com ESMTP Postfix
 In:  EHLO ks352777.kimsufi.com
 Out: 250-ks352777.kimsufi.com
 Out: 250-PIPELINING
 Out: 250-SIZE 25000000
 Out: 250-ETRN
 Out: 250-ENHANCEDSTATUSCODES
 Out: 250-8BITMIME
 Out: 250 DSN
 In:  MAIL FROM:<kernings@gmail.com> SIZE=2009
 Out: 250 2.1.0 Ok
 In:  RCPT TO:<thommas@conseil-juridique.net>
     ORCPT=rfc822;thommas@conseil-juridique.net
 Out: 451 4.3.0 <thommas@conseil-juridique.net>: Temporary lookup failure
 In:  DATA
 Out: 554 5.5.1 Error: no valid recipients
 In:  RSET
 Out: 250 2.0.0 Ok
 In:  QUIT
 Out: 221 2.0.0 Bye


Inutile de spécifier que cette adresse email existe bien, c'est uniquement depuis que j'ai ajouter les liaisons avec Amavisd que ça fait ça :(
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Tue Nov 20, 2007 4:07 pm    Post subject: Reply with quote

Regarde du coté de la base SQL appelée par

virtual_alias_maps = hash:/etc/postfix/virtual_aliases, mysql:/etc/postfix/mysql-forwards.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-mailboxes.cf

Vu le log je pense que le pb vient de là... Regarde cecii avant de regarder du coté de amavis... La base SQL est elle joignable ?
Back to top
View user's profile Send private message
kernings
n00b
n00b


Joined: 14 Nov 2007
Posts: 36

PostPosted: Tue Nov 20, 2007 4:20 pm    Post subject: Reply with quote

A priori aucun problème SQL, ces commandes étaient là avant que j'essai d'utiliser amavis et elles marchaient apparament bien vu que je pouvais envoyer/recevoir des mails IMAP de l'exterieur et de l'intérieur, mais dès que j'ai ajouté les lignes dans main.cf, erreur SQL, je comprend pas pourquoi, Amavis ne doit pourtant pas utiliser mysql ...

J'ai tenter de décommenter cette ligne sur /etc/amavisd.conf

$forward_method = 'smtp:127.0.0.1:10025';

Apparament ça change pas grand chose .... A priori c'était pour lui donner la méthode de réponse. Il faudrai savoir comment ça se passe ? le mail passe d'abord par Amavis ou par Postfix ? D'ailleurs impossible d'avoir des logs dans /var/log/mail/ j'ai tout dans /var/log/messages ... c'est assez désagreable, pas moyen d'externaliser un peu ?
Back to top
View user's profile Send private message
kernings
n00b
n00b


Joined: 14 Nov 2007
Posts: 36

PostPosted: Tue Nov 20, 2007 4:36 pm    Post subject: Reply with quote

Jviens quand même de verifier les connexions SQL, ça à l'air ok ...

Si je commente dans /etc/main.cf :

#content_filter = smtp-amavis:[127.0.0.1]:10025

Tout remarche .... evidemment sans amavisd !!
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Tue Nov 20, 2007 7:35 pm    Post subject: Reply with quote

mmmmouais....
Pourtant c'est bien le process "postfix/smtpd" qui balance le "warning: connect to mysql server localhost: Can't connect to local MySQL server through socket"

Après il se peut que cette erreur soit juste un "warning" et ne soit pas la cause du problème...
(tu l'avais avant cette erreur dans les logs non ? )
(faudra voir ca quand meme ! )

Effectivement si tu commentes "smtp-amavis:[127.0.0.1]:10025 " et qu'il n'y a pas de pb, c'est que ca vient a priori d'amavis...

- Donne les logs complets du passage d'un mail dans postfix (et pas un morceaux d' erreur comme ca au hasard)
- Donne la conf complète d'amavis
- Donne les logs Amavis
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Tue Nov 20, 2007 7:38 pm    Post subject: Reply with quote

Quote:
Out: 451 4.3.0 <xxxxs@xxxxx-juridique.net>: Temporary lookup failure


Ca ca ressemble a un pb de résolution DNS... Ce qu'il faudrait c'est les logs de ca... ! (pas juste l'erreur renvoyée)
Back to top
View user's profile Send private message
kernings
n00b
n00b


Joined: 14 Nov 2007
Posts: 36

PostPosted: Wed Nov 21, 2007 9:14 am    Post subject: Reply with quote

Salut uggy et encore merci pr ton aide !!

J'ai avancé un peu depuis hier, voila ou j'en suis :

Apparament il faut d'abord dire à Postfix d'envoyer vers Amavis sur le port 10024 et pas 10025 :

content_filter = smtp-amavis:[127.0.0.1]:10024

Ensuite en faisant ça, Amavis apparait dans les log d'erreur :

http://ks352777.kimsufi.com/~thommas/log.txt

Mais toujours le problème MYSQL, j'ai trouver plus ou moins d'ou ça vient : du fichier mysql-mailbox.cf (mysql pour le mailbox)

Code:
user            = postfix
password        = XXXXXXXXX
dbname          = postfix
table           = mailbox
select_field    = concat(domain,'/',username,'/')
where_field     = username
hosts           = localhost


En mettant localhost_test dans "hosts", l'erreur ce repercute dans le Warning Mysql ("Can't connect to localhost_test ...") donc l'erreur SQL empeche Postfix de trouver l'utilisateur. L'erreur SQL vient donc de là. Maintenant je ne sais pas pourquoi ...

Voici le très long fichier de configuration de amavi :
http://ks352777.kimsufi.com/~thommas/amavisd.conf
et le master :
http://ks352777.kimsufi.com/~thommas/master.cf
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Wed Nov 21, 2007 7:54 pm    Post subject: Reply with quote

kernings wrote:

Apparament il faut d'abord dire à Postfix d'envoyer vers Amavis sur le port 10024 et pas 10025 :
content_filter = smtp-amavis:[127.0.0.1]:10024

Ahh bahh ca ..tout dépend ou écoute ton Amavis... forcément...



kernings wrote:

Mais toujours le problème MYSQL, j'ai trouver plus ou moins d'ou ça vient : du fichier mysql-mailbox.cf (mysql pour le mailbox)


Ahh bahh finalement on retombe sur ce que j'avais dit... :)


kernings wrote:

L'erreur SQL vient donc de là. Maintenant je ne sais pas pourquoi ...

Elle tourne ta base etc... ?


Je pense que tu as plusieurs problèmes et tu essayes tous de les résoudre en même temps...
Je te conseille d'y aller morceau par morceau... sinon tu va pas y arriver...
Commence par oublier Amavis et les bases SQL. Resout tous les problèmes de warnings etc... jusqu'au tout marche au poil..
Ensuite réactive les bases Sql... Et résout les problèmes SQL...
Ensuite réactive Amavis... et résout les problèmes Amavis...

A chaque étapes tu postes un "postconf -n" et les logs complets du passage d'un mail en cas de pb.
Back to top
View user's profile Send private message
kernings
n00b
n00b


Joined: 14 Nov 2007
Posts: 36

PostPosted: Thu Nov 22, 2007 8:31 am    Post subject: Reply with quote

OK Uggy j'ai trouvé l'erreur, il fallait utilisé "proxy:mysql" dans mon fichier main.cf ... une sombre histoire de spool apparament, j'ai pas tout tout compris mais ça marche désormais ... Le mail passe entre les mains de amavis puis de maildrop ... et j'espere de spamassassin .... Par contre j'ai un dernier ennui !! Mes mails spammés ne sont pas taggués, apparament amavis ou spamassassin ne fait pas son travail :

Voici l'email reçu censé etre du SPAM, mais aucun TAG ne l'indique :

Code:
Return-Path: <kernings@gmail.com>
Delivered-To: thommas@conseil-juridique.net
Received: from localhost (unknown [127.0.0.1])
   by ks352777.kimsufi.com (Postfix) with ESMTP id 8B721E7A7
   for <thommas@conseil-juridique.net>; Thu, 22 Nov 2007 07:26:16 +0000 (UTC)
Received: from ks352777.kimsufi.com ([127.0.0.1])
   by localhost (ks352777.kimsufi.com [127.0.0.1]) (amavisd-new, port 10024)
   with ESMTP id rJRmVsqM8PsH for <thommas@conseil-juridique.net>;
   Thu, 22 Nov 2007 08:26:14 +0100 (CET)
Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.184])
   by ks352777.kimsufi.com (Postfix) with ESMTP id C8C30E757
   for <thommas@conseil-juridique.net>; Thu, 22 Nov 2007 08:26:13 +0100 (CET)
Received: by rv-out-0910.google.com with SMTP id c24so2127055rvf
        for <thommas@conseil-juridique.net>; Thu, 22 Nov 2007 00:26:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type;
        bh=GsFd0JHoJ8xDk78hAOp1+Q0PBlwoi0/K2wUnLz0IMrI=;
        b=i2p2BcniPC77Uj9jQpl06gApTNqdkfDk84JHF56rUF8dayHCiBl9eUvynybQB0i0TjWrrCaqn119V1ePyVSOtgAS3qujtlYaNEAdZQEjNnenLoOZcwnsoENjHwZ7Il9rgXOKpjP36CNxMwEd1Zrk4KLYhq17+qHhhtjozSw8/Ds=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=received:message-id:date:from:to:subject:mime-version:content-type;
        b=Eo5yYuR0AelLENgqrlpDL6Z78bv3myQwsEWx9Yso3C5BPHvnWn6HOCJObAyiLl20Z6Xkr4/aN+658D/A29U6fLa2xKui/LI3Q1VUUdlzP2EXdnf6LUpK7BkQSStzD95FUknfd8ckROl0ABj+YxnODHprCZ79ZjsZi7toguSYNyQ=
Received: by 10.140.82.40 with SMTP id f40mr3439942rvb.1195720001563;
        Thu, 22 Nov 2007 00:26:41 -0800 (PST)
Received: by 10.141.40.3 with HTTP; Thu, 22 Nov 2007 00:26:41 -0800 (PST)
Message-ID: <dfeb90180711220026s59398e8cya3796f1f42eb298a@mail.gmail.com>
Date: Thu, 22 Nov 2007 09:26:41 +0100
From: "Dju Dju" <kernings@gmail.com>
To: thommas@conseil-juridique.net
Subject: Test envoi de SPAMM
MIME-Version: 1.0
Content-Type: multipart/alternative;
   boundary="----=_Part_11721_15657033.1195720001563"

------=_Part_11721_15657033.1195720001563
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

------=_Part_11721_15657033.1195720001563
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

------=_Part_11721_15657033.1195720001563--


Voici les logs de ce mail :
http://ks352777.kimsufi.com/~thommas/log.txt
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Thu Nov 22, 2007 9:00 am    Post subject: Reply with quote

Turn on SpamAssassin debugging (output to STDERR, use with 'amavisd debug')
$sa_debug = '1,all';
Back to top
View user's profile Send private message
kernings
n00b
n00b


Joined: 14 Nov 2007
Posts: 36

PostPosted: Thu Nov 22, 2007 9:07 am    Post subject: Reply with quote

j'ai décommenté la ligne relancer amavis et postfix, envoyé un mail ... mais rien de plus dans les logs ... peut être qu'il ne se sert même pas de spamassassin ? Qui de amavis ou de spamassassin est censé marquer le ***SPAM*** ?
Back to top
View user's profile Send private message
kernings
n00b
n00b


Joined: 14 Nov 2007
Posts: 36

PostPosted: Thu Nov 22, 2007 9:31 am    Post subject: Reply with quote

je viens de tester, j'ai désactivé Spassassin sur amavisd.conf, et le mail passe en non spammé ... si je le réactive le mail est considéré comme un spam : DOnc spamassassin semble fonctionner !!

Voici le fichier de config de spamassassin :

http://ks352777.kimsufi.com/~thommas/local.txt
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Thu Nov 22, 2007 2:09 pm    Post subject: Reply with quote

Donc tout marche ? :D
Back to top
View user's profile Send private message
kernings
n00b
n00b


Joined: 14 Nov 2007
Posts: 36

PostPosted: Thu Nov 22, 2007 2:36 pm    Post subject: Reply with quote

uép, j'ai réglé un problème de domaine qd même sur amavis et c'est bon ;-) tout marche ... pr le moment
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum