Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.47k stars 2.8k forks source link

Sending mail error dolibarr 18.0.1 #25837

Open gabarchinco opened 1 year ago

gabarchinco commented 1 year ago

Bug

I had this error when sending mail with valid login and cred OVH. I ttried also with google smpt with app credential but no way.


CMailFile::sendfile: sendMsg, HOST=ssl://ssl0.ovh.net, PORT=465
CMailFile::sendfile: mail SMTP error code 535
CMailFile::sendfile: mail end error with smtps lib to HOST=ssl://ssl0.ovh.net, PORT=465 - Error [120]: Ran into problems sending Mail.
Response: 535 5.7.1 Authentication failed
Error [130]: Invalid Authentication Credentials.

Environment Version

18.0.1

Environment OS

Linux 5485b5670d3b6.2.0-31-generic #31~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC

Environment Web server

Apache

Environment PHP

8.1.20

Environment Database

MySQL or MariaDB 11.1.2-MariaDB-1:11.1.2+maria~ubu2204

Environment URL(s)

No response

Expected and actual behavior

Send mail

Steps to reproduce the behavior

Install dolibarr 18.0.1 Configure the smtp login and cred Test sending mail to a recipicient

Attached files

No response

leonbrehme commented 1 year ago

Hi - thanks for sharing. Just to have more information for fixing: Has this mail-setup worked bevor? Or did you tried the first time on 18.0.1?

gabarchinco commented 1 year ago

Hi leonbrehme, Thank for replying. The mail-setup was working on 17.0.3. This happens after upgrading to 18.0.1. Also tried a new docker fresh install and no issue

leonbrehme commented 1 year ago

Mhh - i'm not familiar with the chances in the code from 17x to 18x. From my point of view it's most likely to have something to do with your specific installation. Is it possible to use a fresh install and restoring a backup?

Maybe it has something to do with the firewall? Just a random though. Right now I don't have any other idea...

gabarchinco commented 1 year ago

Ok, thanks, I will try a new installation in a non-dockerized environment

Antoine2tt commented 1 year ago

@gabarchinco Hi ! I'm running into the same problem for smtp working on another app

Have you managed to solve it ?

gabarchinco commented 1 year ago

Hi Antoine2tt, Not yet. I've tried the tuxgasy/dolibarr version in a fresh install but no way

Antoine2tt commented 1 year ago

@gabarchinco

Let's hope it'll be fixed in the next release then ! ^^

hregis commented 1 year ago

@Antoine2tt @gabarchinco I have no problem with sending email and my SMTP in v18! If that were the case I think a lot more people would complain about it. Have you tried with port 587 and STARTTLS? are you using "Swift Mailer socket library"? Try changing the password for your ovh email address and see if that fixes the problem.

Antoine2tt commented 1 year ago

@hregis I tried both SwiftMail and SMTP/SMTPS, the same exact mail config is working on other container (like Uptime Kuma, GLPI...), but it's not working with Dolibarr. Says Authentification failed... :(

hregis commented 1 year ago

@Antoine2tt is your email server also at OVH?

Antoine2tt commented 1 year ago

@hregis Nope, mine are on Ikoula, and i tried with Google Workspace too (both relay and direct smtp)

DH88UK commented 1 year ago

I was having the same issue since updating to 18.0.0, but i also changed server from Linux to Synology so that might be to blame. For me, the solution is to enable the OpenSSL extension in PHP. When I tried to check the email server settings, it told me SSL is not available in my PHP, however this isn't shown in the Admin Tools > About PHP checklist (or during install) so I never saw it before. Enabling that PHP extension and the email config now gives:

Use TLS (SSL) encryption | Yes

and emails can be sent successfully again.

Antoine2tt commented 1 year ago

@DH88UK In my case, i'm using the docker version of Dolibarr, i don't have any error message related to SSL :/

But thanks anyway !

agermain commented 1 year ago

Yeah, this was driving me crazy thinking it was my provider, does not work in v18 (running within docker). I tried with multiple providers and only rolling back to 17.0.3 worked.

Both were a fresh install so I doubt it has anything to do with a "specific installation".

Antoine2tt commented 1 year ago

@agermain

Sounds like that at least, we got a real issue here with mail !

MarcRaij commented 10 months ago

Hi,

Same issue here!! even upgrade to 18.0.4 is not working for me. I rolled back t 17.0.2 and I can send emails again. Strange!?!?!

Anybody a solution? Thanks

DH88UK commented 10 months ago

Hi,

Same issue here!! even upgrade to 18.0.4 is not working for me. I rolled back t 17.0.2 and I can send emails again. Strange!?!?!

Anybody a solution? Thanks

Did you try enabling SSL module in your PHP?

MarcRaij commented 10 months ago

@DH88UK

Thanks for the reply! If I search for SSL at the "About PHP" page these are the values

curl Value SSL Yes MULTI_SSL NO SSL Version OpenSSL/1.1.1l

imap Value SSL Support enabled

mysqlnd Value Core SSL = supported extended SSL = not supported

openssl Value OpenSSL support enabled OpenSSL Library Version OpenSSL 1.1.1l 24 Aug 2021 OpenSSL Header Version OpenSSL 1.1.1l 24 Aug 2021 Openssl default config C:\Apache24\conf/openssl.cnf openssl.cafile no value no value openssl.capath no value no value

Phar Value OpenSSL support enabled

PHP Variables Value OpenSSL Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar

I don't know if there is any SSL setting that shoeld be enabled that isn't. Appreciate your help!

Antoine2tt commented 10 months ago

Hi @MarcRaij

Email are working for me now

What provider are you using ?

Are you using "SMTP/SMTPS Socket Librairy" ? (this is the one i'm using)

MarcRaij commented 10 months ago

@Antoine2tt

Provider is Pcextreme, Yes, I'm using SMTP. but with STARTTLS enabled and port set to 587. (required by my provider) With these settings email is working in v17.02 but not in v18.02 (or v18.04).

must be some kind of change in the way V18 handles SMTP SSL or STARTTLS towards V17.

Antoine2tt commented 10 months ago

@MarcRaij

Alright Have you tried port 465 with STARTTLS OFF but SSL ON

It seems that you can use this too (according to : https://helpdesk.pcextreme.nl/support/solutions/articles/80001052784-how-to-use-my-e-mail-address)

Just for testing