Repository navigation
Madmail v2.47.4 introduces unified configuration precedence with deployment-level setting protection, hardened PGP/MIME encryption enforcement, automated legacy Maddy migration, server-wide contact-sharing controls, improved Windows compatibility, website theming and localization, and security dependency updates since baseline v2.42.0.
Highlights
- Unified Configuration Precedence & Protected Settings: Established a consistent configuration hierarchy across environment variables, explicit configuration-file settings, database-backed settings, and defaults. Operators can now enforce deployment-level configuration that cannot be overridden through the CLI or Admin API.
- Hardened Encryption Enforcement: Strengthened PGP/MIME validation to require a properly structured RFC 3156 encrypted message, closing an encryption-policy bypass while preserving legitimate Secure-Join handshakes and delivery status notifications.
- Legacy Maddy Migration: Improved upgrade workflows for older Maddy-based installations, automatically transitioning legacy systemd services and executable paths to the active Madmail binary while preserving existing configuration, accounts, and mail storage.
- Global Contact-Sharing Controls: Added server-wide management of public contact sharing through the CLI and Admin API, with changes taking effect immediately without a service restart.
- Improved Windows Compatibility: Fixed Maildir filename compatibility, streamed message storage, historical SQLite migration checksums, and TURN relay firewall configuration for Delta Chat audio/video calls.
- Website Theming & Localization: Introduced automatic, light, and dark appearance modes, optional operator-managed themes, expanded multilingual documentation, and an opt-in Airmail redesign of madmail.chat.
- AI Agent Email Documentation: Added a dedicated quick-start guide and installation shortcut for connecting AI assistants to encrypted email through Madmail's existing WebSMTP and WebIMAP interfaces.
What's Changed
Configuration & System Administration
- Unified operational configuration precedence as environment variables → explicit configuration-file settings → persisted database settings → legacy module directives and built-in defaults (#219 by @omidz4t).
- Added support for protected operational settings through
.confsettings { }blocks, top-level TOML registry keys, andCHATMAIL_*environment variables. - Added configuration-source reporting to CLI status commands, JSON output, and the Admin API, allowing operators to identify effective values, database overrides, and protected settings.
- Added deployment-setting protection to CLI and API mutations, returning
configuration_lockedwhen attempting to modify or reset a protected setting. - Added a source-only configuration-lock snapshot to ensure local CLI commands respect the running service's deployment protections even when their environment differs from systemd.
- Expanded explicit configuration support for administrative paths, message retention, TURN relay port ranges, and other operational settings.
- Preserved database-backed values while overridden by protected configuration, allowing them to become effective again when the protection is removed.
- Added startup diagnostics identifying protected settings and their controlling sources without exposing secret values.
Important upgrade note: Explicit environment variables and configuration-file settings now take precedence over database-backed values. To restore CLI/API management of a protected setting, remove its controlling configuration entry or environment variable and restart Madmail. Existing legacy module directives and installer-generated listener definitions remain overridable defaults. Changes to configuration files or environment variables require a full restart.
Installation, Upgrades & Legacy Migration
- Updated
madmail upgradeandmadmail updateto transition legacymaddy.serviceinstallations to the active Madmail binary while retaining existing configuration, state directories, service accounts, and custom unit settings (#245 by @KamyarAT). - Added
madmail legacy-migratefor repairing installations where the current Madmail binary is installed but the systemd service continues to execute an older Maddy binary. - Added interactive confirmation before switching legacy services during upgrades. Non-interactive and JSON-mode upgrades perform the migration automatically.
- Added support for systemd drop-ins when migrating vendor-provided service units, avoiding direct modifications to vendor files.
- Added migration validation, ambiguous-installation detection, running-process verification, and rollback handling when a service transition fails.
- Hardened legacy installation discovery to skip unreadable systemd units and avoid executing unrelated binaries during service identification (#245 by @KamyarAT, with follow-up improvements by @mamaru-a).
Admin API & Contact Sharing
- Fixed HTTP route remounting when the admin API path is changed or reset, preventing the server from remaining bound to an outdated administrative endpoint (#253 by @KamyarAT).
- Added
madmail admin-api pathto display, configure, or reset the administrative API endpoint directly from the host. - Added structured
appliedandrestart_requiredstatus fields to indicate whether an administrative path change was accepted by the running service. - Hardened administrative path validation to reject overlapping API/web interface paths and collisions with existing public POST routes before saving configuration changes.
- Disabled redirect following during administrative reload requests to prevent unintended forwarding of administrative credentials.
- Added a global contact-sharing switch managed through
madmail sharing enable,disable, andstatus, alongsideGETandPOST /admin/services/contact_sharing(#249 by @KamyarAT). - Disabling contact sharing now makes public sharing pages unavailable while preserving existing contact links, stored data, and administrative link-management operations.
Note: Database-backed contact-sharing changes take effect immediately without madmail reload or a server restart. Contact-sharing controls are currently available through the CLI and Admin API.
Mail Protocols & Encryption
- Hardened the PGP/MIME encryption gate to validate the parsed MIME structure rather than relying on the presence of encryption-related text within a message (#128 by @KamyarAT, with follow-up improvements by @mamaru-a).
- Enforced RFC 3156 message structure, requiring a
multipart/encryptedmessage containing the appropriateapplication/pgp-encryptedcontrol part andapplication/octet-streamdata part. - Hardened the delivery-status notification exception to require a correctly structured report and a legitimate
mailer-daemonsender address. - Preserved compatibility with legitimate Secure-Join handshakes and delivery status notifications.
- Added regression coverage for malformed encrypted messages and corrected SMTP and OpenMetrics test fixtures to preserve valid MIME formatting.
Storage & Database Compatibility
- Fixed Windows Maildir storage by using Windows-compatible message flag filenames while maintaining standard Maildir filenames on Unix-based systems (#256 by @KamyarAT).
- Added cross-platform recognition of both Maildir filename formats, preserving message identifiers, IMAP UIDs, and flags across restarts and flag changes.
- Fixed streamed message blob commits when content-addressable storage and deduplication are disabled by opening temporary files with write access and closing their handles before renaming.
- Fixed SQLite upgrade failures caused by historical differences between LF and CRLF migration-file line endings (#257 by @KamyarAT).
- Added recognition of exact historical migration checksums without modifying existing migration records or re-executing previously applied migrations.
- Normalized embedded SQLite migration files to LF and enforced validation of existing migration history before applying pending migrations.
- Updated database migration documentation with production-safe backup and recovery guidance.
TURN & Windows Packaging
- Fixed Windows Firewall configuration for TURN relay media traffic, resolving a firewall issue affecting Delta Chat audio/video calls on Windows-hosted relays (#117 by @KamyarAT).
- Updated
madmail firewall apply --turnto open the configured UDP relay port range rather than always using the compile-time default range. - Added the
--no-turninstallation flag to allow operators to disable TURN during installation. - Added an optional TURN component to the Windows installer, enabled by default, allowing operators to choose whether to provide Delta Chat audio/video relay services.
- Updated Windows installation documentation and verification checklists.
Website, Theming & Localization
- Added automatic, dark, and light appearance modes to the embedded website, with automatic mode following the browser's system appearance preference by default (#248 by @lebavard).
- Added persistent visitor appearance preferences, live system-theme detection, and automatic appearance support when JavaScript is disabled.
- Introduced CSS customization hooks and six optional palettes across three theme families: Primer, Millennium, and Frontier.
- Added an operator-managed theme switcher supporting palette installation, verification, and optional default appearance modes for exported website assets.
- Improved website accessibility through better link contrast, status badge readability, keyboard focus indicators, code-block styling, and removal of misleading hover effects.
- Fixed favicon rendering and ensured consistent favicon declarations across website pages.
- Added direct access to the embedded documentation from the main website navigation.
- Expanded Persian localization with right-to-left layouts, translated documentation, localized navigation, and improved sharing controls (#241 and related changes by @omidz4t).
- Added an accessible mobile screenshot viewer with drag scrolling and image enlargement.
- Fixed deployment commands to generate complete HTTPS download URLs while preserving custom ports.
- Added the Airmail redesign of madmail.chat, featuring English, Persian, Spanish, and Russian editions, self-hosted typography, localized metadata, structured data, and redesigned navigation (#240 by @mamaru-a).
- Improved search-engine and AI-agent discoverability through localized sitemap entries, crawler metadata, discovery response headers,
llms.txt, andsecurity.txt.
Note: The Airmail redesign is opt-in and can be previewed using ?new_template=true on madmail.chat. The existing website remains the default. Optional embedded website palettes are installed separately and are not bundled into the server binary.
Documentation & AI Agent Integration
- Added a comprehensive Persian PostgreSQL installation and SQLite-to-PostgreSQL migration guide covering Docker and native Debian, Ubuntu, and Fedora installations (#241 by @omidz4t).
- Added interactive operating-system and installation-method selectors to the Persian database guide, with a readable fallback when JavaScript is disabled.
- Expanded PostgreSQL documentation with backup procedures, password authentication, migration dry runs, destination database requirements, and post-migration verification.
- Clarified that SQLite and PostgreSQL are the currently supported database backends.
- Added a dedicated AI agent email quick-start guide covering installation, mailbox creation, encrypted message submission, retrieval, and local decryption using the existing WebSMTP and WebIMAP interfaces (#259 by @KamyarAT).
- Added a one-line Linux installation recipe and an AI agent installation shortcut to the public landing page.
- Documented secure mailbox credential handling, recipient-key verification, untrusted incoming email, and human approval requirements for AI-driven message submission.
- Corrected the AI agent guide links and Persian landing-page shortcut.
- Added debug logging guides in English, Persian, and Russian.
- Expanded CLI references, configuration documentation, manual pages, and technical design documentation.
Security & Dependencies
- Updated
sqlxto 0.9.1 andlibsqlite3-systo 0.40.0 to address RUSTSEC-2026-0459 (#250 by @KamyarAT). - Updated
quinn-prototo 0.11.19 andquinn-udpto 0.5.16 (#250 by @KamyarAT). - Updated
urlto 2.5.9 andform_urlencodedto 1.2.3 to address RUSTSEC-2026-0592 (#256, #257 by @KamyarAT). - Updated dynamically constructed SQL queries for SQLx 0.9 compatibility while retaining parameter binding.
- Raised the minimum supported Rust version to 1.94.
- Added a documented audit exception for RUSTSEC-2026-0620 affecting the nightly-only AVX-512 backend of
curve25519-dalek. Official Madmail builds use the stable Rust toolchain and do not compile the affected backend (#260 by @mamaru-a).
Build, Testing & Release Engineering
- Updated automated release versioning to keep generated releases within the current major version.
- Updated release dependency-version checks to reflect the new SQLite and SQLx versions.
- Added Docker-based regression coverage for configuration precedence, protected settings, PostgreSQL installation, and database migration workflows.
- Expanded regression coverage for Windows storage compatibility, administrative route changes, contact-sharing controls, encryption enforcement, and historical SQLite migration checksums.
- Added automated website localization, appearance-mode, theme-switcher, accessibility, and AI agent installation-recipe tests.
- Updated contributor workflows, development instructions, and branch-naming conventions.
Thanks
Thanks to @KamyarAT, @lebavard, @mamaru-a, and @omidz4t for their contributions to this release.
Full Changelog: [v2.42.0...v2.47.4](v2.42.0...v2.47.4)