A WordPress plugin that routes wp_mail() through the modern JMAP protocol (RFC 8620 / RFC 8621) instead of relying on PHP mail or a traditional SMTP plugin.
- Sends WordPress mail through any compatible JMAP server
- Discovers the JMAP session automatically via
.well-known/jmap - Handles redirected discovery endpoints and normalizes advertised API URLs for reverse-proxy setups
- Resolves the sender identity and Sent mailbox automatically
- Supports HTML and plain-text messages with plain-text fallback
- Supports CC, BCC, Reply-To, and file attachments
- Provides a dedicated Test Recipient field for admin test emails
- Shows account, identity, capabilities, and warnings in the connection test UI
- Includes a built-in mail log for recent sent and failed attempts
- Compatible with RFC 8620/8621 servers such as Stalwart Mail Server
- WordPress 5.8 or later
- PHP 7.4 or later
- A JMAP server that supports
urn:ietf:params:jmap:core,urn:ietf:params:jmap:mail, andurn:ietf:params:jmap:submission - An account with at least one usable sending identity
- Access to a mailbox with the
sentrole
- Download the plugin folder or a release zip.
- Upload the zip through Plugins → Add New → Upload Plugin, or copy the
bulwark-jmap-mailfolder to/wp-content/plugins/. - Activate the plugin.
- Open Settings → JMAP Mail.
- Enter your JMAP server URL, username, and password.
- Set From Name and From Email.
- Optionally set Test Recipient for the Send Test Email button.
- Enable the plugin and save.
- Run Test JMAP Connection.
- Run Send Test Email.
- Hooks into the WordPress
pre_wp_mailfilter to intercept outgoing mail. - Discovers the JMAP session from
{server}/.well-known/jmap. - Normalizes the advertised JMAP API and upload URLs to the configured public origin when needed.
- Resolves the mail account, sender identity, and Sent mailbox.
- Creates the message via
Email/set. - Submits the created message via
EmailSubmission/setusing the returned email id. - Records the result in the admin mail log.
- Test JMAP Connection validates session discovery and shows the resolved account, identity, capabilities, and warnings.
- Send Test Email sends to Test Recipient, then falls back to From Email, then the WordPress admin email.
- Mail Log stores the most recent 100 send attempts with timestamps, recipients, subjects, status, and error details.
- Clear Mail Log removes all stored log entries from the plugin settings page.
The mail log stores metadata only. It does not store message bodies or attachment contents.
Each entry can include:
- Timestamp
- Status (
sentorfailed) - Recipient
- From address
- Subject
- Attachment count
- Account id
- Identity id
- Created email id
- Failure message, if any
What is JMAP? JMAP (JSON Meta Application Protocol) is a modern open standard for email access and submission defined in RFC 8620 and RFC 8621. It replaces IMAP and SMTP with a JSON-over-HTTP protocol.
Does this replace SMTP plugins? Yes. Instead of configuring SMTP credentials, you configure your JMAP server and WordPress mail is submitted through JMAP.
Where does the test email go? The Send Test Email button sends to Test Recipient if it is set. If that field is empty, it falls back to From Email, then the WordPress admin email.
Why can the connection test succeed while sending still fails? Connection testing only proves that session discovery and basic account access work. Actual sending can still fail if the selected account has no valid sending identity, no accessible Sent mailbox, or if the server rejects submission details.
Is my password stored securely?
The password is stored in the WordPress options table. For higher-security deployments, consider moving credentials into wp-config.php constants or another secret-management layer.
- Generated release archives can be stored in the
releases/directory. - The repository includes a
.gitignorerule so generated zip files inreleases/are not committed accidentally.
- Initial release of the WordPress JMAP mailer
- JMAP session discovery and authentication
- Compatibility fixes for redirected discovery endpoints and strict JMAP servers
- Email creation via
Email/setfollowed by submission viaEmailSubmission/set - HTML/plain-text messages, CC/BCC/Reply-To, and attachment support
- Admin connection diagnostics, identity display, and dedicated test recipient
- Built-in mail log for sent and failed messages

