Configuration smtp (TLS) et AUTH PLAIN

Bonjour,

Ma version : 10.0.1.

J’ai un problème d’identification sur un serveur smtp externe. J’utilise d’autres outils avec lequel cela ce passe bien.
Je pense que c’est du à la méthode d’authentification qui n’est pas prise en charge par dolibarr.

En effet, dolibarr ne semble prendre en charge que l’authentification AUTH LOGIN (ici sur la branche develop en cours). Mais de mon coté je suis en AUTH PLAIN (et TLS

Voici le log d’un autre outil :

2019-10-11 12:28:24 SERVER -> CLIENT: 220 smtpserver.exemple.org ESMTP Postfix (Debian/GNU) 2019-10-11 12:28:24 CLIENT -> SERVER: EHLO www1.exemple.org 2019-10-11 12:28:24 SERVER -> CLIENT: 250-smtpserver.exemple.org250-PIPELINING250-SIZE 16777216250-VRFY250-ETRN250-STARTTLS250-ENHANCEDSTATUSCODES250-8BITMIME250 DSN 2019-10-11 12:28:24 CLIENT -> SERVER: STARTTLS 2019-10-11 12:28:24 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS 2019-10-11 12:28:24 CLIENT -> SERVER: EHLO www1.exemple.org 2019-10-11 12:28:24 SERVER -> CLIENT: 250-smtpserver.exemple.org250-PIPELINING250-SIZE 16777216250-VRFY250-ETRN250-AUTH PLAIN250-AUTH=PLAIN250-ENHANCEDSTATUSCODES250-8BITMIME250 DSN 2019-10-11 12:28:24 CLIENT -> SERVER: AUTH PLAIN 2019-10-11 12:28:24 SERVER -> CLIENT: 334 2019-10-11 12:28:24 CLIENT -> SERVER: <credentials hidden> 2019-10-11 12:28:24 SERVER -> CLIENT: 235 2.7.0 Authentication successful 2019-10-11 12:28:24 CLIENT -> SERVER: MAIL FROM:<[email protected]> 2019-10-11 12:28:24 SERVER -> CLIENT: 250 2.1.0 Ok 2019-10-11 12:28:24 CLIENT -> SERVER: RCPT TO:<[email protected]> 2019-10-11 12:28:24 SERVER -> CLIENT: 250 2.1.5 Ok 2019-10-11 12:28:24 CLIENT -> SERVER: DATA 2019-10-11 12:28:24 SERVER -> CLIENT: 354 End data with <CR><LF>.<CR><LF> 2019-10-11 12:28:24 CLIENT -> SERVER: Date: Fri, 11 Oct 2019 14:28:24 +0200 2019-10-11 12:28:24 CLIENT -> SERVER: To: User <[email protected]> 2019-10-11 12:28:24 CLIENT -> SERVER: From: NOREPLY <[email protected]>

Le mail.log pour celui-ci

Oct 11 12:57:46 smtpserver postfix/smtpd[25031]: connect from www1.exemple.org[ip1] Oct 11 12:57:46 smtpserver postfix/smtpd[25031]: Anonymous TLS connection established from www1.exemple.org[ip1]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits) Oct 11 12:57:46 smtpserver postfix/smtpd[25031]: 9B834C44006: client=www1.exemple.org[ip1], sasl_method=PLAIN, [email protected] Oct 11 12:57:46 smtpserver postfix/cleanup[25036]: 9B834C44006: message-id=<[email protected]> Oct 11 12:57:47 smtpserver postfix/qmgr[28569]: 9B834C44006: from=<[email protected]>, size=3148, nrcpt=1 (queue active) Oct 11 12:57:47 smtpserver postfix/smtpd[25031]: disconnect from www1.exemple.org[ip1] Oct 11 12:57:48 smtpserver dovecot: lda([email protected]): msgid=<[email protected]>: saved mail to INBOX Oct 11 12:57:48 smtpserver postfix/pipe[25037]: 9B834C44006: to=<[email protected]>, orig_to=<[email protected]>, relay=dovecot, delay=1.4, delays=0.69/0.04/0/0.7, dsn=2.0.0, status=sent (delivered via dovecot service) Oct 11 12:57:48 smtpserver postfix/qmgr[28569]: 9B834C44006: removed

Par contre avec dolibarr
Affichage

Échec de l'envoi de l'email (émetteur=Moi , [email protected]) Error [120]: Ran into problems sending Mail. Response: 535 5.7.8 Error: authentication failed: Invalid authentication mechanism Error [120]: Ran into problems sending Mail. Response: 502 5.5.2 Error: command not recognized Error [120]: Ran into problems sending Mail. Response: 502 5.5.2 Error: command not recognized Error [130]: Invalid Authentication Credentials.

Et le log du server smtp

Oct 11 12:59:34 smtpserver postfix/smtpd[25031]: connect from www1.exemple.org[ip1] Oct 11 12:59:34 smtpserver postfix/smtpd[25031]: Anonymous TLS connection established from www1.exemple.org[ip1]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits) Oct 11 12:59:34 smtpserver postfix/smtpd[25031]: warning: www1.exemple.org[ip1]: SASL LOGIN authentication failed: Invalid authentication mechanism Oct 11 12:59:34 smtpserver postfix/smtpd[25031]: lost connection after UNKNOWN from www1.exemple.org[ip1] Oct 11 12:59:34 smtpserver postfix/smtpd[25031]: disconnect from www1.exemple.org[ip1]

Existe t’il une solution pour utiliser une connexion SMPT en AUTH PLAIN ?
Sinon : pourquoi dolibarr n’utilise pas phpMailer ?

Merci :happy:

Bon,

Pour l’instant :
modifié à la mano :

            $this->socket_send_str('AUTH PLAIN', '334');
            if ( ! $_retVal = $this->socket_send_str(base64_encode("[!--###kunena-codeblock-0###--]" . $this->_smtpsID . "[!--###kunena-codeblock-0###--]" . $this->_smtpsPW), '235') )

Peut être une config en plus ?