Sending emails from a Dokku container

September 3, 2015 1.3k views
Dokku Ruby Ubuntu


I installed Postfix on the host machine as per this guide and I succeeded in sending emails from the Droplet, but I cannot seem to do it from the Dokku containers.

I tried with both localhost and the IP address of the docker0 interface but it keeps returning socket errors.

I tried checking connectivity but here's what it shows:

$ dokku run <app> bash
$ ping <docker0_ip>
ping: Lacking privilege for raw socket.
$ docker exec -i -t <container_id> bash
$ ping <docker0_ip>
PING *** (***): 56 data bytes
64 bytes from ***: icmp_seq=0 ttl=64 time=0.284 ms
64 bytes from ***: icmp_seq=1 ttl=64 time=0.114 ms

does work though. So I'm thinking I need to change some settings on Dokku to let it connect to sockets but I cannot find how to do that anywhere on the internet.

Ultimately, I would like to be able to send emails from Dokku apps with the least amount of configuration possible. This setup does seem unnecessarily complicated so I would prefer not to diverge a lot from the default configuration.

If you do have any idea how to fix this, please help.

Thanks you :)

Be the first one to answer this question.