0

My web application has to send emails, and it's hosted on multiple physical servers. Using a third-party service is not an option, so I'm installing postfix (or maybe sendmail).

Is it more common in this case to install postfix on a central server, or to install it on each app server? I'd imagine the latter would be easier, requiring less networking/security configuration (and I'd use chef or something to deploy it to all machines at once). Are there disadvantages to this approach?

One potential problem that crossed my mind is whether it'd make it more likely for the message to get flagged as spam, but AFAICT I could set up a reverse DNS for each server and alleviate that problem? Anything else I'm not considering?

3
  • 1
    Using a third-party service is not an option - Why not? Is it a cost issue? If so, most email relay providers offer a free tier.
    – joeqwerty
    Oct 30, 2015 at 16:02
  • @joeqwerty We are currently using mandrill. It doesn't work with MMS to e.g. [email protected] or whatever. Mobile carriers ignore it. We've tried other third-party services and they all have the same problem. We transferred to gmail, which works, but then we hit rate limits. So now manual seems to be the only option left. We'll continue to use mandrill for regular email.
    – lobsterism
    Oct 30, 2015 at 16:05
  • @joeqwerty (Though if you want to ask why not send MMS via twilio...I'm not sure, that's probably way smarter and more reliable anyway).
    – lobsterism
    Oct 30, 2015 at 16:11

3 Answers 3

7

You don't want each server sending out its own mail. Relay through a central server - you'll have a single point to refer to for logging, a single point of configuration with regards to relay ACLs, and a single point to install/configure spam detection/prevention if necessary in the future.

1

I would recommend you installing local MTA on each server, accepting only connections on localhost, not necessarily demanding auth. These servers then rely to central server, properly configured (PTR, dkim, etc...).

PROS: 1. identical config on every app server 2. no need to change revdns and so when adding machines 3. faster mail sendout from application point of view 4. keeping queue in case of central server outage

0

My best recommendation is to use 3rd party email delivery system through the application (e.g. SendGrid) - having to configure postfix manually would be pain (possible with puppet/chef/etc but unnecessary pain) especially when all you care about is guaranteed transactional emails from the app.

And as mentioned by other fellow members, central SMTP server is the way to go when 3rd party service is out of question.

1
  • configuration management is what you need. Then setting up postifx is painless. Having a central relay server is the way to go here. Nov 1, 2015 at 9:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .