WordPress Mail Delivers Only From the Primary Domain: Fixing the Envelope Sender and DMARC Alignment

Abstract: On multi-domain servers, WordPress notifications from secondary domains get silently rejected because PHP mail() uses the server hostname as the envelope sender, breaking DMARC alignment.

Created: 2026-11-02 by

If WordPress notifications arrive from your server's primary domain while every other hosted domain goes quiet, the TLS certificate is not the culprit — the fault is DMARC alignment. WordPress sends through PHP's mail(), which hands each message to Postfix with an envelope sender derived from the system hostname rather than the site's own domain. Receivers therefore validate SPF and DMARC against the primary domain for everything the server emits. With DMARC set to p=reject, any message whose From: header fails to align is refused, and because the bounce goes to an unmonitored local mailbox, the loss looks silent.

Why the TLS certificate is not the problem

Outbound Postfix uses opportunistic TLS. If a remote server offers STARTTLS and the handshake fails or the certificate does not match the connecting hostname, Postfix falls back to plaintext or the receiver simply accepts the unverified session. No receiving mail server quietly discards a message because a certificate fails to cover one of the sender's domains. Certificates affect encryption, not acceptance decisions, so this hypothesis can be struck off immediately.

One message, two sender identities

The confusion usually comes from not realising that every email carries two independent addresses:

  • The envelope sender — the Return-Path set by the SMTP MAIL FROM command — is what SPF evaluates. On a stock Linux server, mail() calls the sendmail binary, which builds the envelope from the Unix user running PHP and the system hostname, giving [email protected] for every site on the box.
  • The From: header is what DMARC evaluates. WordPress sets it to wordpress@ plus the individual site's domain.

DMARC passes only when SPF or DKIM aligns with the From: domain; in the default relaxed mode, the validating domain may be the From: domain itself or a subdomain of it. That explains the split behaviour exactly. For the primary site, the envelope domain matches the From: domain or is its parent, so SPF alignment alone satisfies DMARC. For an unrelated addon domain such as other-site.com, the envelope is still example.com, so SPF alignment fails, and unless the message carries a DKIM signature with d=other-site.com, DMARC fails and p=reject discards it. A test.example.com site works because it shares an organisational domain with the envelope; test.other-site.com has nothing aligned at all.

Why the DNS records you published could not help

  • The addon SPF records are never consulted. SPF is checked against the envelope domain — the primary domain on every message — so publishing SPF, or an include: pointing at the primary, on an addon domain changes nothing while the envelope stays put.
  • A DKIM key in DNS is not a signature. The selector record is only half the job; software must actually sign. With OpenDKIM, each addon domain needs its own SigningTable/KeyTable entry, and locally submitted mail is signed only if the milter is also attached via non_smtpd_milters, because mail() never passes through smtpd.
  • Subdomains inherit the parent DMARC policy unless you publish sp=, which is why the test. sites behave exactly like their parents.

Confirming the failure before changing anything

  1. Follow the mail log — /var/log/mail.log or journalctl -u postfix — and trigger a notification from an addon site. DMARC rejections usually come back as 550 5.7.1 from Gmail and Microsoft, logged as status=bounced.
  2. Remember that the bounce returns to the envelope sender, a local mailbox such as www-data that nobody reads — that is why nothing appears to happen.
  3. Send a test message to a Gmail or Outlook account and view the original headers. Expect SPF to pass with the primary domain, DKIM to be absent, and DMARC to fail for the addon — the mirror image of a healthy setup.

The fix: one matching sending identity per site

  1. Set the envelope sender per site. A small must-use plugin is enough:
    add_action('phpmailer_init', function ($phpmailer) {
        $phpmailer->Sender = '[email protected]';
    });
    Alternatively, an SMTP plugin such as WP Mail SMTP or FluentSMTP relays through authenticated submission and sets both identities correctly. Once aligned, SPF finally evaluates the addon's own record.
  2. Sign for every domain. Ensure each addon domain is DKIM-signed with its own d= value and a matching DNS selector, so SPF and DKIM both align and you keep a margin if one mechanism breaks.
  3. Ease enforcement while you debug. Drop p=reject to p=none with an rua reporting address, confirm from the reports that every domain sends aligned mail, then restore reject.
  4. Keep SPF strictness as it is. -all is harmless here because you list your own IPs; the failure was missing alignment, not strictness.

For future builds, treat every hosted domain as an independent sending identity — envelope sender, SPF, DKIM selector and DMARC record — configured before the first notification fires, and keep DMARC reporting enabled permanently so misalignment surfaces in reports instead of as vanishing mail.

Frequently Asked Questions

Does a Postfix certificate covering only the main domain break mail from other domains?

No. Outbound TLS is opportunistic: a name mismatch at worst downgrades the connection. Receivers do not silently drop mail over a certificate mismatch.

Why does SPF pass yet DMARC fail?

SPF is evaluated against the envelope domain, which is the primary domain. DMARC additionally requires that SPF or DKIM align with the From: domain, and an unrelated envelope domain fails that alignment.

Where do the rejected notifications actually go?

They are refused by the receiving server and bounced to the envelope sender — typically a local mailbox such as www-data that nobody monitors — which is why the failure looks like the mail simply vanished.

Do subdomains need their own DKIM and DMARC records?

Subdomains inherit the parent's DMARC policy unless sp= says otherwise. For DKIM, the signing domain matters: a signature with d=addon.com aligns with that domain and its subdomains under relaxed mode.

What is the quickest way to restore delivery?

Install an SMTP plugin such as WP Mail SMTP or FluentSMTP and relay mail through authenticated submission, which sets headers and envelope consistently. Alternatively, set $phpmailer->Sender per site and verify DKIM signing covers each domain.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More