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 30/01/2018, à 14:01

vica6a

Postfix/Smtpd probleme d'envoie mail depuis client externe

Bonjour à tous,

je m'adresse à vous pour m'aider dans un problème que je ne maîtrise pas suffisamment et pour lequel j'ai du mal à trouver solution sur le net.

J'ai récemment fait une installation complète d'un serveur mail avec postfix / mysql et client squirrelmail sur le serveur.
En internet depuis squirrelmail, tout fonctionne très bien (identification, réception et envoi de mail interne et externe).

Depuis un client externe (sur iphone, outlook etc), je peux recevoir, mais impossible d'envoyer un mail, il semblerait y avoir un probleme d'identification.

Voici le message d'erreur de mon /var/log/mail.log

Jan 30 13:43:46 sd-xxxxx postfix/submission/smtpd[31734]: connect from a2com.rain.fr[81.80.55.82]
Jan 30 13:43:47 sd-xxxxx postfix/submission/smtpd[31734]: warning: SASL authentication problem: unknown password verifier(s) auxprop
Jan 30 13:43:47 sd-xxxxx postfix/submission/smtpd[31734]: warning: SASL authentication failure: Password verification failed
Jan 30 13:43:47 sd-xxxxx postfix/submission/smtpd[31734]: warning: a2com.rain.fr[81.80.55.82]: SASL PLAIN authentication failed: no mechanism available
Jan 30 13:43:47 sd-xxxxx postfix/submission/smtpd[31734]: disconnect from a2com.rain.fr[81.80.55.82] ehlo=2 starttls=1 auth=0/1 quit=1 commands=4/5
Jan 30 13:44:23 sd-xxxxx postfix/smtpd[31717]: warning: hostname free.ds does not resolve to address 91.200.12.9: Name or service not known
Jan 30 13:44:23 sd-xxxxx postfix/smtpd[31717]: connect from unknown[91.200.12.9]
Jan 30 13:44:23 sd-xxxxx postfix/smtpd[31717]: warning: SASL authentication problem: unknown password verifier(s) auxprop
Jan 30 13:44:23 sd-xxxxx postfix/smtpd[31717]: warning: unknown[91.200.12.9]: SASL LOGIN authentication failed: no mechanism available
Jan 30 13:44:24 sd-xxxxx postfix/smtpd[31717]: lost connection after AUTH from unknown[91.200.12.9]
Jan 30 13:44:24 sd-xxxxx postfix/smtpd[31717]: disconnect from unknown[91.200.12.9] ehlo=1 auth=0/1 commands=1/2

voici mon postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
content_filter = amavis:[127.0.0.1]:10024
debug_peer_level = 2
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = $myhostname, sd-xxxxx.dedibox.fr, localhost.dedibox.fr, , localhost
myhostname = sd-xxxxx.dedibox.fr
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = /usr/share/doc/postfix
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, permit
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit
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:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 5000
virtual_transport = virtual
virtual_uid_maps = static:5000
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_overquota_bounce=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_mailbox_limit_maps=mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_limit_message=Sorry, the your maildir has overdrawn your diskspace quota, please free up some of spaces of your mailbox try again.
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_mailbox_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_mailbox_limit_override=yes

mon /etc/postfix/sasl/smtpd.conf

pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: plain login cram-md5 digest-md5
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: postfix
sql_passwd: motdepasse
sql_database: postfix
sql_select: select password from mailbox where username='%u@%r' and active = 1

Je pense que le problème vient bien  de ce dernier fichier (auxprop), mais je n'arrive pas réellement à comprendre pourquoi en interne il n'y a pas de soucis de connexion... Si quelqu'un pouvait se pencher sur mon problème ca serait vraiment super.

Merci à vous

Hors ligne

#2 Le 30/01/2018, à 16:48

bruno

Re : Postfix/Smtpd probleme d'envoie mail depuis client externe

Bonjour,

En interne il n'y a pas de soucis car le client n'a pas besoin de s'authentifier (cf mynetworks, permit_mynetworks). En externe une authentification est exigée mais on ne comprend pas le mécanisme que tu utilises. auxprop il me semble que c'est lié à Cyrus SASL avec une base BerkeleyDB, mais tu utilises mysql…

Sinon tu a des directives inutilisées dans ta configuration de postfix (voir les avertissements) et cela me semble incomplet… Plutôt que d'utiliser Cyrus SASL, tu devrais utiliser Dovecot. Et as-tu vraiment besoin de gérer des boîtes et domaines virtuels avec MYSQL ? Tu as tant d'utilisateurs et de domaines que cela ?

