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:
parent
fceef469c2
commit
baea46c5ac
|
@ -43,3 +43,5 @@ $ nix-shell '<home-manager>' -A install
|
||||||
|
|
||||||
will automatically include these options, when necessary.
|
will automatically include these options, when necessary.
|
||||||
--
|
--
|
||||||
|
|
||||||
|
* Git's `smtpEncryption` option is now set to `tls` only if both <<opt-accounts.email.accounts.\_name_.smtp.tls.enable>> and <<opt-accounts.email.accounts.\_name_.smtp.tls.useStartTls>> are `true`. If only <<opt-accounts.email.accounts.\_name_.smtp.tls.enable>> is `true`, `ssl` is used instead.
|
||||||
|
|
|
@ -277,7 +277,14 @@ in {
|
||||||
genIdentity = name: account:
|
genIdentity = name: account:
|
||||||
with account;
|
with account;
|
||||||
nameValuePair "sendemail.${name}" ({
|
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;
|
smtpServer = smtp.host;
|
||||||
smtpUser = userName;
|
smtpUser = userName;
|
||||||
from = address;
|
from = address;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
passwordCommand = "password-command 2";
|
passwordCommand = "password-command 2";
|
||||||
imap.host = "imap.example.org";
|
imap.host = "imap.example.org";
|
||||||
smtp.host = "smtp.example.org";
|
smtp.host = "smtp.example.org";
|
||||||
|
smtp.tls.useStartTls = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
[sendemail "hm@example.com"]
|
[sendemail "hm@example.com"]
|
||||||
from = "hm@example.com"
|
from = "hm@example.com"
|
||||||
smtpEncryption = "tls"
|
smtpEncryption = "ssl"
|
||||||
smtpServer = "smtp.example.com"
|
smtpServer = "smtp.example.com"
|
||||||
smtpUser = "home.manager"
|
smtpUser = "home.manager"
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ with lib;
|
||||||
userName = "H. M. Test";
|
userName = "H. M. Test";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.stateVersion = "20.09";
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
function assertGitConfig() {
|
function assertGitConfig() {
|
||||||
local value
|
local value
|
||||||
|
|
Loading…
Reference in a new issue