Skip to main content
When you relay mail through MailChannels Outbound Filtering, we inspect each message’s headers to determine the responsible sender ID: the specific user, script, mailing list, or external source that originated the message. Accurate sender identification lets MailChannels isolate compromised accounts and contain abusive traffic without disrupting legitimate mail from the rest of your platform. MailChannels checks message headers in a fixed priority order and uses the first matching source it finds.

1. Primary sender identity headers

MailChannels first checks for the following headers in exact priority order. As long as the message has a non-empty SMTP envelope sender (MAIL FROM), the first non-blank header present determines the sender ID:

Duplicate headers

If a message contains multiple instances of the same header from the table above, MailChannels handles them as follows:
  • X-AuthUser: MailChannels uses the bottom-most (most recently added) header value, which is typically the header inserted by your mail server.
  • All other primary headers: If every instance of the header has the same value, MailChannels uses that value. If the values differ, MailChannels skips that header to prevent spoofing and continues down the priority list.

2. Authenticated sender in Received headers

If none of the primary headers above match, MailChannels checks the message’s Received headers for an authenticated sender string in this format:
When found, MailChannels extracts <username> as the sender identity.

3. Script origin header (X-SG-Opt)

Next, MailChannels checks for the X-SG-Opt header, which contains key=value pairs inserted by PHP environments. MailChannels uses the SCRIPT_FILENAME value (or USER if SCRIPT_FILENAME is absent), paired with your sending server’s IP address.

4. Auto-reply headers (Auto-Submitted, X-Autorespond)

If either Auto-Submitted or X-Autorespond is present, the SMTP envelope sender is non-empty, and the message is not a mailer-daemon bounce, MailChannels classifies the message as an auto-reply and derives the sender ID from the SMTP envelope sender.

5. Interspire headers (X-Mailer-LID, X-Mailer-Sent-By)

If both X-Mailer-LID and X-Mailer-Sent-By are present with numeric values, MailChannels combines those values with your sending server’s IP address to form the sender ID.

6. Fallback headers (From and Received)

If none of the headers above identify the sender, MailChannels checks two final header fallbacks before falling back to non-header signals:
  • From: Checked for mailer-daemon@ (alongside an empty SMTP envelope sender <>) to identify bounces and mailer-daemon notifications.
  • Received: Scanned from bottom to top (when the message is not an SRS-rewritten forwarded message) to extract an originating SquirrelMail authenticated user, local user ID, authenticated sender, or external sending IP address. Private and customer-owned IP addresses and hostnames are ignored during this scan.
If no header yields a sender identity, MailChannels falls back to the SMTP envelope sender (MAIL FROM) or, when no envelope sender is available, a hash of the message recipients.
Because envelope sender addresses are easy to spoof, high-volume mail that falls back to env-sender may be rejected with an [ESR] policy error. See SMTP errors for details.

Best practices

To ensure MailChannels attributes every message to the right sender on your platform:
  1. Insert a dedicated sender header at your MTA. Configure your mail server to add X-AuthUser (or another primary header such as X-Authenticated-User) with the authenticated user or account identifier for every outbound message. See Configure your mail server for MTA-specific instructions.
  2. Strip untrusted copies from incoming submissions. Remove any client-supplied copies of X-AuthUser or other sender identity headers before your MTA inserts its own trusted value.
  3. Verify your sender IDs. Send a test message and open Outbound > Log Search in the Host Console to confirm the sender ID reflects the expected header value. You can inspect per-sender history in Sender Profiles and restrict authorized senders with Domain Lockdown.
Last modified on December 2, 2026