Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 24/10/2007, à 11:40

zerros

[Résolu]serveur de mail mysql + sasl

Bonjour,

Je sias que je me répète, mais j'ai voulu installé un nouveau serveur de mail sur une dedibox avec un enregistrement MX valide.

J'ai suivi la même procédure que pour l'installation de mon serveur de mail précédent, mais cette fois-ci sans succès pour le smtp.

voici le message d'erreur à l'envoi du mail (il me demande le mot de passe en boucle) :

Oct 24 11:41:00 sd-9338 postfix/smtpd[7998]: warning: SASL authentication failure: Password verification failed
Oct 24 11:41:00 sd-9338 postfix/smtpd[7998]: warning: gw2.net.jmsp.net[212.23.187.22]: SASL PLAIN authentication failed: authentication failure
Oct 24 11:41:00 sd-9338 postfix/smtpd[7998]: warning: gw2.net.jmsp.net[212.23.187.22]: SASL LOGIN authentication failed: authentication failure

postconf -n :

root@test:/var/log# postconf -n
append_dot_mydomain = yes
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
disable_vrfy_command = yes
inet_interfaces = all
mydestination = localhost, localhost.localdomain
mydomain = test.fr
myhostname = test.fr
mynetworks = 127.0.0.0/8
relayhost = 
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP (Debian/GNU)
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,       permit_mynetworks,      check_relay_domains
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_aliases.cf,mysql:/etc/postfix/mysql-virtual_aliases_mailbox.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/vmail/
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_uid_maps = static:5000

Une petite idée plz ?!

Merci d'avance pour votre aide à tous.

Dernière modification par zerros (Le 24/10/2007, à 13:55)

Hors ligne

#2 Le 24/10/2007, à 11:44

toniotonio

Re : [Résolu]serveur de mail mysql + sasl

fais voir ta conf sasl


Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#3 Le 24/10/2007, à 12:25

zerros

Re : [Résolu]serveur de mail mysql + sasl

alors voici les fichiers de conf :

main.cf :

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_sasl_authenticated, reject
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes

smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        check_relay_domains

master.cf

# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_enforce_tls=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

#smtp-amavis unix -      -       n       -       2  smtp
#  -o smtp_data_done_timeout=1200
#  -o disable_dns_lookups=yes
#  -o smtp_send_xforward_command=yes

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

/etc/postfix/sasl/smtp.cond

root@test:/etc/postfix# more /etc/postfix/sasl/smtpd.conf 
Rpwcheck_method: authdaemond
log_level: 7
mech_list: PLAIN LOGIN
authdaemond_path:/var/run/courier/authdaemon/socket

le lien sur le socket est existe bien (je n'ai d'ailleurs aucune erreur de droit ou de communication avec authdaemon).

root@test:/etc/postfix# more /etc/pam.d/smtp
auth            required       pam_unix.so      nullok
account         required       pam_unix.so
password        required       pam_unix.so
session         required       pam_unix.so

root@test:/etc/postfix# more /etc/pam.d/smtpd 
auth       required     pam_mysql.so user=postfix passwd=postfix host=127.0.0.1 db=postfix table=mailbox usercolumn=email passwdcolumn=password crypt=1
account    sufficient   pam_mysql.so user=postfix passwd=postfix host=127.0.0.1 db=postfix table=mailbox usercolumn=email passwdcolumn=password crypt=1

J'espère que vous pourrez m'aider.

Hors ligne

#4 Le 24/10/2007, à 12:28

toniotonio

Re : [Résolu]serveur de mail mysql + sasl

tes password sont encodés comment dans ta base sql ?


Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#5 Le 24/10/2007, à 12:31

zerros

Re : [Résolu]serveur de mail mysql + sasl

Avec la fonction encrypt :

root@test:/etc/postfix# cat /opt/tools/cuser.pl 
#!/usr/bin/perl
use DBI;

$email = $ARGV[0]."\@test.fr";
$pass = $ARGV[1];

if ($email eq "" || $pass eq "") { print "Usage: cuser user pass\n"; exit 1; }

