From f45c7000d544f17e5499e2ae6b505b5f705c5d61 Mon Sep 17 00:00:00 2001 From: Andrew Fontaine Date: Sun, 28 Feb 2021 14:42:44 -0500 Subject: [PATCH] git: correct value of envelopeSender for msmtp (#1838) The value should be "auto", not `true`. Also fix news entry. --- modules/misc/news.nix | 5 +++-- modules/programs/git.nix | 2 +- tests/modules/programs/git/git-with-msmtp-expected.conf | 2 +- tests/modules/programs/git/git-with-msmtp.nix | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/misc/news.nix b/modules/misc/news.nix index dc7159da7..c568a939e 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1865,8 +1865,9 @@ in } { time = "2021-02-25T22:36:43+00:00"; - condition = config.programs.git.enable - && any config.accounts.email.accounts (account: account.msmtp.enable); + condition = config.programs.git.enable && any (msmtp: msmtp.enable) + (mapAttrsToList (name: account: account.msmtp) + config.accounts.email.accounts); message = '' Git will now defer to msmtp for sending emails if 'accounts.email.accounts..msmtp.enable' is true. diff --git a/modules/programs/git.nix b/modules/programs/git.nix index cbac449a5..5f86d0e00 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -278,7 +278,7 @@ in { with account; nameValuePair "sendemail.${name}" (if account.msmtp.enable then { smtpServer = "${pkgs.msmtp}/bin/msmtp"; - envelopeSender = true; + envelopeSender = "auto"; from = address; } else { diff --git a/tests/modules/programs/git/git-with-msmtp-expected.conf b/tests/modules/programs/git/git-with-msmtp-expected.conf index ded862bd8..b8c99758e 100644 --- a/tests/modules/programs/git/git-with-msmtp-expected.conf +++ b/tests/modules/programs/git/git-with-msmtp-expected.conf @@ -5,7 +5,7 @@ smtpUser = "home.manager.jr" [sendemail "hm@example.com"] - envelopeSender = true + envelopeSender = "auto" from = "hm@example.com" smtpServer = "@msmtp@/bin/msmtp" diff --git a/tests/modules/programs/git/git-with-msmtp.nix b/tests/modules/programs/git/git-with-msmtp.nix index e76d3187f..abe32af8e 100644 --- a/tests/modules/programs/git/git-with-msmtp.nix +++ b/tests/modules/programs/git/git-with-msmtp.nix @@ -39,7 +39,7 @@ with lib; assertGitConfig "sendemail.hm@example.com.from" "hm@example.com" assertGitConfig "sendemail.hm-account.from" "hm@example.org" assertGitConfig "sendemail.hm@example.com.smtpServer" "${pkgs.msmtp}/bin/msmtp" - assertGitConfig "sendemail.hm@example.com.envelopeSender" "true" + assertGitConfig "sendemail.hm@example.com.envelopeSender" "auto" ''; }; }