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

How can I customize the mail FROM header in our Email Marketing Application , to enable our customers to specify their OWN email ( from their domain ) .

Currently the customer specify his own domain and we use it at the Reply-To mail's header.





We do it this way to avoid getting blacklisted because Mail Servers like Gmail or Hotmail would considers it as a MAIL'S HEADER FORGERY ATTEMPT.

But our customers keeps asking us to make the FROM HEADER customizable.

Can someone help us ?

share|improve this question
I think you should specify what "Email Marketing Application" you are talking about here... I know DADA mail will let you have separate mailing lists per customer with whatever FROM: address you want. – solefald Apr 16 '10 at 17:12
You seem to know what headers you want. I don't think we can provide a useful answer until you include details about what mail server, and what email list software you are running. – Zoredache Apr 16 '10 at 17:37
We use Exim as a mail server . And the email marketing app is a built in solution we developed. – Newtonx Apr 16 '10 at 17:45
up vote 3 down vote accepted

There's nothing special you have to do to write your own From: header on an email. I do it all the time for my customer's websites I host on my servers, however, I make sure that my webservers' IP block is in their SPF records.

As long as your customers add your.mail.servers.ipaddress(es) to their SPF records, you shouldn't get a forgery attempt because the SPF records tell the recipient mail server that you're allowed to send mail on their behalf.


To address your comments about "won't they know that it didn't come from their domain?" -- MX records have nothing to do with who's sending the mail, they're used by other sending mail servers to determine where to send email to. Same goes with A records for hosting websites; it has nothing to do with sending mail at all, you can absolutely have your Website hosted at, your MX records point to that resolves to, and another mail server for outgoing mail only at

Like I said, I do this all the time for many different clients -- they have their own Exchange Servers that sends/receives email, but on my server, their password reminder emails, subscription notifications, forum alerts, newsletters, etc. all have their domain in the From: header (and reply-to:), but since I add my Webserver's IP block to their SPF records for their domains, any receiving mail server goes, "ok, cool, my.webserver.ip.address is permitted to send mail for; I'll accept mail for delivery".

share|improve this answer
Won't it be considered as a MAIL'S HEADER FORGERY ATTEMPT by mail hosts like Gmail or Hotmail ? They will know the the email came from my server and not from my customer's domain. – Newtonx Apr 16 '10 at 17:39
I think having the IPs of the sending server in SPF record for is the right answer, but you may wish to elaborate on it a bit. – Jed Daniels Apr 16 '10 at 17:40
We use Exim as a mail server . And the email marketing app is a built in solution we developed. – Newtonx Apr 16 '10 at 18:28
How can I do it "add my Webserver's IP block to their SPF records for their domains"? Is it done on my server or on the servers my customers are hosted? – Newtonx Apr 16 '10 at 19:56
Your customers will have their own nameservers or will be hosted/managed by a 3rd-party. Unless you registered and/or manage their domains for them, they will have to add your mail server's IP addresses to their own SPF records as only those in control of the DNS records for the domain can add the appropriate SPF records. – gravyface Apr 16 '10 at 20:14

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.