diff --git a/CHANGELOG.md b/CHANGELOG.md index b5d35d05a..4a6c5d615 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file. - Webradio crash with invalid url (#21446) - Zigbee crash when removing `ZbName` (#21449) - ESP32 BLE fix scanning (#21451) +- `SendMail` watchdog restart during reconnect to SMTP server (#21454) ### Removed - Support of old insecure fingerprint algorithm. Deprecated since v8.4.0 (#21417) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index edf0f72fa..a8bee96c4 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -141,6 +141,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - Wrong timeout in `WebQuery` and `webclient` since Core3 [#21442](https://github.com/arendst/Tasmota/issues/21442) - Zigbee crash when removing `ZbName` [#21449](https://github.com/arendst/Tasmota/issues/21449) - Avoid connection errors when switching to safeboot to upload OTA firmware [#21428](https://github.com/arendst/Tasmota/issues/21428) +- `SendMail` watchdog restart during reconnect to SMTP server [#21454](https://github.com/arendst/Tasmota/issues/21454) - ESP32 BLE fix scanning [#21451](https://github.com/arendst/Tasmota/issues/21451) - Webradio crash with invalid url [#21446](https://github.com/arendst/Tasmota/issues/21446) - Berry Leds matrix alternate more and error about 'bri' attribute [#21431](https://github.com/arendst/Tasmota/issues/21431) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_01_2_webserver_esp32_mail.ino b/tasmota/tasmota_xdrv_driver/xdrv_01_2_webserver_esp32_mail.ino index 198b9cea5..e8fa3b84f 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_01_2_webserver_esp32_mail.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_01_2_webserver_esp32_mail.ino @@ -247,6 +247,9 @@ uint16_t SendMail(char *buffer) { /* Connect to server with the session config */ delay(0); + + smtp->closeSession(); // Fix watchdog due to long connection time (#21454) + if (smtp->connect(&session)) { /* Start sending the Email and close the session */ delay(0); @@ -264,7 +267,8 @@ uint16_t SendMail(char *buffer) { } } - if (smtp) { delete smtp; } + if (smtp) { delete smtp; + } for (uint32_t cnt = 0; cnt < MAX_ATTCHMENTS; cnt++) { if (attachments[cnt]) { free(attachments[cnt]);