$dbh=DBI->connect("DBI:mysql:postfix:localhost","postfix","postfix");
$dbh->do("INSERT INTO `mailbox` (`email`,`password`,`quota`,`actif`,`imap`,`pop3`) VALUES ('$email',ENCRYPT('$pass'),0,1,1,0)");
$dbh->disconnect;

exit 0;

Dans le fichier /etc/courier/authmysqlrc, j'execute mon athentification de la sorte :

MYSQL_MAILDIR_FIELD     CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')

ca peut être lié vu que dans mon /etc/pam.d/smtpd j'ai :

auth       required     pam_mysql.so user=postfix passwd=postfix host=127.0.0.1 db=postfix table=mailbox usercolumn=email passwdcolumn=password crypt=1
account    sufficient   pam_mysql.so user=postfix passwd=postfix host=127.0.0.1 db=postfix table=mailbox usercolumn=email passwdcolumn=password crypt=1

?

Dernière modification par zerros (Le 24/10/2007, à 12:39)

Hors ligne

#6 Le 24/10/2007, à 12:45

toniotonio

Re : [Résolu]serveur de mail mysql + sasl

le pb c'est que /etc/pam.d/smtpd devrait etre nommé /etc/pam.d/smtp 

ce que tu as actuellement dans /etc/pam.d/smtp ne sert a rien


Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#7 Le 24/10/2007, à 12:52

zerros

Re : [Résolu]serveur de mail mysql + sasl

J'ai fait un mv de smtpd vers smtp et relancé saslauth.

même souci. J'ai activé les logs dans mysql, et aucune requête n'arrive pour l'envoi de mail :

root@test:/etc/pam.d# tail -f /var/log/mysql.log
                      5 Query       CHECK TABLE `time_zone_name`  FAST
                      5 Query       CHECK TABLE `time_zone_transition`  FAST
                      5 Query       CHECK TABLE `time_zone_transition_type`  FAST
                      5 Query       CHECK TABLE `user`  FAST
                      5 Init DB     postfix
                      5 Query       SHOW TABLE STATUS
                      5 Query       CHECK TABLE `alias`  FAST
                      5 Query       CHECK TABLE `domain`  FAST
                      5 Query       CHECK TABLE `mailbox`  FAST
                      5 Quit

Une autre idée ?

Dernière modification par zerros (Le 24/10/2007, à 13:44)

Hors ligne

#8 Le 24/10/2007, à 13:23

toniotonio

Re : [Résolu]serveur de mail mysql + sasl

refais voir ton /etc/postfix/sasl/smtp.conf


Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#9 Le 24/10/2007, à 13:42

zerros

Re : [Résolu]serveur de mail mysql + sasl

en fait c'est /etc/postfix/sasl/smtpd.conf

root@test:/etc/pam.d# more /etc/postfix/sasl/smtpd.conf 
Rpwcheck_method: authdaemond
log_level: 7
mech_list: PLAIN LOGIN
authdaemond_path:/var/run/courier/authdaemon/socket

Dernière modification par zerros (Le 24/10/2007, à 13:44)

Hors ligne

#10 Le 24/10/2007, à 13:46

toniotonio

Re : [Résolu]serveur de mail mysql + sasl

zerros a écrit :

en fait c'est /etc/postfix/sasl/smtpd.conf

root@annai:/etc/pam.d# more /etc/postfix/sasl/smtpd.conf 
Rpwcheck_method: authdaemond
log_level: 7
mech_list: PLAIN LOGIN
authdaemond_path:/var/run/courier/authdaemon/socket

oui c'est bien /etc/postfix/sasl/smtpd.conf

je pensais que tu avais fait une erreur dans le copier/coller mais apparemment non:

mets ca dans ce fichier (et rien d'autre)

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
log_level: 5

Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#11 Le 24/10/2007, à 13:55

zerros

Re : [Résolu]serveur de mail mysql + sasl

Super ! Merci ca fonctionne :d

je reactive spamassassin, clamav et amavisd smile

merci encore toniotonio smile

bonne fin de journee.

Hors ligne