summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2017-11-28 00:49:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-28 01:14:30 (GMT)
commit1ab2fd4f397d8891f5345f876d42ab360859bcca (patch)
tree7e9498515027834a3c1a892bff184b5f1105e4ba /git-send-email.perl
parent5f9953d2c365bffed6f9ee0c6966556bd4d7e2f4 (diff)
downloadgit-1ab2fd4f397d8891f5345f876d42ab360859bcca.zip
git-1ab2fd4f397d8891f5345f876d42ab360859bcca.tar.gz
git-1ab2fd4f397d8891f5345f876d42ab360859bcca.tar.bz2
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 <flokli@flokli.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 2208dcc..edcc6d3 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;