-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Notification - EMail results in a timeout #5121
Comments
There has been a change in the email notification plugin, to support larger timeouts. |
Doesn't help. I had testet various timeouts. For the tests, I deleted all settings and made new ones, but without success. |
Do you run this on ESP32 or ESP8266? |
Do you send to a single receiver or multiple? (just looking through the most recent commits to that file) |
Can you also test using the test button on the config page? |
Can you also set the timeout to 12 or 20 seconds? |
I think there is a timeout when generating the mail content on the ESP32. An empty mail is then not sent and the connection is terminated. |
Please set log level to debug and provide us new log |
OK, found a few issues in the email code, though not sure it is "the fix" I will make a test build. |
Made a test build with both bin files (factory and OTA bin) for you: Please test on an easily assessible node as I was working on a test branch, with lots of other changes in the platform code.... |
Sorry, please wait until tomorrow. |
Maybe you can then test this build: https://github.com/letscontrolit/ESPEasy/actions/runs/10874920584 |
I'm sorry, but it doesn't work. Here are some useful (I hope) logs (Loglevel 4):
ESP_Easy_mega_20240915_normal_ESP32_4M316k_ETH Sep 15 2024 (from website above, not working)
I use 2 identical ESP32 with Ethernet connection and the same configuration. |
It looks like the 2nd logs do not have the debug log level set, is that correct? |
The debug level is the same for both: "Debug More (4)". Here is a more detailed log of the current firmware with the e-mail timeout (complete, no line deleted):
It is strange that between millisecond 49109 and 57112 no other line appears in the log as before or after. The ESP seems to stand still for 8 seconds, as if the email task is blocking everything. |
Looking at the code, that doesn't seems so 'strange'... |
Drat. I'm the guy that updated the SMTP code to work with a new mail server at my ISP. I was expecting the changes to be backwards compatible. But unfortunately I couldn't validate this since I don't use a mail server that works with the old version. But I can test any fixes you apply, to confirm they are compatible with both SMTP mail server handshakes. |
@thomastech Not sure if you caused these issues or maybe triggered some really flaky and bad code which was the old email implementation. I've been looking at the code this morning and at some point I had to stop while I have still some nails and hair left. Let's say there are more elegant ways to do stuff. I will commit a few of my changes, to see if it still builds and/or maybe even does change some behavior. |
Build running here: https://github.com/letscontrolit/ESPEasy/actions/runs/10912239870 Let's see if I have some time tomorrow to look into this and do some cleanup of the code. |
Indeed, it is a blocking code monster. |
I have tested previous versions of _N001_Email.cpp: before 2024-04-06: works The solution with the version before 2024-04-06 works for me. I can live with this backport. |
For me it isn't acceptable it ain't working anymore, so we will have to fix it anyway. |
@TD-er @thomastech @tonhuisman First problem is when server is really fast, so when you flush data from server you can't find status code 220 Another bug/problem are here: Line 442 in 762b94a
Line 460 in 762b94a
Line 476 in 762b94a
We wait for status code from server but you can find response could be "220 domain", "220-domain" or even"220+domain". |
I just merged @uzi18 's PR and the build is running here: https://github.com/letscontrolit/ESPEasy/actions/runs/10954520659 N.B. there is another known issue when having rules enabled, which I'm working on. |
Installed test build and my fussy email notification is still working. Here is the log (with sensitive info obscured):
|
Great! |
The test setup "ESP_Easy_mega_20240920_normal_ESP32_4M316k_ETH.bin" works in my environment. There are no blockages or timeouts.
Unfortunately, I can't test more now because I'm on the road. |
Should be merged in the 'mega' branch and also made available here: https://td-er.nl/ESPEasy/latest/ N.B. please test this 'latest' only on nodes which are easily reachable when things go wrong. |
Have installed test release. No issues during installation, appears to be working. Will run overnight and report back if I discover any problems. |
The reason I asked was because I had on 1 board the issue where the file system could not be mounted and thus ESPEasy did a factory reset. I have not seen this happening again, so it might still have been something I did wrong, but better safe than sorry. |
I have built a new firmware with the current sources. E-mail now works perfectly. I have a few rules running for the mail. No problems. |
Hello,
I am using the feature of E-Mail-Notifikation.
On newer Firmware (August 2024 and follow) I cant use this feature anymore.
I'm using the same configuration like on my old Firmware from october 2023, but I'm get a timeout:
On Serverside I can see a connect, follow by a disconnect 8 seconds later.
Have anyone an idea, whats wrong?
Note: I had test this with different smtp-servers and different accounts. The smtp-servers can receive mails on port 25.
Greetings, kuppe.
The text was updated successfully, but these errors were encountered: