=== WebDig.DEV SMTP ===
Contributors: webdigpt
Tags: smtp, email, mail, failover
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.8
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Private SMTP delivery for WordPress with backup transport, automatic failover, queueing, rate limits and local delivery logs.

== Description ==

WebDig.DEV SMTP gives WordPress administrators direct control over outgoing email without requiring a remote setup wizard or a third-party configuration service.

SMTP credentials are stored on the WordPress installation and are used to configure WordPress email delivery. The plugin supports a primary SMTP transport and an optional backup transport for automatic failover.

= Main features =

* Primary SMTP transport.
* Optional backup SMTP transport.
* Automatic failover for temporary delivery problems and, when enabled, authentication failures.
* Persistent database-backed retry queue when delivery is temporarily unavailable, with administrative handling of uncertain and abandoned messages.
* Configurable hourly and daily recipient limits with MySQL concurrency protection.
* Configurable maximum recipients per message.
* Local delivery log with Delivery ID, transport, status and recipient addresses.
* SMTP test tool with Primary, Backup and simulated failover modes.
* SPF, DKIM, DMARC and BIMI checks for the configured From Email domain.
* SMTP transport DNS and SPF diagnostics.
* Automatic DKIM selector discovery with optional manual selector override.
* Password fields can be left blank when saving settings to preserve the existing password.
* Optional SMTP passwords defined in wp-config.php instead of the database.
* Shared WebDig.DEV administration menu architecture for WebDig.DEV plugins.

= Privacy by design =

WebDig.DEV SMTP does not require an external setup wizard and does not send SMTP credentials to WebDig.DEV for configuration.

When local logging is enabled, delivery information can include recipient email addresses, delivery status, transport information and error messages. Administrators can disable logging and configure how many log entries are retained.

The optional mail-tester.com link displayed in the administration area is only a link. The plugin does not automatically transmit information to that service.

SMTP acceptance is not proof of final inbox delivery. If a worker stops after SMTP acceptance but before local confirmation, the message may be marked uncertain for manual review to avoid an automatic duplicate.

== Installation ==

1. Upload the `webdig-dev-smtp` folder to `/wp-content/plugins/`, or install the plugin through the WordPress Plugins screen when available in the WordPress.org Plugin Directory.
2. Activate **WebDig.DEV SMTP** through the **Plugins** screen.
3. Open **WebDig.DEV > SMTP**.
4. Configure the Primary SMTP transport.
5. Optionally enable and configure the Backup SMTP transport.
6. Save the settings and use **Send Test Email** to verify delivery.
7. Review the Email Domain Health and Transport Health panels for configuration warnings.

== Frequently Asked Questions ==

= Does this plugin handle Gravity Forms and Contact Form 7 emails? =

Messages sent through WordPress wp_mail() use this plugin's SMTP transport, including standard form notifications. API-based delivery, direct mail() calls and independent PHPMailer instances may bypass WordPress mail hooks. Avoid running competing SMTP plugins.

= How can I confirm a message used WebDig.DEV SMTP? =

Look for X-WebDig-SMTP and X-WebDig-Delivery-ID in the received message source. Match the Delivery ID with the local log. These diagnostic headers contain no credentials; a receiving mail service may remove them.


= Are my SMTP credentials sent to WebDig.DEV? =

No. WebDig.DEV SMTP does not require a WebDig.DEV remote setup service. SMTP credentials are stored in your WordPress installation and used for email delivery from that installation.

= What happens when the Primary SMTP server fails? =

If Backup SMTP is enabled and the error is eligible for failover, the plugin attempts delivery through the Backup SMTP transport. If delivery still cannot be completed and the local queue is enabled, the message can be queued for a later retry.

= Can an authentication error trigger failover? =

Yes. Authentication-failure failover can be enabled or disabled in the plugin settings.

= Does the plugin store recipient email addresses? =

When local logging is enabled, recipient addresses can be stored in the WordPress database as part of the delivery log. Logging can be disabled and log retention is configurable.

= Does the plugin guarantee that SPF, DKIM or DMARC is correctly configured? =

No. The health panels are diagnostic aids. DNS and transport configurations vary between providers. The definitive result for message authentication should be checked in the headers of a message received through the configured transport.

= Does WebDig.DEV SMTP add tracking to outgoing email? =

No tracking is added by WebDig.DEV SMTP.

= What happens before I configure an SMTP host? =

Nothing changes. WordPress keeps using its default email delivery and an admin notice reminds you to configure the plugin. Once a Primary (or enabled Backup) SMTP host is saved, WebDig.DEV SMTP handles delivery and never silently falls back to PHP mail().

= Can I keep SMTP passwords out of the database? =

Yes. Define `WEBDIG_SMTP_PRIMARY_PASSWORD` and/or `WEBDIG_SMTP_BACKUP_PASSWORD` in wp-config.php. A defined constant overrides the stored password and the password field becomes read-only.

= Can I use different SMTP providers for Primary and Backup? =

Yes. Primary and Backup are independent SMTP configurations, provided each transport is authorized to send mail for the addresses and domains you configure.

== Screenshots ==

1. WebDig.DEV SMTP dashboard with Primary SMTP, Backup SMTP, Queue and sending capacity status.
2. Primary and Backup SMTP configuration with email-domain and transport health diagnostics.
3. Failover, queue, sending limits and logging settings.
4. Test email tools, local queue and recent delivery log.

== Changelog ==

= 1.0.8 =
* Leave WordPress default delivery untouched until an SMTP host is configured, with an admin notice.
* Never throw from phpmailer_init outside the plugin's own send cycle.
* Log blocked and lock-busy messages with their own Delivery ID and recipients.
* Only log and count messages delivered by this plugin.
* Cache DNS diagnostics for up to 6 hours, with a Recheck DNS button, and remove error suppression.
* Cap log retention at 1000 entries and group rate-limit counters per minute.
* Add optional wp-config.php password constants.
* Translatable queue filters, accessible field labels and no inline event handlers.
* Remove promotional text from the diagnostic test email.
* Clean up all sites on multisite uninstall.

= 1.0.7 =
* Make plugin initialization safe for repeated includes and previously defined constants.
* Avoid duplicate hook registration when another copy has already initialized the plugin.

= 1.0.6 =
* Prevent silent PHP mail/sendmail fallback when the SMTP host is missing.
* Apply SMTP settings after normal PHPMailer configuration hooks and reset unused credentials.
* Add transport and delivery ID headers for verification.
* Respect earlier pre_wp_mail short-circuit results.
* Preserve WordPress 6.9+ embedded images during internal sends and retries.


= 1.0.5 =
* Fix missing DKIM transport health data when an SMTP host is empty.
* Avoid running backup health diagnostics while backup SMTP is disabled.
* Improve the standalone WebDig.DEV hub by listing installed plugins without advertising uninstalled products.

= 1.0.4 =
* Add administrator queue management with pending, processing, uncertain and abandoned views.
* Allow explicit manual retry for uncertain and abandoned messages, with duplicate-delivery warning.
* Allow administrators to mark uncertain messages resolved.

= 1.0.3 =
* Reject messages exceeding recipient limits before queueing.
* Queue mail when the quota lock is busy and queueing is enabled.
* Mark stale processing claims uncertain for manual review instead of automatically retrying.


= 1.0.2 =
* Persistent database queue with atomic message claiming and migration from legacy queue.
* Serialize quota checks and SMTP sends to prevent concurrent limit overruns.
* Restore missing queue cron events automatically.
* Improve temporary SMTP error matching and capacity label.


= 1.0.1 =
* Prevent overlapping queue processors and preserve items added during processing.
* Enforce at least one retry attempt and strip line breaks from SMTP credentials.

= 1.0.0 =
* Initial public release.
* Added Primary and Backup SMTP transports.
* Added automatic SMTP failover and configurable authentication-failure failover.
* Added local retry queue and configurable retry schedule.
* Added hourly, daily and per-message recipient limits.
* Added local delivery logging with Delivery IDs and recipient addresses.
* Added SPF, DKIM, DMARC, BIMI and transport diagnostics.
* Added HTML diagnostic test email and dedicated transport test modes.
* Added shared WebDig.DEV administration menu integration.

== Upgrade Notice ==

= 1.0.8 =
Safer behaviour before configuration, cached DNS diagnostics, bounded logs and optional wp-config.php passwords.

= 1.0.3 =
Over-limit messages are rejected instead of queued forever, and stale queue claims are held for manual review.

= 1.0.2 =
Migrates pending messages to a database queue. Back up the site database before updating.
