From 6f71acf71bd6a8a6f3152769737a53af6da6ae63 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Wed, 5 Mar 2025 05:46:31 +0800 Subject: [PATCH] git: apply sendmailCmd instead of smtpServer (#6399) In manpage of git-send-email --smtp-server, For backward compatibility, this option can also specify full pathname of a sendmail-like program instead; the program must support the -i option. This method does not support passing arguments or using plain command names. For those use cases, consider using --sendmail-cmd instead. --- modules/programs/git.nix | 2 +- tests/modules/programs/git/git-with-msmtp-expected.conf | 2 +- tests/modules/programs/git/git-with-msmtp.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 76b1b944..16fc6a0f 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -489,7 +489,7 @@ in { genIdentity = name: account: with account; nameValuePair "sendemail.${name}" (if account.msmtp.enable then { - smtpServer = "${pkgs.msmtp}/bin/msmtp"; + sendmailCmd = "${pkgs.msmtp}/bin/msmtp"; envelopeSender = "auto"; from = "${realName} <${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 3d636a8b..9525d14b 100644 --- a/tests/modules/programs/git/git-with-msmtp-expected.conf +++ b/tests/modules/programs/git/git-with-msmtp-expected.conf @@ -14,7 +14,7 @@ [sendemail "hm@example.com"] envelopeSender = "auto" from = "H. M. Test " - smtpServer = "@msmtp@/bin/msmtp" + sendmailCmd = "@msmtp@/bin/msmtp" [user] email = "hm@example.com" diff --git a/tests/modules/programs/git/git-with-msmtp.nix b/tests/modules/programs/git/git-with-msmtp.nix index 5b541618..eec269c7 100644 --- a/tests/modules/programs/git/git-with-msmtp.nix +++ b/tests/modules/programs/git/git-with-msmtp.nix @@ -31,7 +31,7 @@ assertGitConfig "sendemail.hm@example.com.from" "H. M. Test " assertGitConfig "sendemail.hm-account.from" "H. M. Test Jr. " - assertGitConfig "sendemail.hm@example.com.smtpServer" "${pkgs.msmtp}/bin/msmtp" + assertGitConfig "sendemail.hm@example.com.sendmailCmd" "${pkgs.msmtp}/bin/msmtp" assertGitConfig "sendemail.hm@example.com.envelopeSender" "auto" ''; }