-
v2.0.2 Stable
released this
2025-03-01 11:07:46 +03:00 | 0 commits to main since this release📅 Originally published on GitHub: Sat, 01 Mar 2025 08:08:26 GMT
🏷️ Git tag created: Sat, 01 Mar 2025 08:07:46 GMTVersion 2.0.2
New Features:
-
Robust Connection Recovery with Backoff Strategy:
- Implemented an exponential backoff strategy (capped at 5 minutes) for reconnecting after failures.
- Improved connection lifecycle management to handle unstable network conditions.
-
Connection Health Status Tracking:
- Monitors the health of IMAP connections to detect failures and take corrective actions.
- Tracks last error messages and retry attempts for better diagnostics.
-
Watchdog Thread for Monitoring IMAP Threads:
- A dedicated watchdog thread ensures that all IMAP threads remain responsive and automatically restarts any dead connections.
-
IDLE Timeouts and Periodic Connection Verifications:
- Every 10 minutes, an IDLE timeout check is performed to verify the connection status.
- NOOP commands are sent after email processing to confirm connection health.
-
New Prometheus Metrics:
reconnect_attempts_total: Tracks the number of reconnection attempts.idle_timeouts_total: Counts occurrences of IDLE timeouts.active_connections: Gauge metric indicating the number of active IMAP connections.
-
New Web API Endpoint for Resetting Connections:
- Introduced
/reset/<email_user>/<folder>to manually reset IMAP connections for specific accounts and folders.
- Introduced
-
Global Shutdown Flag:
- Ensures a cleaner termination of the service by signaling all threads to exit gracefully.
-
Console Logging Handler:
- Improved debugging visibility by adding a console logging option for real-time monitoring.
-
Configurable Maximum Retry Attempts and Backoff Strategy:
- Allows fine-tuning of retry limits and backoff timing for better resilience in unstable environments.
Bug Fixes:
-
IMAP Connection Freezing After Errors:
- Fixed an issue where IMAP connections could freeze and become unresponsive after encountering certain errors.
-
Thread Deadlocks in Failed Connections:
- Addressed deadlock scenarios where failed connections could cause entire threads to hang indefinitely.
-
Proper Release of Socket Resources:
- Ensured that sockets are correctly released when errors occur, preventing resource exhaustion.
-
Improved Handling of IDLE Mode Disconnections:
- Now properly detects and handles server disconnections during IDLE mode to avoid missed emails.
-
Prevented Email Processing on Unhealthy Connections:
- Ensured that email fetching only occurs when connections are verified to be healthy.
-
Improved Error Handling in IMAP Operations:
- Strengthened error handling in critical IMAP functions to avoid unexpected failures.
-
Proper Cleanup in Error Paths:
- Ensured all temporary states and resources are cleaned up when errors occur.
-
Resolved Blocking Sockets Preventing Proper Shutdown:
- Fixed an issue where certain socket operations could block indefinitely, preventing graceful shutdown.
Changes:
-
Improved Error Handling with Contextual Logging:
- Enhanced logging to provide more context on errors, including thread identification.
-
Enhanced Shutdown Sequence:
- Ensured that all threads and network resources are properly cleaned up during termination.
-
Modified Initial Notification Test Behavior:
- Startup no longer fails if the initial notification test encounters a warning; it now logs a warning instead of an error.
-
Enhanced
/statusAPI Endpoint:- The status endpoint now provides more detailed connection health information.
-
Translated Italian Comments to English:
- Standardized all code comments in English for consistency.
-
Implemented Proper Retry System:
- Added an exponential backoff mechanism for reconnections, improving reliability.
Enhancements:
-
Improved Socket Resource Management:
- Optimized the allocation and release of socket resources to prevent leaks.
-
Thread Safety During Shutdown:
- Ensured that shutdown operations do not interfere with active threads.
-
Better Error Recovery and Resilience:
- Improved handling of network failures to recover gracefully without service interruption.
-
Enhanced Email Fetching and Parsing Error Handling:
- Strengthened parsing logic to handle edge cases and avoid crashes.
-
Improved Connection Lifecycle Management:
- Ensured that connections are created, monitored, and closed in a structured manner.
-
Overall Stability in Unreliable Network Conditions:
- Significant improvements in handling network timeouts, disconnections, and transient failures.
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
-
v2.0.1 Stable
released this
2025-02-22 20:19:13 +03:00 | 2 commits to main since this release📅 Originally published on GitHub: Sat, 22 Feb 2025 17:20:04 GMT
🏷️ Git tag created: Sat, 22 Feb 2025 17:19:13 GMTVersion 2.0.1
Enhancements:
- Better TERM and CTRL+C support.
- Better config.ini.sample.
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
v2.0 Stable
released this
2025-02-22 16:50:18 +03:00 | 6 commits to main since this release📅 Originally published on GitHub: Sat, 22 Feb 2025 13:51:33 GMT
🏷️ Git tag created: Sat, 22 Feb 2025 13:50:18 GMTVersion 2.0
New Features:
-
Web Interface and API with Flask:
- Introduced a Flask-based web interface providing endpoints for service status (
/status), recent logs (/logs), and current configuration (/config). - The
/statusendpoint is publicly accessible and returns a simple status (OK or ERROR) indicating if all email accounts are connected and functioning properly. - When accessed with a valid API key, the
/statusendpoint provides detailed information about each monitored email account. - The
/logsand/configendpoints require an API key for access and are secured to prevent unauthorized viewing of sensitive information.
- Introduced a Flask-based web interface providing endpoints for service status (
-
Dynamic Configuration Reload:
- Implemented the ability to reload the configuration without restarting the service by sending a
SIGHUPsignal to the process. - The service re-reads the
config.inifile and updates its settings accordingly, allowing for dynamic adjustments.
- Implemented the ability to reload the configuration without restarting the service by sending a
-
Prometheus Metrics Integration:
- Integrated Prometheus client to expose metrics for monitoring service performance.
- Metrics include the total number of emails processed, notifications sent, processing time, and the number of errors encountered.
- Metrics are available via an HTTP endpoint, configurable in the
config.inifile.
Enhancements:
-
Optional Support for Apprise:
- Made the support for Apprise optional. If Apprise is not installed, the program continues to function using other notification providers (NTFY, Gotify, Pushover) without errors.
- At startup, the program logs whether Apprise is available and adjusts functionality accordingly.
-
Configurable Flask and Prometheus Servers:
- Both the Flask web interface and the Prometheus metrics server can now be enabled or disabled via the configuration file.
- If
FlaskHostandFlaskPortare not specified inconfig.ini, the Flask web interface will not start. - Similarly, if
PrometheusHostandPrometheusPortare not specified, the Prometheus metrics server will not start. - This provides flexibility in deploying the service with only the desired features enabled.
-
Improved Security in Web Interface:
- Implemented an API key mechanism for accessing sensitive endpoints (
/configand/logs). - Sensitive information such as passwords, tokens, and URLs are redacted in the
/configendpoint to prevent security breaches. - The
/statusendpoint provides detailed account information only when accessed with a valid API key.
- Implemented an API key mechanism for accessing sensitive endpoints (
-
Enhanced Logging:
- The program now logs the availability of optional modules (Apprise, Flask, Prometheus) and indicates which features are active based on the configuration.
- Improved logging practices to ensure that sensitive information (passwords, tokens) is never written to the logs.
Changes:
-
Refined
/statusEndpoint Behavior:- The
/statusendpoint now returns a simple status (OK or ERROR) when accessed without an API key, suitable for monitoring systems. - When accessed with a valid API key, it provides detailed status information for each email account.
- The
-
Conditional Module Imports:
- The imports for Apprise, Flask, and Prometheus are now conditional.
- If these libraries are not installed, the program continues to run without errors, and the associated features are automatically disabled.
- This allows for a more customizable setup based on available dependencies.
-
Configuration File Updates:
- Added new configuration options in
config.iniunder the[GENERAL]section:FlaskHostandFlaskPortfor configuring the Flask web interface.PrometheusHostandPrometheusPortfor configuring the Prometheus metrics server.APIKeyfor securing access to sensitive API endpoints.
- Updated the parsing logic to handle these new options and activate features accordingly.
- Added new configuration options in
Upgrade Notes:
-
Configuration Update Required:
- Update your
config.inifile to include the new configuration options if you wish to use the Flask web interface and Prometheus metrics server. - Add the
APIKeyunder the[GENERAL]section to secure access to the/configand/logsendpoints. - Existing configurations will continue to work, but adding the new options is necessary to enable the latest features.
- Update your
-
Library Dependencies:
- Install the
Flaskandprometheus_clientlibraries if you intend to use the web interface and Prometheus metrics.
- Install the
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
-
v1.1 Stable
released this
2024-11-18 22:31:14 +03:00 | 17 commits to main since this release📅 Originally published on GitHub: Mon, 18 Nov 2024 19:33:38 GMT
🏷️ Git tag created: Mon, 18 Nov 2024 19:31:14 GMTVersion 1.1
New Features:
-
Per-Account Notification Providers:
- Each email account can now have its own set of notification providers (Apprise, NTFY, Pushover, Gotify) configured separately from the global settings. This adds flexibility for account-specific notifications.
- Added a
parse_notification_providers()function to handle both global and account-specific notification setups.
-
Dynamic Notification Provider Configuration:
- Ability to define notification providers globally or per account. If an account lacks its own configuration, it falls back to the global providers.
- Enhanced handling of configuration sections in
config.ini, allowing for custom notifications per account.
-
Refactoring of the
IMAPHandlerClass:- Now supports a
notifierparameter to send notifications in case of errors or new messages, specific to the monitored account.
- Now supports a
Enhancements:
-
Configuration Validation:
- Simplified validation to ensure at least one section starting with
EMAILexists, supporting multiple accounts seamlessly.
- Simplified validation to ensure at least one section starting with
-
Improved Logging & Error Handling:
- Enhanced error notifications for each account. If a connection error occurs during idle, a notification is sent via the account-specific
notifier. - Increased granularity in notifications and logs to track specific connection errors and timeouts.
- Enhanced error notifications for each account. If a connection error occurs during idle, a notification is sent via the account-specific
-
Extended Support for NTFY Notifications:
- Improved support for NTFY, allowing optional authentication tokens for each configured URL.
- Streamlined configuration handling for NTFY, Pushover, and Gotify to support multiple notification services.
-
Thread-Safe Email Processing:
- Optimized the use of
Lockwithin theMultiIMAPHandlerclass to ensure thread-safe email processing without conflicts.
- Optimized the use of
Changes:
-
Configuration (
config.ini):- Added support for account-specific notifications (
EMAIL:accountsections). [APPRISE],[NTFY],[PUSHOVER], and[GOTIFY]sections can now be defined globally or for individual accounts.
- Added support for account-specific notifications (
-
Improved
test_config()Function:- Now tests both global and account-specific providers to ensure all configurations are correctly set up before starting the service.
-
Enhanced
multi_account_main()Function:- Improved handling of multiple accounts with account-specific notifications. Accounts without dedicated providers will use the global notifier if available.
Bug Fixes
- IMAP Connection Stability:
- Fixed an issue that caused premature disconnections from the
IDLEmode under certain network conditions.
- Fixed an issue that caused premature disconnections from the
Upgrade Notes:
-
Configuration:
- Update your
config.inito include new sections for account-specific notification providers. See the new config.ini.sample for reference. - Existing configurations will continue to work, but adding the new sections is recommended to take full advantage of the latest features.
- Update your
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
-
v1.0 Stable
released this
2024-07-02 15:49:33 +03:00 | 21 commits to main since this release📅 Originally published on GitHub: Tue, 02 Jul 2024 12:53:20 GMT
🏷️ Git tag created: Tue, 02 Jul 2024 12:49:33 GMTVersion 1.0
New Features:
- Log Rotation: Added support for log rotation. You can now configure log rotation based on size or time. This helps in managing log file sizes and ensures that old log files are archived.
- Thread-Safe Email Processing: Improved the email processing to be thread-safe, ensuring that multiple email accounts can be processed simultaneously without conflicts.
- Enhanced Configuration Validation: Added a
validate_configfunction to ensure required sections are present in theconfig.inifile before proceeding. - Improved Logging: Introduced more robust logging mechanisms with options for size-based or time-based log rotation.
Changes:
- Logging Enhancements:
- Introduced
RotatingFileHandlerandTimedRotatingFileHandlerfor better log management. - Updated the logging configuration to use parameters from
config.inifor log rotation.
- Introduced
- Codebase:
- Refactored the
DatabaseHandlerclass to use context management for better resource handling. - Added a
Lockmechanism in theMultiIMAPHandlerclass to ensure thread-safe email processing. - Improved error handling and logging across the codebase to provide clearer insights and more robust operations.
- Refactored the
- Configuration (
config.ini):- Introduced new configuration keys under
[GENERAL]:LogRotationType,LogRotationSize,LogRotationInterval, andLogBackupCountfor log rotation settings.
- Introduced new configuration keys under
Upgrade Notes:
- To use the new log rotation feature, update the
config.inifile to include the new[GENERAL]configuration keys related to log rotation. - Ensure that the
config.inifile is properly validated using the new validation mechanism.
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
mirror of
https://github.com/draga79/NotiMail.git
synced 2026-04-26 14:15:54 +03:00