Hors ligne

#3 Le 31/01/2018, à 08:24

vica6a

Re : Postfix/Smtpd probleme d'envoie mail depuis client externe

ok... Alors là je nage parce ce que j'étais sûr de passer par dovecot hmm
En réalité j'avais une config précédente gérée sur mysql et dovecot et ca me convenait très bien; je n'ai pas particulièrement beaucoup d'users, j'ai juste suivi un tuto que je ne retrouve plus.

Y a t-il un moyen de vérifier si dovecot est utilisé ? Et si non, le configurer progressivement sans risquer de perdre la config qui fonctionne en interne ?

Concernant les avertissements, ce ne sont que des warning de quota que je n'ai pas configuré jusqu'au bout, à la limite je peux enlever les directives dans le fichier mais ce n'est pas ce qui gene mon identification
Merci beaucoup

Hors ligne

#4 Le 31/01/2018, à 09:05

bruno

Re : Postfix/Smtpd probleme d'envoie mail depuis client externe

De ce que je vois dovecot n'est pas utilisé.
Je te conseille de reprendre ta configuration à partir de zéro en suivant les documentation officielles et en essayant de comprendre ce que tu fais.

http://www.postfix.org/documentation.html
https://wiki.dovecot.org

à la rigueur si tu veux un "tuto", prend celui-ci : https://workaround.org/ispmail et adapte le à tes besoins

La configuration d'une pile de gestion du courriel (MTA+MDA+gestion des utilisateurs+gestion de multiples domaines) est loin d'être triviale et les risques d'avoir une configuration mal foutue et non sécurisée sont nombreux.

Hors ligne

#5 Le 01/02/2018, à 11:59

vica6a

Re : Postfix/Smtpd probleme d'envoie mail depuis client externe

Le probleme est que le serveur est en production, et je ne peux pas me permettre de risquer de perdre des mails en ce moment...

J'ai enfin retrouvé le tutoriel qui m'a guidé jusqu'ici :
https://help.ubuntu.com/community/Postf … ystemHowto

effectivement, je ne passe pas par dovecot.. A la limite ca me dérange pas si cette solution pouvait marcher.

Entre temps, j'ai modifier mon main.cf pour avoir un peu plus de log et voici :

Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: connect from a2com.rain.fr[81.80.55.82]
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: smtp_stream_setup: maxtime=300 enable_deadline=0
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostname: smtpd_client_event_limit_exceptions: a2com.rain.fr ~? 127.0.0.0/8
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostaddr: smtpd_client_event_limit_exceptions: 81.80.55.82 ~? 127.0.0.0/8
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostname: smtpd_client_event_limit_exceptions: a2com.rain.fr ~? [::ffff:127.0.0.0]/104
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostaddr: smtpd_client_event_limit_exceptions: 81.80.55.82 ~? [::ffff:127.0.0.0]/104
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostname: smtpd_client_event_limit_exceptions: a2com.rain.fr ~? [::1]/128
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostaddr: smtpd_client_event_limit_exceptions: 81.80.55.82 ~? [::1]/128
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_list_match: a2com.rain.fr: no match
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_list_match: 81.80.55.82: no match
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: auto_clnt_open: connected to private/anvil
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: send attr request = connect
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: send attr ident = submission:81.80.55.82
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: private/anvil: wanted attribute: status
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute name: status
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute value: 0
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: private/anvil: wanted attribute: count
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute name: count
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute value: 1
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: private/anvil: wanted attribute: rate
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute name: rate
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute value: 1
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: private/anvil: wanted attribute: (list terminator)
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute name: (end)
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 220 sd-xxxxx.dedibox.fr ESMTP Postfix (Ubuntu)
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: watchdog_pat: 0x55f717aed4c0
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: < a2com.rain.fr[81.80.55.82]: EHLO [192.168.1.13]
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_list_match: a2com.rain.fr: no match
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_list_match: 81.80.55.82: no match
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 250-sd-xxxxx.dedibox.fr
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 250-PIPELINING
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 250-SIZE 10240000
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 250-VRFY
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 250-ETRN
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 250-STARTTLS
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 250-ENHANCEDSTATUSCODES
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 250-8BITMIME
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: > a2com.rain.fr[81.80.55.82]: 250 DSN
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: watchdog_pat: 0x55f717aed4c0
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: smtp_get: EOF
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostname: smtpd_client_event_limit_exceptions: a2com.rain.fr ~? 127.0.0.0/8
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostaddr: smtpd_client_event_limit_exceptions: 81.80.55.82 ~? 127.0.0.0/8
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostname: smtpd_client_event_limit_exceptions: a2com.rain.fr ~? [::ffff:127.0.0.0]/104
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostaddr: smtpd_client_event_limit_exceptions: 81.80.55.82 ~? [::ffff:127.0.0.0]/104
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostname: smtpd_client_event_limit_exceptions: a2com.rain.fr ~? [::1]/128
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_hostaddr: smtpd_client_event_limit_exceptions: 81.80.55.82 ~? [::1]/128
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_list_match: a2com.rain.fr: no match
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: match_list_match: 81.80.55.82: no match
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: send attr request = disconnect
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: send attr ident = submission:81.80.55.82
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: private/anvil: wanted attribute: status
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute name: status
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute value: 0
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: private/anvil: wanted attribute: (list terminator)
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: input attribute name: (end)
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: lost connection after EHLO from a2com.rain.fr[81.80.55.82]
Feb  1 11:56:52 sd-xxxxx postfix/submission/smtpd[785]: disconnect from a2com.rain.fr[81.80.55.82] ehlo=1 commands=1

