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
.
Line 29 in ff6db60
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 thereforestarttls
is on by default - if I set
SMTP_STARTTLS
totrue
in the environment,tls_starttls
is explicitly turnedon
in/etc/msmtprc
- if I set
SMTP_STARTTLS
tofalse
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
)?