I would like to set up a send-only mail server with Docker (tvial / docker-mailserver). I currently have a Docker container for my website (PHP: 7.2-Apache) in which I have installed msmtp to send emails from my PHP container. The problem is that I just can't find an msmtp configuration for my PHP container to properly connect to my mail container. I have some certificate problems that I cannot solve on my own.
My msmtp configuration:
defaults port 587 tls on tls_trust_file /path/to/letsencrypt/signed.crt account tobicontinued host mail from firstname.lastname@example.org auth on user info password
account default : tobicontinued logfile /var/log/msmtp.log
Both https://mxtoolbox.com/SuperTool.aspx and https://www.checktls.com/TestReceiver indicate that there are no problems with my mail server (in particular, everything is fine with my certificates).
When I run
openssl s_client -connect mail.tobicontinued.com:25 -starttls smtp I get from my server (not the containers)
CONNECTED(00000005) ... Verification: OK
docker exec in my php container and execute it
openssl s_client -connect mail.tobicontinued.com:25 -starttls smtp, I get
CONNECTED(00000003), The same applies if I try to connect via the Docker network
Can't use SSL_get_servername ... Verification error: unable to get local issuer certificate
... mail:25 ..., Where
My two questions: 1. Does anyone see a solution to my situation? 2. Do I really need TLS to connect two containers?