Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Problems with SMTP #61

Closed
maackle opened this issue Nov 10, 2016 · 5 comments
Closed

Problems with SMTP #61

maackle opened this issue Nov 10, 2016 · 5 comments

Comments

@maackle
Copy link

maackle commented Nov 10, 2016

Is this container supposed to be able to talk over SMTP ports (25 or 465)? I tried getting this to talk to postfix on the same machine, and also tried sending mail through amazon SES -- neither worked, the SMTP connection failed.

@eungjun-yi
Copy link
Contributor

Is this container supposed to be able to talk over SMTP ports (25 or 465)?

Yes, the containers doesn't block any outgoing port. I suspect you have some network problems between docker container and host machine.

@xcompass
Copy link
Contributor

What SMTP server IP/address were you using when you tried on the same machine. If your postfix is running on your host and you are running the container, you need to point the SMTP server to your host docker IP.

@xcompass
Copy link
Contributor

Closing this for now. Feel free to reopen if there is any question.

@karsalfrink
Copy link

@maackle I am running into the same issue—did you find a fix and if so, what is it?

@karsalfrink
Copy link

karsalfrink commented Jul 31, 2017

After some more poking around I got this to work.

For those who stumble across this issue looking for a fix, here is what I did.

I am assuming you have gone through the basic Mattermost Docker installation, and have set up Postfix as a regular service on your host machine.

  1. On the host machine do ifconfig and find the ip address of the docker0 bridge network
  2. In Mattermost's system console set up email notifications as per these instructions under 'postfix' but enter the ip address from step 1 in stead of localhost.
  3. Find the ip address of the mattermostdocker_web_1 container using this command: docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) (source)
  4. Add the ip address from step 3 into /etc/postfix/main to mynetworks, save the file and make sure you do service postfix restart
  5. Back in Mattermost, hit the 'Test Connection' button. The admin user should receive a test email from the configured from address.

I am no expert so I do not know if this is the 'correct' way to do this, but it works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants