# Error when sending E-Mail to certain providers because of SMTP protocol violation

**URL:** <https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053>\
**Category:** Other native modules\
**Tags:** Issue\
**Created:** [March 3, 2025, 8:05pm UTC](https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053 "2025-03-03T20:05:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sn0b4ll](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/6de8d8/32.png) [@sn0b4ll](https://www.dolibarr.org/forum/u/sn0b4ll)\
**Post date:** [March 3, 2025, 8:05pm UTC](https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053/1 "2025-03-03T20:05:00Z")

</div>

Hey there,

since my update to 20.3 mails send by dolibarr bounce when sending invoices via E-Mail to certain customers.

The error I get on the failed delivery report mail is:  
`SMTP error from remote server for TEXT command, host: smtpin.rzone.de (81.169.145.97) reason: 554 5.6.0 SMTP protocol violation: A header line must be terminated by CRLF`

It seems like certain Mail-Service-Providers (here Strato) are blocking the E-Mails, while others (Telekom, Proton, [Web.de](http://Web.de)) are accepting the messages. I suspect that Dolibarr is encoding the Mail-Header in an non RFC-Compliant way, since Stratro recently started enforcing RFCs more strictly.

Did anyone of you also have a similar problem and / or has a solution?

Many thanks!

Greetings,  
sn0b4ll

Edit: Typos

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [March 3, 2025, 10:29pm UTC](https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053/2 "2025-03-03T22:29:57Z")

</div>

oh, where do you see the error report? does it bounce back to you, or is it in the mailserver log?

---

<div class="post-metadata">

**Author:** ![sn0b4ll](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/6de8d8/32.png) [@sn0b4ll](https://www.dolibarr.org/forum/u/sn0b4ll)\
**Post date:** [March 3, 2025, 10:41pm UTC](https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053/3 "2025-03-03T22:41:46Z")

</div>

Hey 👋

it bounces back to my mail account. The sending itself looks fine, seeing no errors in the logs of dolibarr.

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [March 4, 2025, 7:28am UTC](https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053/4 "2025-03-04T07:28:40Z")

</div>

does it state which header is the issue?

My expectation is that it is a PHP library that actually sends the email, which PHP version are you running?

Could it be something that your SMTP server adds before sending it on?

---

<div class="post-metadata">

**Author:** ![sn0b4ll](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/6de8d8/32.png) [@sn0b4ll](https://www.dolibarr.org/forum/u/sn0b4ll)\
**Post date:** [March 4, 2025, 5:22pm UTC](https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053/5 "2025-03-04T17:22:42Z")

</div>

Hey 👋

sadly no, just that overall error and afterwards the mail itself.

I noticed that the subject and nail addresses are encoded in utf-8, while they should be ASCII according to the RFC? But that’s a wild guess from my side.

I can give you feedback on the version in the upcoming days, but I am using the docker version. I will check when I am at the location again.

The SMTP server is not the problem, I am able to send mails via Thunderbird and the same credentials to addresses that bounce when addressed via dolibarr :confused:

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [March 4, 2025, 6:10pm UTC](https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053/6 "2025-03-04T18:10:59Z")

</div>

If you use the docker image, there is no reason to supply the PHP version, that can be inferred from the docker image.

Okay, that does not seem to be a SMTP server issue - through probably IP address and/or username is different for your Thunderbird and your Dolibarr.

I think you should report the issue on github as a bug, and include as much information as possible.

> **[Dolibarr/dolibarr](https://github.com/Dolibarr/dolibarr/issues)**
>
> 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 W...

---

<div class="post-metadata">

**Author:** ![Joey](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/f14d63/32.png) [@Joey](https://www.dolibarr.org/forum/u/Joey)\
**Post date:** [March 10, 2025, 8:16pm UTC](https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053/7 "2025-03-10T20:16:49Z")

</div>

I had a similar issue after dolibarr update from 19.0.2 to 20.0.3 with following Error using Strato Server  
"error during sending E-Mail (Sender=my company[my@domain.com](mailto:my@domain.com), [Receiver=me@domain.com](mailto:Receiver=me@domain.com))  
Error [120]: Ran into problems sending Mail. Response: 554 5.6.0 SMTP protocol violation: A header line must be terminated by CRLF "

i changed from SMTP/SMTPS socket library (works on 19.0.2) to Swift Mailer socket library (works on 20.0.3)  
all other settings remain the same.

brgds  
Joey

---

<div class="post-metadata">

**Author:** ![Dolisupport.nl](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/dolisupport.nl/32/3564_2.png) [@Dolisupport.nl](https://www.dolibarr.org/forum/u/Dolisupport.nl)\
**Post date:** [March 26, 2026, 2:49pm UTC](https://www.dolibarr.org/forum/t/error-when-sending-e-mail-to-certain-providers-because-of-smtp-protocol-violation/30053/8 "2026-03-26T14:49:59Z")

</div>

I had the same issue and debugged. I found in my installation that I had MAIN\_FIX\_FOR\_BUGGED\_MTA set to 1. This setting removes crlf lines for bugged providers, but I had a correct provider that checks on correct crlf lines.  
So in Setup→Other settings I added MAIN\_FIX\_FOR\_BUGGED\_MTA to 0 with description “Set to zero for correct crlf line”.  
And it works again with regular smtp.