Est ce que ca peut aider ?

Merci

Hors ligne

#6 Le 01/02/2018, à 14:03

bruno

Re : Postfix/Smtpd probleme d'envoie mail depuis client externe

Désolé, mais ta configuration est beaucoup trop confuse et le tutoriel que tu cites est totalement obsolète.

Je ne peux que répéter ce que j'ai déjà dit : tu n'as aucun mécanisme d'authentification fonctionnel. Donc à voir du côté de la configuration de Courrier si c'est ce que tu utilises (courier-authdemon, courrier-authlib, courier-authlib-mysql).

Au passage avoir un serveur « en production » sans avoir testé si tout fonctionnait et sans maîtriser la configuration des services installés, cela me paraît un peu désinvolte.

Hors ligne

#7 Le 02/02/2018, à 15:13

LeoMajor

Re : Postfix/Smtpd probleme d'envoie mail depuis client externe

bonjour,

si tu utilises saslauthd (usage déconseillé avec dovecot, bien que compatible)

à adapter
/etc/default/saslauthd

START=yes
MECHANISMS="pam"
...

----
pam & mysql & smtp

/etc/pam.d/smtp

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

nano /etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd auxprop
mech_list: PLAIN LOGIN
auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: root
sql_database: postfix
sql_passwd: mot_de_passe
sql_select: select password from mailbox where username = '%u@%r'

variante avec RIMAP (remote imap; l'authentification smtp est faite sur le remote IMAP)
/etc/default/saslauthd

START=yes
NAME="saslauthd"
MECHANISMS="rimap"
MECH_OPTIONS="localhost"
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"

par exemple rimap: dbmail

pwcheck_method: auxprop
mech_list: CRAM-MD5 PLAIN
auxprop_plugin: sql
log_level: 2
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: dbmail
sql_passwd: pass
sql_database: dbmail
sql_verbose: yes
sql_select: SELECT passwd FROM dbmail_users WHERE userid = '%u@%r'

pam seulement sans sql

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN

attention à la vérification (doc)

""
Cyrus SASL Plugins - auxiliary property plugins

Cyrus SASL uses a plugin infrastructure (called auxprop) to expand libsasl's capabilities. Currently Cyrus SASL sources provide three authentication plugins.

    Plugin     Description
    sasldb     Accounts are stored stored in a Cyrus SASL Berkeley DB database
    sql     Accounts are stored in a SQL database
    ldapdb     Accounts are stored stored in an LDAP database

    Important

    These three plugins support shared-secret mechanisms i.e. CRAM-MD5, DIGEST-MD5 and NTLM. These mechanisms send credentials encrypted but their verification process requires the password to be available in plaintext. Consequently passwords cannot (!) be stored in encrypted form.
""

faire un test-saslauthd (login,plain)

sudo testsaslauthd -f /var/spool/postfix/var/run/saslauthd/mux -u toto@domain.tld -p password
0: OK "Success."

mech_list
L'authentification échouera si les clients sont autorisés à choisir d'autres mécanismes, qui ne sont pas fonctionnels (OTP, DIGEST, ...)

bon courage

Hors ligne