How to set SMTP config to use localhost?

I have postfix configured to work on the local docker host such that a test via swaks --to destination@domain.tld --from admin@hostdomain.tld --server localhost -tls delivers as expected. It uses port 25 and sends out the email with no problem at all.

So I’m lead to the question: how do I set up app.yml SMTP config settings appropriately to utilize localhost for mail delivery?

Set SMTP address to

So to be clear, are you saying only the IP should be configured and the other fields commented out? Eg:

  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

If it’s on the same docker host but within a different docker container you need to specify the host IP. won’t work as that’s the loopback address. Each container sees as itself.

This is not in a different docker container, but simply on the docker host itself.

It’s still going to need the host IP then.

So in such a case you need to use the public IP or is thre a special IP scheme that Docker uses? For example, within the host I see docker0 with and within the container (./launcher enter app; apt-get install ifconfig) eth0 is I suspect I should use the host’s w/in the discourse container, but I wouldn’t want it to change on me somehow and at some point.

Just to document here, the following was sufficient (all other SMTP lines commented out) to deliver to the docker host’s smtp server if no auth is necessary:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.