Our current setup is a webserver at www.domain.tld (DNS A record) and a mail server (postfix) at mail.domain.tld (DNS MX record) on one dedicated server (IP address

Our website sends out newsletters every day to our subscribers so the current machine has to handle both, the webserver and mail server load.

We would like to "outsource" the newsletter delivery to a second dedicated mail server with IP address at mail2.domain.tld.

So in addition to the current MX record mail to, we are planning to add a second MX record mail2 to with lower priority.

Now we would like to continue to use our current mail server mail as before for our regular mail accounts (postfix, courier, DKIM, DMARC, SPF, virtual users is already set up). Further, our newsletter application hosted on the webserver at should be using the new mail server at mail2 to send out newsletters, and relaying mails to @domain.tld sent to mail2 to mail. (It could be that some mails get sent to mail2.)

To my understanding, mail2.example.com should ONLY be allowed to send out mails when they come from, AND it should relay incoming mails to mail ONLY when they go to @domain.tld.

mail should continue to work for our "regular" mail accounts.

Thus, the "hard work" of sending out several thousand mails per day would be offloaded to the machine at separating web and "newsletter" traffic.

How can I achieve this? We use Debian Jessie and postfix on both machines. I understand I can relay the incoming mail as similarly described here: Postfix : Relaying all incoming mail to another host

How do I get the "send newsletter" part?

If you need more specific information please let me know!

  • "we are planning to add a second MX record mail2 to with lower priority" Just don't get confused when you say lower priority, it's actually a higher number in DNS, as @rob-d stated below 5 (for your main) 10 (for this secondary). Your SPF record wouldn't have to change if you use "mx" in your record. The other thing you should consider when sending bulk emails like "Newsletters" is to implement domain throttling to avoid being blacklisted/greylisted. Which you should start monitoring with a tool. – Henry Apr 14 '16 at 15:56

This is just a mail routing question if I understand correctly, the domain mail exchange records and their priority won't really help here - since the news letter is routing mail from a dedicated host simply configure it's mail server to be mail2 - there is no need to make an MX record for it unless it's going to be the backup mail exchange for your domain, but I would:

1 - setup the newsletter server up to use the dedicated mail relay (with no mailboxes - just realy)

2 - set mail1.domain.tld as mx5.domain.tld

3 - set mail2.domain.tld as mx10.domain.tld

this way the heavy lifting is being done by mail2 and you have a backup mail relay


So configuring postfix as a gateway/firewall as described at http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall did the trick. I can send mail directly through mail2, and incoming mail at mail2 is relayed to mail.

MX records are needed as mail servers very often check if it exists for spam policy reasons.

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.