Skip to content

Commit

Permalink
git: apply sendmailCmd instead of smtpServer (#6399)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vonfry authored Mar 4, 2025
1 parent 3f08cd8 commit 6f71acf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/programs/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/programs/git/git-with-msmtp-expected.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[sendemail "[email protected]"]
envelopeSender = "auto"
from = "H. M. Test <[email protected]>"
smtpServer = "@msmtp@/bin/msmtp"
sendmailCmd = "@msmtp@/bin/msmtp"

[user]
email = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/programs/git/git-with-msmtp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
assertGitConfig "[email protected]" "H. M. Test <[email protected]>"
assertGitConfig "sendemail.hm-account.from" "H. M. Test Jr. <[email protected]>"
assertGitConfig "[email protected].smtpServer" "${pkgs.msmtp}/bin/msmtp"
assertGitConfig "[email protected].sendmailCmd" "${pkgs.msmtp}/bin/msmtp"
assertGitConfig "[email protected]" "auto"
'';
}

0 comments on commit 6f71acf

Please sign in to comment.