diff --git a/library.json b/library.json index 7ddb7290..0f18463d 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "ESP Mail Client", - "version": "3.3.3", + "version": "3.3.4", "keywords": "communication, email, imap, smtp, esp32, esp8266, samd, arduino", "description": "Arduino E-Mail Client Library to send, read and get incoming email notification for ESP32, ESP8266 and SAMD21 devices. The library also supported other Arduino Devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.", "repository": { diff --git a/library.properties b/library.properties index 9f698021..d33b4f49 100644 --- a/library.properties +++ b/library.properties @@ -1,6 +1,6 @@ name=ESP Mail Client -version=3.3.3 +version=3.3.4 author=Mobizt diff --git a/src/ESP_Mail_Client.cpp b/src/ESP_Mail_Client.cpp index ff954054..47586142 100644 --- a/src/ESP_Mail_Client.cpp +++ b/src/ESP_Mail_Client.cpp @@ -2,7 +2,7 @@ #define ESP_MAIL_CLIENT_CPP #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif @@ -1287,10 +1287,9 @@ bool ESP_Mail_Client::beginConnection(Session_Config *session_config, void *sess { MB_String dbMsg; - bool isCb = false, debug = false; - ESP_MAIL_TCP_CLIENT *client = nullptr; #if !defined(SILENT_MODE) + bool isCb = false, debug = false; PGM_P p = isSMTP ? esp_mail_dbg_str_2 /* "connecting to SMTP server" */ : esp_mail_dbg_str_18 /* "connecting to IMAP server" */; #endif @@ -1298,10 +1297,11 @@ bool ESP_Mail_Client::beginConnection(Session_Config *session_config, void *sess { #if defined(ENABLE_SMTP) SMTPSession *smtp = (SMTPSession *)sessionPtr; + client = &smtp->client; +#if !defined(SILENT_MODE) isCb = isResponseCB((void *)smtp->_customCmdResCallback, isSMTP); debug = smtp->_debug; - client = &smtp->client; - +#endif if (!reconnect(smtp)) return false; @@ -1311,10 +1311,11 @@ bool ESP_Mail_Client::beginConnection(Session_Config *session_config, void *sess { #if defined(ENABLE_IMAP) IMAPSession *imap = (IMAPSession *)sessionPtr; + client = &imap->client; +#if !defined(SILENT_MODE) isCb = isResponseCB((void *)imap->_customCmdResCallback, isSMTP); debug = imap->_debug; - client = &imap->client; - +#endif if (!reconnect(imap)) return false; @@ -1561,7 +1562,7 @@ String ESP_Mail_Client::errorReason(bool isSMTP, int errorCode, const char *msg) { MB_String ret; -#if defined(ENABLE_ERROR_STRING) +#if defined(ENABLE_ERROR_STRING) && !defined(SILENT_MODE) // If there is server meanningful response (msg) is available, return it instead if (strlen(msg) > 0) @@ -1600,7 +1601,7 @@ String ESP_Mail_Client::errorReason(bool isSMTP, int errorCode, const char *msg) ret = esp_mail_error_client_str_2; /* "custom Client is not yet enabled" */ break; case MAIL_CLIENT_ERROR_NTP_TIME_SYNC_TIMED_OUT: - ret = esp_mail_error_network_str_1; /* "NTP server time reading timed out" */ + ret = esp_mail_error_network_str_2; /* "NTP server time reading timed out" */ break; case MAIL_CLIENT_ERROR_SESSION_CONFIG_WAS_NOT_ASSIGNED: ret = esp_mail_error_session_str_1; /* "the Session_Config object was not assigned" */ @@ -1617,7 +1618,7 @@ String ESP_Mail_Client::errorReason(bool isSMTP, int errorCode, const char *msg) #if defined(ENABLE_SMTP) case SMTP_STATUS_SERVER_CONNECT_FAILED: - ret = esp_mail_error_network_str_2; /* "unable to connect to server" */ + ret = esp_mail_error_network_str_1; /* "unable to connect to server" */ break; case SMTP_STATUS_SMTP_GREETING_GET_RESPONSE_FAILED: ret = esp_mail_error_smtp_str_1; /* "SMTP server greeting failed" */ @@ -1671,7 +1672,7 @@ String ESP_Mail_Client::errorReason(bool isSMTP, int errorCode, const char *msg) #if defined(ENABLE_IMAP) case IMAP_STATUS_SERVER_CONNECT_FAILED: - ret = esp_mail_error_network_str_2; /* "unable to connect to server" */ + ret = esp_mail_error_network_str_1; /* "unable to connect to server" */ break; case IMAP_STATUS_IMAP_RESPONSE_FAILED: ret = esp_mail_error_imap_str_18; /* "server replied NO or BAD response" */ diff --git a/src/ESP_Mail_Client.h b/src/ESP_Mail_Client.h index c7523639..b2ad2472 100644 --- a/src/ESP_Mail_Client.h +++ b/src/ESP_Mail_Client.h @@ -2,7 +2,7 @@ #define ESP_MAIL_CLIENT_H #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif diff --git a/src/ESP_Mail_Client_Version.h b/src/ESP_Mail_Client_Version.h index 47f04ee2..a24299cb 100644 --- a/src/ESP_Mail_Client_Version.h +++ b/src/ESP_Mail_Client_Version.h @@ -3,8 +3,8 @@ #ifndef ESP_MAIL_VERSION -#define ESP_MAIL_VERSION "3.3.3" -#define ESP_MAIL_VERSION_NUM 30303 +#define ESP_MAIL_VERSION "3.3.4" +#define ESP_MAIL_VERSION_NUM 30304 /* The inconsistent file version checking to prevent mixed versions compilation. */ #define VALID_VERSION_CHECK(ver) (ver == ESP_MAIL_VERSION_NUM) diff --git a/src/ESP_Mail_Const.h b/src/ESP_Mail_Const.h index 6c4f498f..82e7e394 100644 --- a/src/ESP_Mail_Const.h +++ b/src/ESP_Mail_Const.h @@ -6,7 +6,7 @@ #define ESP_MAIL_CONST_H #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif @@ -2551,7 +2551,7 @@ struct esp_mail_imap_response_data char *buf = nullptr; esp_mail_imap_response_data(int bufLen) { chunkBufSize = bufLen; }; - ~esp_mail_imap_response_data(){clear();} + ~esp_mail_imap_response_data() { clear(); } void clear() { if (response) @@ -3082,7 +3082,7 @@ static const char esp_mail_error_mem_str_10[] PROGMEM = "please make sure that t ///////////////////////// // Client error string -#if defined(ENABLE_ERROR_STRING) +#if !defined(SILENT_MODE) static const char esp_mail_error_client_str_1[] PROGMEM = "client and/or necessary callback functions are not yet assigned"; static const char esp_mail_error_client_str_2[] PROGMEM = "custom Client is not yet enabled"; static const char esp_mail_error_client_str_3[] PROGMEM = "simple Client is required"; @@ -3099,9 +3099,10 @@ static const char esp_mail_error_client_str_11[] PROGMEM = "the Connection Reque ///////////////////////// // Network error string +#if !defined(SILENT_MODE) +static const char esp_mail_error_network_str_1[] PROGMEM = "unable to connect to server"; #if defined(ENABLE_ERROR_STRING) -static const char esp_mail_error_network_str_1[] PROGMEM = "NTP server time reading timed out"; -static const char esp_mail_error_network_str_2[] PROGMEM = "unable to connect to server"; +static const char esp_mail_error_network_str_2[] PROGMEM = "NTP server time reading timed out"; static const char esp_mail_error_network_str_3[] PROGMEM = "response read timed out"; static const char esp_mail_error_network_str_4[] PROGMEM = "not connected"; static const char esp_mail_error_network_str_5[] PROGMEM = "connection timeout"; @@ -3109,6 +3110,7 @@ static const char esp_mail_error_network_str_6[] PROGMEM = "connection closed"; static const char esp_mail_error_network_str_7[] PROGMEM = "connection refused"; static const char esp_mail_error_network_str_8[] PROGMEM = "data sending failed"; #endif +#endif #if defined(ENABLE_ERROR_STRING) || !defined(SILENT_MODE) static const char esp_mail_error_network_str_9[] PROGMEM = "response read timed out"; diff --git a/src/ESP_Mail_Error.h b/src/ESP_Mail_Error.h index b1282109..f26e5268 100644 --- a/src/ESP_Mail_Error.h +++ b/src/ESP_Mail_Error.h @@ -7,7 +7,7 @@ #define ESP_MAIL_ERROR_H #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif diff --git a/src/ESP_Mail_FS.h b/src/ESP_Mail_FS.h index a1f0ab77..ddd9370d 100644 --- a/src/ESP_Mail_FS.h +++ b/src/ESP_Mail_FS.h @@ -6,7 +6,7 @@ #define ESP_MAIL_CONFIG_H #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif diff --git a/src/ESP_Mail_IMAP.h b/src/ESP_Mail_IMAP.h index 27b66156..99fd78ec 100644 --- a/src/ESP_Mail_IMAP.h +++ b/src/ESP_Mail_IMAP.h @@ -3,7 +3,7 @@ #define ESP_MAIL_IMAP_H #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif diff --git a/src/ESP_Mail_Print.h b/src/ESP_Mail_Print.h index ff75718b..357b5fd5 100644 --- a/src/ESP_Mail_Print.h +++ b/src/ESP_Mail_Print.h @@ -2,7 +2,7 @@ #define ESP_MAIL_PRINT_H_ #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif diff --git a/src/ESP_Mail_SMTP.h b/src/ESP_Mail_SMTP.h index 08466228..16cf5195 100644 --- a/src/ESP_Mail_SMTP.h +++ b/src/ESP_Mail_SMTP.h @@ -3,7 +3,7 @@ #define ESP_MAIL_SMTP_H #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif diff --git a/src/extras/MB_Time.h b/src/extras/MB_Time.h index de9b0f5d..80f34369 100644 --- a/src/extras/MB_Time.h +++ b/src/extras/MB_Time.h @@ -2,7 +2,7 @@ #define MB_Time_H #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif diff --git a/src/extras/RFC2047.cpp b/src/extras/RFC2047.cpp index dca1836d..f0121e32 100644 --- a/src/extras/RFC2047.cpp +++ b/src/extras/RFC2047.cpp @@ -2,7 +2,7 @@ #define RFC2047_CPP #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif diff --git a/src/extras/RFC2047.h b/src/extras/RFC2047.h index afbe4599..593f2b6b 100644 --- a/src/extras/RFC2047.h +++ b/src/extras/RFC2047.h @@ -4,7 +4,7 @@ #define RFC2047_H #include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30303) +#if !VALID_VERSION_CHECK(30304) #error "Mixed versions compilation." #endif diff --git a/src/wcs/esp8266/ESP8266_SSL_Client.cpp b/src/wcs/esp8266/ESP8266_SSL_Client.cpp index 1eb74020..7d009db9 100644 --- a/src/wcs/esp8266/ESP8266_SSL_Client.cpp +++ b/src/wcs/esp8266/ESP8266_SSL_Client.cpp @@ -1,9 +1,9 @@ /** * - * The Network Upgradable BearSSL Client Class, ESP8266_SSL_Client.cpp v2.0.4 + * The Network Upgradable BearSSL Client Class, ESP8266_SSL_Client.cpp v2.0.5 * - * Created June 17, 2023 + * Created July 28, 2023 * * This works based on Earle F. Philhower ServerSecure class * @@ -1503,7 +1503,7 @@ namespace BearSSL { #if !defined(SILENT_MODE) if (debugLevel > 0) - esp_mail_debug_print_tag(esp_mail_error_network_str_2 /* "unable to connect to server" */, esp_mail_debug_tag_type_error, true); + esp_mail_debug_print_tag(esp_mail_error_network_str_1 /* "unable to connect to server" */, esp_mail_debug_tag_type_error, true); #endif return false; } diff --git a/src/wcs/esp8266/ESP8266_SSL_Client.h b/src/wcs/esp8266/ESP8266_SSL_Client.h index 7c52c4ca..48f81f64 100644 --- a/src/wcs/esp8266/ESP8266_SSL_Client.h +++ b/src/wcs/esp8266/ESP8266_SSL_Client.h @@ -1,9 +1,9 @@ /** * - * The Network Upgradable BearSSL Client Class, ESP8266_SSL_Client.h v2.0.4 + * The Network Upgradable BearSSL Client Class, ESP8266_SSL_Client.h v2.0.5 * - * Created June 17, 2023 + * Created July 28, 2023 * * This works based on Earle F. Philhower ServerSecure class *