Email problems

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
elgringo
Posts: 92
Joined: Thursday 18 May 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Left
Contact:

Email problems

Post 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.
elgringo
Posts: 92
Joined: Thursday 18 May 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Left
Contact:

Re: Email problems

Post 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
TommySunny
Posts: 4
Joined: Wednesday 12 August 2015 13:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: NL
Contact:

Re: Email problems

Post 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
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Email problems

Post 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
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Email problems

Post 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).
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Email problems

Post by gizmocuz »

No issues here with my mail server (imap, port 587)
Quality outlives Quantity!
JaapB
Posts: 16
Joined: Friday 17 February 2023 13:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: Email problems

Post 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.
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Email problems

Post 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.
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Email problems

Post 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.
glsf91
Posts: 58
Joined: Tuesday 14 November 2017 21:56
Target OS: Linux
Domoticz version:
Contact:

Re: Email problems

Post 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.
Last edited by glsf91 on Tuesday 16 January 2024 20:51, edited 3 times in total.
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Email problems

Post by willemd »

But when I type the following lines at the terminal it works ...... strange

Code: Select all

openssl s_client -starttls smtp -connect smtp.ziggo.nl:587 -crlf
helo
auth login
base64encodedusername
base64encodedpassword
mail from:[email protected]
rcpt to:[email protected]
Data
From: [email protected]
To: [email protected]
Subject: test

mail test
.
quit
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Email problems

Post by gizmocuz »

turned out to be a mail server issue
Quality outlives Quantity!
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Email problems

Post 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.
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Email problems

Post by gizmocuz »

Could you have a look at the SMPTClient.cpp code to see if there need to be made any changes?
Quality outlives Quantity!
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Email problems

Post 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
glsf91
Posts: 58
Joined: Tuesday 14 November 2017 21:56
Target OS: Linux
Domoticz version:
Contact:

Re: Email problems

Post 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.
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Email problems

Post 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
glsf91
Posts: 58
Joined: Tuesday 14 November 2017 21:56
Target OS: Linux
Domoticz version:
Contact:

Re: Email problems

Post by glsf91 »

If you take my first curl command above, it is working with the mailfile contents:

Code: Select all

From: <email address>
test
But failing with:

Code: Select all

test
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.
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Email problems

Post 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:

Code: Select all

From: <email address>
test
But failing with:

Code: Select all

test
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.
glsf91
Posts: 58
Joined: Tuesday 14 November 2017 21:56
Target OS: Linux
Domoticz version:
Contact:

Re: Email problems

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest