···11+From 9a4396ddaedaf59ebee16d69900884e990b79cdd Mon Sep 17 00:00:00 2001
22+From: Florian Klink <flokli@flokli.de>
33+Date: Fri, 17 Nov 2017 13:21:37 +0100
44+Subject: [PATCH] git-send-email: honor $PATH
55+66+This will search $PATH for a sendmail binary, instead of the (previously
77+fixed) list of paths.
88+99+Signed-off-by: Florian Klink <flokli@flokli.de>
1010+---
1111+ Documentation/git-send-email.txt | 5 ++---
1212+ git-send-email.perl | 3 ++-
1313+ 2 files changed, 4 insertions(+), 4 deletions(-)
1414+1515+diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
1616+index bac9014ac..b9b1f2c41 100644
1717+--- a/Documentation/git-send-email.txt
1818++++ b/Documentation/git-send-email.txt
1919+@@ -203,9 +203,8 @@ a password is obtained using 'git-credential'.
2020+ specify a full pathname of a sendmail-like program instead;
2121+ the program must support the `-i` option. Default value can
2222+ be specified by the `sendemail.smtpServer` configuration
2323+- option; the built-in default is `/usr/sbin/sendmail` or
2424+- `/usr/lib/sendmail` if such program is available, or
2525+- `localhost` otherwise.
2626++ option; the built-in default is to search in $PATH if such program is
2727++ available, or `localhost` otherwise.
2828+2929+ --smtp-server-port=<port>::
3030+ Specifies a port different from the default port (SMTP
3131+diff --git a/git-send-email.perl b/git-send-email.perl
3232+index 2208dcc21..8e357aeab 100755
3333+--- a/git-send-email.perl
3434++++ b/git-send-email.perl
3535+@@ -885,7 +885,8 @@ if (defined $initial_reply_to) {
3636+ }
3737+3838+ if (!defined $smtp_server) {
3939+- foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
4040++ my @sendmail_paths = map {"$_/sendmail"} split /:/, $ENV{PATH};
4141++ foreach (@sendmail_paths) {
4242+ if (-x $_) {
4343+ $smtp_server = $_;
4444+ last;
4545+--
4646+2.15.0
4747+