STARTTLS connection failed

Hello Everyone,

After updating dolibarr from version 10 to version 11, I am unable to send emails from the dolibarr.
I am getting this error while sending emails.

Error [132]: STARTTLS connection failed. Error [121]: Couldn’t get mail server response codes Error [120]: Ran into problems sending Mail. Response:

Any help would be much appreciated.

Kind Regards,
Adnan

Hi Adnan,
Did you check your outgoing email settings? There you can find features to test your connectivity for different sending methods.

Hi @hORb,

My outgoing settings are

When I click the test server connectivity button, then I got the following response.

Server is available at address smtp.domain.com on port 587

In this Post, it mentioned that different domain-name and certificate-name create this issue but my domain and certificate name are same.

A couple of week ago I updated my mail server certificate, maybe the updating of mail server certificate cause this issue. Do I need to update something here in Dolibarr?.

Kind Regards,
Adnan

Are you really using this email provider or this is just for the example? What is the result when you try to test the sending?

Try to identify with full email address instead of using your username. Try to login/send email from other source/client.

HI,

Do you use self signed certificate ?

Hi @ksar ,

No, we are using Let’s encrypt certificate.

Hi @hORb

This is just an example,

When I test the sending email I got this error.

Error [132]: STARTTLS connection failed. Error [121]: Couldn’t get mail server response codes Error [120]: Ran into problems sending Mail. Response:

Even if I am sending emails using my gmail credentials still I got the STARTTLS connection error

Kind Regards,
Adnan

Hello,

I have a similar issue with my email, not sure if it´s related.

This is my situation:

Previous version 10.
Hosting provider is X
Emial provider is X
Everything worked well sending emails.

Changes:

Upgraded to version 11
Hosting provider X
Email provider changed to Google (Gsuite)
Now, under port 465 no connectivity with server.
Port 587 there is connectivity but can´t sent messages.

What happens?

The issue lays with the hosting provider and the email provider.
Email provider needs to be the same as the hosting provider, there´s some sort of connectivity issue.
MX´s records were updated, that´s not theissue.
Apparently it´s some sort of configuration that Dolibarr needs to be able to funciton in this situation (as per my hosting provider info)

I think this is what´s mention here:

Warning.png WARNING

Some email provider (like Yahoo) does not allow you to send an email from another server than the Yahoo server if the email address used as a sender is a Yahoo email (for example myemail@yahoo.com, myemail@yahoo.fr, …). If you sue the PHPmail method, it means you will use the server of your application to send emails, so some recipients (the one compatible with DMARC protocol), will ask Yahoo if they can accept your email and Yahoo will respond “no” because the server is not a Yahoo server, and some of your Emails may not be received.
If like Yahoo, your Email provider has this restriction, you must set this setup to choose the other method “SMTP/SMTPS socket library” and enter here the SMTP server and credentials provided by your Email provider.

https://wiki.dolibarr.org/index.php/Setup_EMails

We did several tryouts, just to ammusse you I mention them below:

Under another two hosting provider (amazon and I don´t remember the other) we used my email credentials (gsuite). It worked well, no issues at all.
Answer: Email provider communication with dolibarr is not the issue, credentials with gmail are fine.

Under my hosting provider we installed another dolibarr account, same issue.
Answer: My dolibarr settings are not the issue.

Now, I asked my hosting provider to change back the MX records as if I don´t have gsuite, and only tu use my hosting provider´s email platform.
Answer: It worked well, email sending was fine…

So, I either needs to change my hosting provider, or
find a work around if there´s any in dolibarr,
or change back my email provider, which is not an option.

Any comments??? thanks

Hi,

Normally if you do exactly what is described there : https://wiki.dolibarr.org/index.php?title=Setup_EMails#Gmail_.28with_login.2Fpass.29
it should work !

Hello @canfest,

I tried this setting and it’s working again properly.

you can try this setting, maybe your problem will also be solved.

Kind Regards,
Adnan

Hello @adnam, I tried and didn’t work. I asked my hosting provider to fix some parameters as the leafdns shows some errors and warnings, it’s taking ages… I hope that can be fixed, otherwise I may need to change the hosting provider.

Hello @ksar,

Again I am having trouble while sending emails using dolibarr, as I am only allowed to send emails to my domain group not others.

When I am trying to send emails to other than my domain I got this error.
No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS

Kind Regards,
Adnan

It looks like you have the first parameter set to yes…

Regards,
Marc

Hello @simicar,

The value of 1st parameter is NO as you can see in the attached pic.

Kind Regards,
Adnan

Hi Adnan,

Sorry I was busy elsewhere in the mean time. The message you get is connected to this parameter, which makes things very weird to me. If I understand it correctly, you can send to email addresses that belong to your mail server but not to outside email addresses, which points to a problem at the mail server level rather than at the way Dolibarr is sending mail. Why you get this message and not something more explicit is still mysterious.

By the way, what version of Dolibarr are you using and do you have any other active modules ? Do you have the possibility to inspect the log files (in Dolibarr which can be relatively verbose for mail sending, and in your mail server) ?

Regards,
Marc

Hello @simicar,
Yes I am able to send emails to my domain group not outside mail address. My mail server is working properly as I am able to send and receive emails on outlook.

The current Version of dolibarr is 11.0.3, yes several other modules are enabled on dolibarr. i can inspect Apache error log file and will post soon.

Kind Regards,
Adnan

I encountered the same issue and resolved it the same way. It appears the swift mailer socket library is more robust.

DOLIBARR ENVIRONMENT

  • Version: [11.0.3]
  • Operating System: [Linux j-copew2 3.13.0-100-generic #147-Ubuntu SMP Tue Oct 18 16:48:51 UTC 2016 x86_64]
  • Web Server: [ Apache/2.4.18 (Ubuntu)]
  • PHP: [ 7.0.33-0ubuntu0.16.04.14]
  • Database: [ 5.7.29-0ubuntu0.16.04.1]
  • URL(s): [Affected URL(s) are behind firewall]
1 Like

Hello,

I’m having the same (or related) problem with V18:

Error [120] : I had problems sending mail. Answer: 451 5.7.3 STARTTLS is required to send mail

It seems that STARTTLS is not enabled even though I checked the box. Do you know how to solve this problem?