friendica / docker

Docker image for Friendica

Home Page:https://friendi.ca

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't turn off STARTTLS for msmtp

eibhear-from-athlone opened this issue · comments

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.

if [ -n "${SMTP_STARTTLS+x}" ]; then echo "tls_starttls on"; fi

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:

  • if I don't set SMTP_STARTTLS in the environment, tls_starttls is not set in /etc/msmtprc, and therefore starttls is on by default
  • if I set SMTP_STARTTLS to true in the environment, tls_starttls is explicitly turned on in /etc/msmtprc
  • if I set SMTP_STARTTLS to false or any other value in the environment, tls_starttls is explicitly turned on in /etc/msmtprc

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)?