Well,
I have to go further so I tried a workaround by installing a posftix on my host in order to relay messages from discourse. I have an issue related to my lack of expertise on docker.
My configuration:
Host network:
docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN gro up default
link/ether 02:42:78:b6:18:3c brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
Discourse network:
“Gateway”: “172.18.0.1”,
“IPAddress”: “172.18.0.3”,
“IPPrefixLen”: 16,
- exec: rails r "SiteSetting.notification_email='yourusername@example.com'"
Please note that the DISCOURSE_SMTP_USER_NAME and the username part of the mail in SiteSetting.notification_email is the same.
If you use for example noreply@example.com sometimes it does not work because of some security checks which are activated on the server that make sure that the username is corresponding to the user email.