Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9122071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:00:31+00:00 2026-06-17T06:00:31+00:00

I have a single domain with a dozen subdomains for different sites. Each has

  • 0

I have a single domain with a dozen subdomains for different sites. Each has a separate virtual host in apache.

I configured sendmail to masquerad as the top-level domain so that emails are always from the top-level domain instead of the subdomain.

Unfortunately, DKIM header d= and i= fields show the subdomain. Since the DNS Record is stored at the top-level domain, the DKIM Check fails.

How do I tell DKIM to use the top-level domain?

Help? – Jim

p.s. I’ve tried every angle on this and I’m stumped. I can’t figure out how Sendmail tells DKIM which subdomain to use. And I can’t figure out how PHP tells Sendmail which subdomain is being used. I tried setting $_SERVER[‘SERVER_NAME’] to override it just before sending the mail, but it has no effect. I can’t figure out a single work-around.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:00:33+00:00Added an answer on June 17, 2026 at 6:00 am

    The problem stems from rewriting of headers and its discussed here:
    https://serverfault.com/questions/442180/sendmail-rewriting-headers-after-opendkim-signature

    One of the suggested solutions is to set the correct headers in PHP so that sendmail is given the correct domain information and no rewriting is involved.

    In my case, I realized that meant setting $_SERVER[‘SERVER_NAME’] is the right thing to do as an easy fix. I had mentioned it didn’t work for me because I thought Sendmail was ignoring the value. But I tried it again and noticed Sendmail DOES recognize the value from $_SERVER[‘SERVER_NAME’]. The problem I didn’t realize before was that I had DKIM Filter configured incorrectly.

    In dkim-filter.conf, I had the line:
    Domain *.mydomain.com

    When Sendmail was receiving “mydomain.com” in the header information and calling DKIM-Milter, DKIM was unable to find a match because “mydomain.com” evidentally doesn’t match *.mydomain.com. I changed *.mydomain.com to mydomain.com and everything started working.

    So all I have to do on all my sites is set $_SERVER[‘SERVER_NAME’] = ‘mydomain.com’ before calling mail() or wp_mail() (For WordPress). Everything works then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a family of sites (about games) with shared content. Each site has
We have a sizable collection of applications (>50) all running under a single domain
I have two tables that are considered a single entity in my domain model.
I have A single page that has the following structure <form runat=server><placeholder></placeholder></form> I have
I have a single-threaded application that uses 3 SQLite databases in 3 different files
I have a single view application. It has myAppDelegate and myViewController. In a earlier
I have hosted 2 email servers in a single server. This server has only
I have a single site in IIS with a blank host header and 50+
Ok Soo I have 3 Sites. All need to store a cookie that each
I have a single CherryPy application serving two websites, each having their static files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.