1

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.

CURRENTLY

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

WHAT WE NEED

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 ?

Zoredache
  • 128,755
  • 40
  • 271
  • 413
Newtonx
  • 295
  • 1
  • 4
  • 11
  • 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

1 Answers1

3

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.

EDIT:

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 1.2.3.4, your MX records point to mail.somedomain.com that resolves to 5.6.7.8, and another mail server for outgoing mail only at 9.10.11.12.

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".

gravyface
  • 13,947
  • 16
  • 65
  • 100
  • 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
  • That's what I thought! Can you provide a code example if it's not asking too much. I have no experience with SPF ? And thanks for your help ... And please also check this QUESTION http://serverfault.com/questions/127931/how-to-distribute-emails-delivery-between-2-or-more-servers/133155#133155 – Newtonx Apr 16 '10 at 20:29
  • There's an SPF setup wizard that should make it simple for you to create an SPF record for your customers to use: http://old.openspf.org/wizard.html – gravyface Apr 17 '10 at 04:01