friendica / docker

Docker image for Friendica
https://friendi.ca
GNU Affero General Public License v3.0
44 stars 18 forks source link

Can't turn off STARTTLS for msmtp #233

Closed eibhear-from-athlone closed 5 months ago

eibhear-from-athlone commented 8 months ago

Hi,

The following line examines the docker starting environment to determine if the SMTP_STARTTLS environment variable is set, and if so, sets the tls_starttls option in /etc/msmtprc to on.

https://github.com/friendica/docker/blob/ff6db601b3f3a387c9ee10cbed169c4b532f8362/docker-setup_msmtp.sh#L29

However, according to the man page for msmtp ...

A server can use TLS in one of two modes: via a STARTTLS command (the session starts with the normal protocol initialization, and TLS is then started using the protocol's STARTTLS command), or immediately (TLS is initialized before the normal protocol ini‐ tialization; this requires a separate port). The first mode is the default, but you can switch to the second mode by disabling tls_starttls.

My testing shows the following:

Can I suggest this script be updated to allow take either on or off for SMTP_STARTTLS, and for /etc/msmtprc to be updated accordingly (and the documentation to be updated to say that if the environment variable is unset then tls_starttls will default to on)?