git: set SSL if useStartTls is false

The git-send-email [0] script uses StartTLS if `smtpEncryption` is set
to `tls`, which can break services that don't support StartTLS.

[0]: bd42bbe1a4/git-send-email.perl (L1533)

PR #1395
This commit is contained in:
Andrew Fontaine 2020-07-20 08:54:18 -04:00 committed by Robert Helgesson
parent fceef469c2
commit baea46c5ac
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
5 changed files with 14 additions and 2 deletions

View file

@ -277,7 +277,14 @@ in {
genIdentity = name: account:
with account;
nameValuePair "sendemail.${name}" ({
smtpEncryption = if smtp.tls.enable then "tls" else "";
smtpEncryption = if smtp.tls.enable then
(if smtp.tls.useStartTls
|| versionOlder config.home.stateVersion "20.09" then
"tls"
else
"ssl")
else
"";
smtpServer = smtp.host;
smtpUser = userName;
from = address;