2

I have a scenario where I'm using a primary SMTP server from cPanel, however I'm running a Dockerized web app on a second server that is having trouble delivering to the main smtp server due to a bug in a Ruby library that's being used.

Would there be any problems caused by setting up Postfix or Exim as a local SMPT server on the Docker app server for the system to use to deliver emails when there's already an existing primary STMP server for the domain? Are there some additional steps that are necessary in order to eliminate any problems in such a configuration?

1 Answer 1

2

It is common to have multiple servers in a domain. Normally very few servers, usually designated as an MX, send mail directly to the internet. Only server(s) designated as an MX should be receiving mail from the internet (not likely an issue in your case). Other servers in the network will forward their mail to a relay server, often an MX server, which will route their mail to the internet.

In your case you can install Exim or Postfix in you container, and configure it to use a smarthost. This can be the host if, it accepts mail the network. If not, it should be the relay server for your network.

Their are lighter weight relay servers such as SSMTP which are designed for your situation. This is likely a better fit for your situation.

EDIT: If you need a running sever, then something like Simple Mail Forwarder might be a good fit.

Many libraries will allow you to set the server address for SMTP, which usually defaults to "localhost". They may also allow calling the mail process directly using "sendmail" command line format.

2
  • Does ssmtp run as a service/daemon so as to facilitate connections that are not used directly through shell based interaction such as mstmp that emulates sendmail? In my use-case I need to send from a Ruby app that requires TCP/IP based access from a Docker container to this service.
    – ylluminate
    Oct 20, 2019 at 15:48
  • 1
    @ylluminate See t edit. Simple Mail Forwarder seems to be docker ready.
    – BillThor
    Oct 23, 2019 at 3:38

You must log in to answer this question.

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