[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: postfix et authentification



Remi Suinot wrote:
En ce Sun, 03 Feb 2008 18:52:30 +0100, le sermon de Nicolas KOWALSKI <niko@petole.dyndns.org> contenait:

Remi Suinot <remi@suinot.org> writes:

Pour arriver à un résultat, j'ai été obligé d'abord, de supprimer la
config de postfix suivante:
smtpd_helo_restrictions = reject_non_fqdn_hostname
sinon, ça passe pas du tout, avec ou sans authentification!
Je n'arrive pas à te suivre ; dans un précédent courrier tu écrivais
que ça marchait sans authentification depuis le réseau local...

Maintenant, l'authentification marche ou non ?

J'ai avancé un peu! Apparemment, ssl est utilisé, mais l'autenthification a échoué.
Dans les log ci dessous, j'ai fait un test de l'intérieur du réseau vers mon adresse  chez free:
Feb  4 22:50:28 master postfix/smtpd[2166]: > excalibur.suinot.org[192.168.3.10]: 250-AUTH=LOGIN
Feb  4 22:50:28 master postfix/smtpd[2166]: > excalibur.suinot.org[192.168.3.10]: 250-ENHANCEDSTATUSCODES
Feb  4 22:50:28 master postfix/smtpd[2166]: > excalibur.suinot.org[192.168.3.10]: 250-8BITMIME
Feb  4 22:50:28 master postfix/smtpd[2166]: > excalibur.suinot.org[192.168.3.10]: 250 DSN
Feb  4 22:50:28 master postfix/smtpd[2166]: < excalibur.suinot.org[192.168.3.10]: AUTH LOGIN
Feb  4 22:50:28 master postfix/smtpd[2166]: xsasl_cyrus_server_first: sasl_method LOGIN
Feb  4 22:50:28 master postfix/smtpd[2166]: xsasl_cyrus_server_auth_response: uncoded server challenge: Username:
Feb  4 22:50:28 master postfix/smtpd[2166]: > excalibur.suinot.org[192.168.3.10]: 334 VXNlcm5hbWU6
Feb  4 22:50:28 master postfix/smtpd[2166]: < excalibur.suinot.org[192.168.3.10]: cmVtaUBzdWlub3Qub3Jn
Feb  4 22:50:28 master postfix/smtpd[2166]: xsasl_cyrus_server_next: decoded response: remi@suinot.org
Feb  4 22:50:28 master postfix/smtpd[2166]: xsasl_cyrus_server_auth_response: uncoded server challenge: Password:
Feb  4 22:50:28 master postfix/smtpd[2166]: > excalibur.suinot.org[192.168.3.10]: 334 UGFzc3dvcmQ6
Feb  4 22:50:28 master postfix/smtpd[2166]: < excalibur.suinot.org[192.168.3.10]: 4peP4peP4peP4peP4peP4peP4peP4peP4peP4peP
Feb  4 22:50:28 master postfix/smtpd[2166]: xsasl_cyrus_server_next: decoded response: ??????????????????????????????
Feb  4 22:50:28 master postfix/smtpd[2166]: warning: excalibur.suinot.org[192.168.3.10]: SASL LOGIN authentication failed: authentication failure
Feb  4 22:50:28 master postfix/smtpd[2166]: > excalibur.suinot.org[192.168.3.10]: 535 5.7.0 Error: authentication failed: authentication failure
Feb  4 22:50:41 master postfix/smtpd[2166]: smtp_get: EOF




je ne vois pas PLAIN comme mecanisme d'authentification. vérifie que t'as bien module sasl PLAIN. C'est un comble d'avoir LOGIN (qui n'est pas standard) mais pas PLAIN (qui est standard). Dans les deux cas (PLAIN ET LOGIN), il vaut mieux passer sous SSL (STARTTLS), sinon gare au vol de mots de passe.

Par ailleurs, mieux vait utiliser le port 587 pour tout ça (pour la "submission" par tes utilisateurs). ça permettra de bloquer le port 25 et de detecter les virus qui essayeraient de l'utiliser (et puis c'est bien de séparer les roles. un MSA n'a pas la même fonction qu'un MX. en séparant les roles, on peut alors se passer des exceptions dans les smtpd_*_restrictions).

PS. dovecot-auth est plus simple à mettre en place que cyrus_sasl (même si on n'utilise pas dovecot comme serveur pop/imap, on peut utiliser son implémentation sasl).

Pour savoir où tu en es dans ta configuration, un "postconf -n" serait
le bienvenu...

voila voila...
master:/etc/postfix# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 51200000
mydestination = suinot.org, localhost, localhost.localdomain
myhostname = master.suinot.org
mynetworks = 192.168.0.0/16, 127.0.0.0/8
myorigin = /etc/mailname
recipient_delimiter = +
relayhost = smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,     permit_mynetworks,     reject_unauth_destination    permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
Mais cela ouvre t il une porte dans postfix?
C'est une option qui permet normalement de se prémunir contre certains
pourriéleurs. Personnellement, je ne l'utilise pas, SpamAssassin
faisant très bien le travail.

Pour d'autres infos plus précises:
http://www.postfix.org/uce.html#smtpd_helo_restrictions
Merci pour cette info.

Merci de votre aide.
Rémi.



Reply to: