From 1ab2fd4f397d8891f5345f876d42ab360859bcca Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 28 Nov 2017 01:49:04 +0100 Subject: git-send-email: honor $PATH for sendmail binary This extends git-send-email to also consider sendmail binaries in $PATH after checking the (fixed) list of /usr/sbin and /usr/lib, and before falling back to localhost. Signed-off-by: Florian Klink Signed-off-by: Junio C Hamano --- git-send-email.perl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'git-send-email.perl') diff --git a/git-send-email.perl b/git-send-email.perl index 2208dcc21..edcc6d346 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -885,7 +885,9 @@ if (defined $initial_reply_to) { } if (!defined $smtp_server) { - foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) { + my @sendmail_paths = qw( /usr/sbin/sendmail /usr/lib/sendmail ); + push @sendmail_paths, map {"$_/sendmail"} split /:/, $ENV{PATH}; + foreach (@sendmail_paths) { if (-x $_) { $smtp_server = $_; last; -- cgit v1.2.1