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.


From: no-reply@ourdomain.com
Reply-To: customer_email@customer_domain.com
Return-Path: bounces-EMAIL-ID@ourdomain.com


From: customer_email@customer_domain.com
Reply-To: customer_email@customer_domain.com
Return-Path: bounces-EMAIL-ID@ourdomain.com

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 ?

  • 1
    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
  • 1
    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

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 mail.somedomain.com 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 somecustomer.com; I'll accept mail for delivery".

  • 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 customer_domain.com 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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