How do I specify the hostname SPF shows to users?

STW asked:

I have a production Magento site which is on a dedicated host. The machine has it’s “hosting” name, host-123.hosting.com, as well as its public name, buystuffhere.com. DNS has been configured for SPF email validation for emails originating from our server as well as from 3rd party mailing services. Here’s the gist of the DNS record (1.2.3.4 being the dedicated magento server):

v spf1 mx ip4:1.2.3.4 include:salesforce.com ~all

With the current configuration SPF is working, but emails appear in my GMain inbox with the “from” portion showing

STW stw@buystuffhere.com via host-123.hosting.com

I’d like to clean this up so that SPF displays our public name:

STW stw@buystuffhere.com via buystuffhere.com

Where do I configure this? Is it within Magento? Is it an email setting for the hosting user? Is it a DNS change?

My answer:


Normally I’d just point you at the docs, but they turned out to be rather difficult to locate, so I’ll point you at the docs instead:

Google says you need to set up both SPF and DKIM records to avoid the “via” whatever domain being displayed.

I’m a sender and I don’t want my recipients to see the “via” link. What can I do?

Gmail checks whether emails are correctly authenticated. If your messages are sent by a bulk mailing vendor or by third-party affiliates, please publish an SPF record that includes the IPs of the vendor or affiliates which send your messages and sign your messages with a DKIM signature that is associated with your domain.

You should also get your reverse DNS fixed, and review the rest of Google’s Bulk Senders Guidelines.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.