Page 1 of 3
Email problems
Posted: Friday 12 January 2024 19:22
by elgringo
I run Domoticz 2024.1 on a Pi 4 (bullseye, 64-bit) in a docker container.
Since the update the mail sending does not work:
Code: Select all
2024-01-12 18:55:40.915 Error: SMTP Mailer: Error sending Email to: <XXXXXXX> !
2024-01-12 18:55:40.916 Error: libcurl: (56)
2024-01-12 18:55:40.916 Error: Failure when receiving data from the peer
where XXXXXXX is my mail, adres.
SMTP is used from Ziggo (smtp.ziggog.nl) with correct username password on port 587. Mail mailclient works without problems so the smtp server probably works
emailing via curl itself does not work either:
Code: Select all
curl --ssl smtp://smtp.ziggo.nl:587 --mail-from MYZIGGOMAIL --mail-rcpt XXXXXXX --user 'USERNAME:PWD' --upload-file /tmp/mail.txt
Same result:
Code: Select all
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5 0 0 100 5 0 13 --:--:-- --:--:-- --:--:-- 13
curl: (56) Failure when receiving data from the peer
Using port 465 has the same effect
Emailing from a email program does work.
Re: Email problems
Posted: Saturday 13 January 2024 8:45
by elgringo
Problem also exist earlier:
https://github.com/domoticz/domoticz/issues/3917
I used a relay server to bypass the problem, now it works again.
Docker container:
https://github.com/ix-ai/smtp
Re: Email problems
Posted: Sunday 14 January 2024 11:01
by TommySunny
Strangly it started after the upgrade to 2024.1;
- error occurs when sending emails from a notification
2024-01-14 10:55:15.887 Error: SMTP Mailer: Error sending Email to: <************************> !
2024-01-14 10:55:15.887 Error: libcurl: (56)
2024-01-14 10:55:15.888 Error: Failure when receiving data from the peer
2024-01-14 10:55:15.888
2024-01-14 10:55:15.888 Error: Notification failed (Email)
- no error occurs when sending a message from blocky
Re: Email problems
Posted: Tuesday 16 January 2024 10:49
by willemd
I also have the same problem after the upgrade to 2024.1 and 2024.2
2024-01-16 10:55:01.039 Error: SMTP Mailer: Error sending Email to: <
[email protected]> !
2024-01-16 10:55:01.039 Error: libcurl: (56)
2024-01-16 10:55:01.039 Error: Failure when receiving data from the peer
2024-01-16 10:55:01.039
2024-01-16 10:55:01.039 Error: Failed to send Email notification!
And this was after using this script:
Code: Select all
return {
on = {
timer = { 'every minute'},
},
data = {},
logging = {},
execute = function(domoticz, triggeredItem)
domoticz.notify('this is a test',domoticz.LOG_INFO)
end
}
Problem also occurs when testing from the settings page.
Issue raised on github
Re: Email problems
Posted: Tuesday 16 January 2024 12:12
by lost
willemd wrote: ↑Tuesday 16 January 2024 10:49
I also have the same problem after the upgrade to 2024.1 and 2024.2
Hello, still from 2024.1 build 15805 (the one bringing OZW back), planning to upgrade to 2024.2 this WE... and I still receive my alamr notifications (from Lua scripts) & just tried the email test: No issue. Maybe something linked to email provider? I use google smtp with application passwords (since their authentification changes pushing for Oauth2, but still allowing theses app passwd for legacy stuff, 1.5 years ago).
Re: Email problems
Posted: Tuesday 16 January 2024 13:55
by gizmocuz
No issues here with my mail server (imap, port 587)
Re: Email problems
Posted: Tuesday 16 January 2024 14:09
by JaapB
Over here the problems with sending email via the ziggo mailserver started somewhere last week, me running the 2023.2 build 15718 version.
+++++
2024-01-16 09:49:04.092 Error: SMTP Mailer: Error sending Email to: <jaap***@gmail.com> !
2024-01-16 09:49:04.092 Error: libcurl: (67)
2024-01-16 09:49:04.092 Error: Login denied
2024-01-16 09:49:04.092
2024-01-16 09:49:04.092 Error: Failed to send Email notification!
+++++
Tried using the gmail server with the same result.
So I think the problem is not related to the 2024 versions of domoticz.
Raspberry Pi 3B+
OS: Buster
There had been nu updates to the system prior to the start of this problem.
Rebooted, cleaned cache and problem stayed.
Performed update and upgrade but stil the problem exists.
Re: Email problems
Posted: Tuesday 16 January 2024 15:06
by willemd
I confirm.
I just started up my fresh compiled 2023.2 version and this now has the same problem.
Maybe something changed at ziggo side at the same time as domoticz upgrade, although no info on their website.
I called them and according to them, nothing has changed.
Re: Email problems
Posted: Tuesday 16 January 2024 16:44
by willemd
The problem definitely is at ziggo.nl but they are not prepared to investigate.
All my outgoing smtp mail via ziggo fails at the moment, also from other systems.
On the phone I got the newbie explanation. I only was referred to the page with SMTP settings (which of course I had already checked) and after that it was my problem.
I switched my notifications to gmail and that works without problems.
Re: Email problems
Posted: Tuesday 16 January 2024 20:25
by glsf91
It is not problem caused by the new 2024.x version of domoticz.
I have also this problem but using domoticz 2023.1 and also using smtp.ziggo.nl. It was working for years until a few days ago.
I have also other Linux systems using sendmail and these are still working with ziggo (same account).
It also works on the domoticz server when using curl ( 7.68.0):
Code: Select all
curl --ssl-reqd --url "smtps://smtp.ziggo.nl" --user "<user>:<password>" --mail-from "<from email address>" --mail-rcpt "<dest email address>" --upload-file "mailfile"
But this one is using TLS (1.2) right away when looking with wireshark. Same as domoticz is doing if using port 465 in domoticz.
It also works on the domoticz server with this one:
Code: Select all
curl --ssl --url "smtp://smtp.ziggo.nl:587" --user "<user>:<password>" --mail-from "<from email address>" --mail-rcpt "<dest email address>" --upload-file "mailfile"
In wireshark this is looking more like domoticz it is doing (only if you use port 587 in domoticz). First using plain SMTP and after some conversation switching to TLS (1.3!).
So something has changed at smtp.ziggo.nl causing this libcurl: (56) error.
Re: Email problems
Posted: Tuesday 16 January 2024 20:32
by willemd
But when I type the following lines at the terminal it works ...... strange
Re: Email problems
Posted: Wednesday 17 January 2024 8:14
by gizmocuz
turned out to be a mail server issue
Re: Email problems
Posted: Wednesday 17 January 2024 12:41
by willemd
gizmocuz wrote: ↑Wednesday 17 January 2024 8:14
turned out to be a mail server issue
Correct, the Ziggo server stopped accepting messages with a simple text string as message, it now needs to be a Mime multipart object.
I think the following happens:
The Ziggo server checks the From address and incorrectly reports an error. It then tries to take the From address from the Mime part. If that address is correct the message is sent. If that address is wrong or the Mime object is not present (because it is a simple string), then the message sending fails. This was confirmed by testing.
Re: Email problems
Posted: Wednesday 17 January 2024 13:02
by gizmocuz
Could you have a look at the SMPTClient.cpp code to see if there need to be made any changes?
Re: Email problems
Posted: Wednesday 17 January 2024 14:02
by willemd
gizmocuz wrote: ↑Wednesday 17 January 2024 13:02
Could you have a look at the SMPTClient.cpp code to see if there need to be made any changes?
Sorry, my C skills are not good enough to indicate changes. And also, the error is on the Ziggo server side, simple text string messages should be accepted.
When I try to read the code of SMTPClient.cpp, I see that depending on the contents of the message and whether it contains an attachment or not, the type of message is set (line 279 to 320). If this would be changed to always compose a multipart mime message, even in the case of a simple message with only a string in the subject without body or attachement, then that would be a workaround while the Ziggo error continues to exist.
Note I am not running beta so also testing would be hard for me to participate in.
I now found the following using Python (where fromaddress is my email address)
if I use smtplib.sendmail(fromaddress,toaddress,message)
while
message="test" then the message is not sent
but if
message="From: fromaddress, Subject: test" then the message is sent, but not accepted by the recipient due to multiple from addresses
and if it is composed as Mimemultipart then it works correctly
Re: Email problems
Posted: Wednesday 17 January 2024 15:23
by glsf91
willemd wrote: ↑Wednesday 17 January 2024 12:41
This was confirmed by testing.
How did you test this ?
Because in my test above with curl there is also no mime multipart as far as I know.
Re: Email problems
Posted: Wednesday 17 January 2024 15:29
by willemd
glsf91 wrote: ↑Wednesday 17 January 2024 15:23
willemd wrote: ↑Wednesday 17 January 2024 12:41
This was confirmed by testing.
How did you test this ?
Because in my test above with curl there is also no mime multipart as far as I know.
With a small python program using smtplib.sendmail
Re: Email problems
Posted: Wednesday 17 January 2024 15:56
by glsf91
If you take my first curl command above, it is working with the mailfile contents:
But failing with:
The mailserver is responding with: SMTP600 Message is not RFC 5322 compliant: 'From' header is missing or malformed
I can't see if this also is replied when sending from domoticz.
I don't see any mime multipart in my first example email.
But I also see the From is added in Domoticz to the message. So maybe something else.
Re: Email problems
Posted: Wednesday 17 January 2024 17:39
by willemd
glsf91 wrote: ↑Wednesday 17 January 2024 15:56
If you take my first curl command above, it is working with the mailfile contents:
But failing with:
The mailserver is responding with: SMTP600 Message is not RFC 5322 compliant: 'From' header is missing or malformed
I can't see if this also is replied when sending from domoticz.
I don't see any mime multipart in my first example email.
But I also see the From is added in Domoticz to the message. So maybe something else.
That seems to correspond with the experience I have when using python. Same error message.
In your first case, where you have the from email address in the message, the mail was sent, but was it also accepted by the recipient?
In my case the recipient (gmail) complained about mutiple from addresses and rejected the message.
My conclusion is again that the check at Ziggo on the correctness of the from address fails, although the address is correct.
Re: Email problems
Posted: Wednesday 17 January 2024 17:55
by glsf91
willemd wrote: ↑Wednesday 17 January 2024 17:39
In your first case, where you have the from email address in the message, the mail was sent, but was it also accepted by the recipient?
Yes.