Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a web application that is sort of like a CRM app. People can log in and manage their business with other folks. As part of that management, our application may send emails to the people being managed. The wrinkle here is that our customers like the "from" address of those emails to be their own. That way the recipient gets email from someone they know, not from a "do not reply" address at our own domain.

With many mail servers this isn't an issue, however there are a few that are bouncing those emails. Out of curiosity I had a test email sent to me and checked the headers. Here's what google apps added:

Received-SPF: softfail ( best guess record for domain of transitioning does not designate as permitted sender) client-ip=;
Authentication-Results:; spf=softfail ( best guess record for domain of transitioning does not designate as permitted sender)

(I replaced the real "from" address with

So, while the email was delivered to me, I can certainly see why other servers might reject it. Our app isn't ever going to resolve to

What are my options here?

1) I could suggest that all "from" addresses be set to the friendly name of the client but user our own "no reply" email address. Then I could get spf and all that wired up.

2) I could suggest that the client configures spf / reverse dns to match my server's IP (this seems like a horrible option...)

What else. What are the best practices for this sort of thing?

share|improve this question
up vote 1 down vote accepted

One thing you could do, is set the sender's "name" as your client's name, and then set a Reply-To header to go to their e-mail address.

That way it looks like they are receiving an email from "Bob Johnson" they know, and when they click Reply, it will be addressed to

Though I know companies like Paypal can have emails come from your actual e-mail address, I'm not sure if this is trickery with the headers, or that all e-mail providers "trust" paypal's email servers.

share|improve this answer
That may be my temporary work-around until I get the rest of this sorted out. Thanks. – Chris_K Jan 8 '10 at 18:28
The more I experiment with things, the more I like this approach. I'll go with "Client Name<server@MyDomain>" with the reply-to header. That seems to solve my main issues. – Chris_K Jan 11 '10 at 17:09

The SPF/Domain keys all work on Envelope From addresses and not the From address in the email seen by recipient.

Therefore, you can simply use Envelope From as a valid email ID in your domain and leave the From as your client email ID.

That way SPF/Domain Keys will still pass.

As far as other best practices go check out this Email Server test.

share|improve this answer
The Email Server test link has been helpful so far. Do you have any suggested resources to learn more about "Envelope From" addresses? Is that a header value? – Chris_K Jan 8 '10 at 18:24
I don't think this is completely correct. Apparently "Unlike Sender Policy Framework (SPF) which authenticates a message at the envelope level using the Return-Path header, DKIM validates a message using the From header." (Source here) – Simon East Aug 27 '14 at 5:32

See does it this way:
Choose a general address in your domain (
Change the "MAIL FROM" to that address.
Add a "Sender" header to show to recipient who sent the message. "Sender" is a standard field; see RFC 5322. does it this way:
Choose a general address in your domain (
Change the "MAIL FROM" to that address.
Change the "From" header to that address.
Add a "Reply-To" header that contains your user's e-mail address.

share|improve this answer

SPF and DomainKeys are intended to prevent just what you are doing -- sending mail using a from address you do not own.

I don't believe there is much you can do to get around it, as it is intended to not be gotten around.

You could give each user a local email address that just forwards to the appropriate gmail or other account, so replies work, and use that as the from address. It's more work on your part.

Also, you might be able to use a "resent from" header.

share|improve this answer

As I understand it at least for SPF they need to add your mail server to the list of permitted servers.

Thats the whole point in that the owner of is saying you are an authorised email server for

You don't need to have a reverse DNS to their mail server but your mail server should HELO correctly and that reverse DNS should be correct. So it is acceptable to HELO as, have a reverse of and send mail for, so long as the SPF of permits as a relay.

share|improve this answer
my IIS SMTP server is HELO'ing as his "internal" name, not the external domain name. That appears to be causing some of the issue. – Chris_K Jan 8 '10 at 18:25
most sane anti-spam uses multiple checks and balances with certain factors attributed weights, if you fix enough anomalies you might be able to slip in but if the sending domain has an SPF record, you definitely want get your IP listed in it. – Antitribu Jan 8 '10 at 19:34


The content of "MAIL FROM" is Envelope From and this is used for SPF Checking. What the recipient sees is what is given AFTER DATA command.

They do not need to be the same.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.