git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-send-email: honor $PATH
@ 2017-11-18 12:42 Florian Klink
  2017-11-18 21:01 ` brian m. carlson
  0 siblings, 1 reply; 9+ messages in thread
From: Florian Klink @ 2017-11-18 12:42 UTC (permalink / raw)
  To: git; +Cc: flokli

This will search $PATH for a sendmail binary, instead of the (previously
fixed) list of paths.

Signed-off-by: Florian Klink <flokli@flokli.de>
---
 Documentation/git-send-email.txt | 5 ++---
 git-send-email.perl              | 3 ++-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index bac9014ac..b9b1f2c41 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -203,9 +203,8 @@ a password is obtained using 'git-credential'.
 	specify a full pathname of a sendmail-like program instead;
 	the program must support the `-i` option.  Default value can
 	be specified by the `sendemail.smtpServer` configuration
-	option; the built-in default is `/usr/sbin/sendmail` or
-	`/usr/lib/sendmail` if such program is available, or
-	`localhost` otherwise.
+	option; the built-in default is to search in $PATH if such program is
+	available, or `localhost` otherwise.
 
 --smtp-server-port=<port>::
 	Specifies a port different from the default port (SMTP
diff --git a/git-send-email.perl b/git-send-email.perl
index 2208dcc21..8e357aeab 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -885,7 +885,8 @@ if (defined $initial_reply_to) {
 }
 
 if (!defined $smtp_server) {
-	foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
+	my @sendmail_paths = map {"$_/sendmail"} split /:/, $ENV{PATH};
+	foreach (@sendmail_paths) {
 		if (-x $_) {
 			$smtp_server = $_;
 			last;
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-11-28  1:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-18 12:42 [PATCH] git-send-email: honor $PATH Florian Klink
2017-11-18 21:01 ` brian m. carlson
2017-11-18 21:28   ` Florian Klink
2017-11-18 22:20     ` [PATCH v2] git-send-email: honor $PATH for sendmail binary Florian Klink
2017-11-19  1:04   ` [PATCH] git-send-email: honor $PATH Junio C Hamano
2017-11-19 12:35     ` Florian Klink
2017-11-28  0:32       ` Florian Klink
2017-11-28  0:49       ` [PATCH v3] git-send-email: honor $PATH for sendmail binary Florian Klink
2017-11-28  1:13         ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).