Mattermost, Inc.

SMTP / Email configuration needs improvment

Hi there,
getting SMTP working on discourse caused me some sleepless nights. As I started to install Mattermost, I expected that goes easier but I was shocked that troubleshooting options are way worse.
I was lucky that a simple switch from 587 to 465 solved the problem, Secure SMTP on port 587 not working, without understanding the log entry.
I’m not the first one but besides the previous link I found only How to configure Email and TLS, wherein the log entries at least easier to read.

the number in the entries quite cryptic, any change to switch (back) to time stamps?

  • "level":"warn","ts":1578775251.7369456,"caller":
  • "level":"debug","ts":1578847896.563981,"caller":"web/handlers.go:77"

Let’s get back to email troubleshooting.
I followed https://docs.mattermost.com/install/smtp-email-setup.html but neither docker exec -ti mattermost-dev /bin/bash nor telnet mail.example.com 25 works in any container.

CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                  PORTS                                                                  NAMES
c9b945acf6f0        mattermost-docker_web       "/entrypoint.sh"         20 hours ago        Up 20 hours (healthy)   0.0.0.0:32770->80/tcp, 0.0.0.0:40080->80/tcp, 0.0.0.0:40443->443/tcp   mattermost_web
b5b8e11c9cd8        mattermost-docker_app       "/entrypoint.sh matt…"   20 hours ago        Up 20 hours (healthy)   8000/tcp                                                               mattermost_app
a536b226af81        mattermost-docker_db        "/entrypoint.sh post…"   20 hours ago        Up 20 hours (healthy)   5432/tcp                                                               mattermost_db

/bin/bash is only available in the database container:

root@Ubuntu18:~# docker exec -ti mattermost_web /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
root@Ubuntu18:~# docker exec -ti mattermost_app /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
root@Ubuntu18:~# docker exec -ti mattermost_db /bin/bash
bash-5.0#

but telnet in none of them:

root@Ubuntu18:~# docker exec -ti mattermost_db /bin/bash
bash-5.0# telnet
bash: telnet: command not found
bash-5.0# telnet mail.example.com 25
bash: telnet: command not found
root@Ubuntu18:~#  docker exec -ti mattermost_web telnet mail.example.com 25
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"telnet\": executable file not found in $PATH": unknown
root@Ubuntu18:~#  docker exec -ti mattermost_app telnet mail.example.com 25
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"telnet\": executable file not found in $PATH": unknown
root@Ubuntu18:~#  docker exec -ti mattermost_db telnet  mail.example.com 25
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"telnet\": executable file not found in $PATH": unknown

First of all it would be helpful that I can decide where the test email is send to.
Moreover, openssl or telnet return codes should be logged like Online SMTP tool - Test your Mail Server on the fly does.
I wrote quite an extensive post in Troubleshooting email on a new Discourse install - howto / sysadmin - Discourse Meta, hope that gives some inspiration on how the interface and logging could be improved

FYI: I’m on E10 plan

app