* [PATCH] send-email: allow sendmail binary to be used instead of SMTP
@ 2006-05-15 2:32 Eric Wong
2006-05-15 2:34 ` Eric Wong
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Eric Wong @ 2006-05-15 2:32 UTC (permalink / raw)
To: Junio C Hamano, git; +Cc: Eric Wong
This should make local mailing possible for machines without
a connection to an SMTP server.
It'll default to using /usr/sbin/sendmail or /usr/lib/sendmail
if no SMTP server is specified (the default). If it can't find
either of those paths, it'll fall back to connecting to an SMTP
server on localhost.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-send-email.perl | 55 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 42 insertions(+), 13 deletions(-)
1c9bacc5a2bfe382f68046aeba62302d28e4c976
diff --git a/git-send-email.perl b/git-send-email.perl
index d8c4b1f..d27a7a5 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -40,7 +40,8 @@ # Variables we fill in automatically, or
my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time);
# Behavior modification variables
-my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, "localhost", 0, 0, 0);
+my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc) = (1, 0, 0, 0);
+my $smtp_server;
# Example reply to:
#$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';
@@ -179,8 +180,14 @@ if (!defined $initial_reply_to && $promp
$initial_reply_to =~ s/(^\s+|\s+$)//g;
}
-if (!defined $smtp_server) {
- $smtp_server = "localhost";
+if (!$smtp_server) {
+ foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
+ if (-x $_) {
+ $smtp_server = $_;
+ last;
+ }
+ }
+ $smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*
}
if ($compose) {
@@ -358,18 +365,39 @@ X-Mailer: git-send-email $gitversion
";
$header .= "In-Reply-To: $reply_to\n" if $reply_to;
- $smtp ||= Net::SMTP->new( $smtp_server );
- $smtp->mail( $from ) or die $smtp->message;
- $smtp->to( @recipients ) or die $smtp->message;
- $smtp->data or die $smtp->message;
- $smtp->datasend("$header\n$message") or die $smtp->message;
- $smtp->dataend() or die $smtp->message;
- $smtp->ok or die "Failed to send $subject\n".$smtp->message;
+ if ($smtp_server =~ m#^/#) {
+ my $pid = open my $sm, '|-';
+ defined $pid or die $!;
+ if (!$pid) {
+ exec($smtp_server,'-i',@recipients) or die $!;
+ }
+ print $sm "$header\n$message";
+ close $sm or die $?;
+ if ($quiet) {
+ printf "Sent %s\n", $subject;
+ } else {
+ print "OK. Log says:
+Date: $date
+Sendmail: $smtp_server
+From: $from
+Subject: $subject
+Cc: $cc
+To: $to
- if ($quiet) {
- printf "Sent %s\n", $subject;
+Result: OK\n";
+ }
} else {
- print "OK. Log says:
+ $smtp ||= Net::SMTP->new( $smtp_server );
+ $smtp->mail( $from ) or die $smtp->message;
+ $smtp->to( @recipients ) or die $smtp->message;
+ $smtp->data or die $smtp->message;
+ $smtp->datasend("$header\n$message") or die $smtp->message;
+ $smtp->dataend() or die $smtp->message;
+ $smtp->ok or die "Failed to send $subject\n".$smtp->message;
+ if ($quiet) {
+ printf "Sent %s\n", $subject;
+ } else {
+ print "OK. Log says:
Date: $date
Server: $smtp_server Port: 25
From: $from
@@ -378,6 +406,7 @@ Cc: $cc
To: $to
Result: ", $smtp->code, ' ', ($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
+ }
}
}
--
1.3.2.g1c9b
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 2:32 [PATCH] send-email: allow sendmail binary to be used instead of SMTP Eric Wong
@ 2006-05-15 2:34 ` Eric Wong
2006-05-15 2:38 ` [PATCH] send-email: quiet some warnings Eric Wong
2006-05-15 5:52 ` [PATCH] send-email: allow sendmail binary to be used instead of SMTP Junio C Hamano
2 siblings, 0 replies; 17+ messages in thread
From: Eric Wong @ 2006-05-15 2:34 UTC (permalink / raw)
To: git; +Cc: Martin Langhoff
Eric Wong <normalperson@yhbt.net> wrote:
> This should make local mailing possible for machines without
> a connection to an SMTP server.
>
> It'll default to using /usr/sbin/sendmail or /usr/lib/sendmail
> if no SMTP server is specified (the default). If it can't find
> either of those paths, it'll fall back to connecting to an SMTP
> server on localhost.
>
> Signed-off-by: Eric Wong <normalperson@yhbt.net>
Also, Thanks to Martin Langhoff for bringing this up.
--
Eric Wong
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH] send-email: quiet some warnings
2006-05-15 2:32 [PATCH] send-email: allow sendmail binary to be used instead of SMTP Eric Wong
2006-05-15 2:34 ` Eric Wong
@ 2006-05-15 2:38 ` Eric Wong
2006-05-15 6:04 ` Junio C Hamano
2006-05-15 5:52 ` [PATCH] send-email: allow sendmail binary to be used instead of SMTP Junio C Hamano
2 siblings, 1 reply; 17+ messages in thread
From: Eric Wong @ 2006-05-15 2:38 UTC (permalink / raw)
To: Junio C Hamano, git; +Cc: Eric Wong
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-send-email.perl | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
0e5a33f56f62e527b74b2afbd93a1cca812f97af
diff --git a/git-send-email.perl b/git-send-email.perl
index d27a7a5..379e0c4 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -507,8 +507,16 @@ sub unique_email_list(@) {
my @emails;
foreach my $entry (@_) {
- my $clean = extract_valid_address($entry);
- next if $seen{$clean}++;
+ if (my $clean = extract_valid_address($entry)) {
+ $seen{$clean} ||= 0;
+ next if $seen{$clean}++;
+ } else {
+ # it could still be a local email address without '@',
+ # which neither Email::Valid or our own small regex says
+ # is valid...
+ $seen{$entry} ||= 0;
+ next if $seen{$entry}++;
+ }
push @emails, $entry;
}
return @emails;
--
1.3.2.g0e5a
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 2:32 [PATCH] send-email: allow sendmail binary to be used instead of SMTP Eric Wong
2006-05-15 2:34 ` Eric Wong
2006-05-15 2:38 ` [PATCH] send-email: quiet some warnings Eric Wong
@ 2006-05-15 5:52 ` Junio C Hamano
2006-05-15 9:27 ` Eric Wong
2 siblings, 1 reply; 17+ messages in thread
From: Junio C Hamano @ 2006-05-15 5:52 UTC (permalink / raw)
To: Eric Wong; +Cc: git
Eric Wong <normalperson@yhbt.net> writes:
> This should make local mailing possible for machines without
> a connection to an SMTP server.
Which is a good thing, but
> It'll default to using /usr/sbin/sendmail or /usr/lib/sendmail
> if no SMTP server is specified (the default). If it can't find
> either of those paths, it'll fall back to connecting to an SMTP
> server on localhost.
I do not know if it is OK to change the default to first prefer
local MDA executable and then "localhost". That is, ...
> @@ -179,8 +180,14 @@ if (!defined $initial_reply_to && $promp
> $initial_reply_to =~ s/(^\s+|\s+$)//g;
> }
>
> -if (!defined $smtp_server) {
> - $smtp_server = "localhost";
> +if (!$smtp_server) {
> + foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
> + if (-x $_) {
> + $smtp_server = $_;
> + last;
> + }
> + }
> + $smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*
> }
>
> if ($compose) {
Without this hunk, people who did not specify --smtp-server=host
could get away with having anything that listens to 25/tcp on
the localhost that is not either of the above two paths; now
they have to explicitly say --smtp-server=localhost to defeat
what this hunk does. I do not know if it is a big deal, though.
> + if ($smtp_server =~ m#^/#) {
I like this if(){}else{} here, but have a feeling that the
logging part should be placed outside it to be shared.
While we are at it, we might want to enhance $smtp_server parsing
to take host:port notation so that people can use message
submission port 587/tcp (RFC 4409) instead.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: quiet some warnings
2006-05-15 2:38 ` [PATCH] send-email: quiet some warnings Eric Wong
@ 2006-05-15 6:04 ` Junio C Hamano
2006-05-15 9:41 ` [PATCH] send-email: quiet some warnings, reject invalid addresses Eric Wong
0 siblings, 1 reply; 17+ messages in thread
From: Junio C Hamano @ 2006-05-15 6:04 UTC (permalink / raw)
To: Eric Wong; +Cc: git
Eric Wong <normalperson@yhbt.net> writes:
> @@ -507,8 +507,16 @@ sub unique_email_list(@) {
> my @emails;
>
> foreach my $entry (@_) {
> - my $clean = extract_valid_address($entry);
> - next if $seen{$clean}++;
> + if (my $clean = extract_valid_address($entry)) {
> + $seen{$clean} ||= 0;
> + next if $seen{$clean}++;
> + } else {
> + # it could still be a local email address without '@',
> + # which neither Email::Valid or our own small regex says
> + # is valid...
> + $seen{$entry} ||= 0;
> + next if $seen{$entry}++;
> + }
Wouldn't you want three kinds of return values from
sub extract_valid_address() if you want to do this? That is,
(1) address is valid and this is the cleaned up value;
(2) address is known to be bogus; do not use it.
(3) address might be local.
And (1) and (3) are probably the same thing in practice. In a
localsite setting, it is often convenient to be able to use
addr-spec that is local-part only, so something like the
attached change, with your error squelching for 'undef' return
in the second case, might be more appropriate.
-- >8 --
diff --git a/git-send-email.perl b/git-send-email.perl
index d8c4b1f..7a89e26 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -300,6 +300,9 @@ our ($message_id, $cc, %mail, $subject,
sub extract_valid_address {
my $address = shift;
+
+ return $address if ($address =~ /^(\w+)$/);
+
if ($have_email_valid) {
return Email::Valid->address($address);
} else {
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 5:52 ` [PATCH] send-email: allow sendmail binary to be used instead of SMTP Junio C Hamano
@ 2006-05-15 9:27 ` Eric Wong
2006-05-15 9:34 ` Eric Wong
2006-05-15 9:47 ` Junio C Hamano
0 siblings, 2 replies; 17+ messages in thread
From: Eric Wong @ 2006-05-15 9:27 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Martin Langhoff, Greg KH, Ryan Anderson
Junio C Hamano <junkio@cox.net> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
>
> > This should make local mailing possible for machines without
> > a connection to an SMTP server.
>
> Which is a good thing, but
>
> > It'll default to using /usr/sbin/sendmail or /usr/lib/sendmail
> > if no SMTP server is specified (the default). If it can't find
> > either of those paths, it'll fall back to connecting to an SMTP
> > server on localhost.
>
> I do not know if it is OK to change the default to first prefer
> local MDA executable and then "localhost". That is, ...
>
> > @@ -179,8 +180,14 @@ if (!defined $initial_reply_to && $promp
> > $initial_reply_to =~ s/(^\s+|\s+$)//g;
> > }
> >
> > -if (!defined $smtp_server) {
> > - $smtp_server = "localhost";
> > +if (!$smtp_server) {
> > + foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
> > + if (-x $_) {
> > + $smtp_server = $_;
> > + last;
> > + }
> > + }
> > + $smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*
> > }
> >
> > if ($compose) {
>
> Without this hunk, people who did not specify --smtp-server=host
> could get away with having anything that listens to 25/tcp on
> the localhost that is not either of the above two paths; now
> they have to explicitly say --smtp-server=localhost to defeat
> what this hunk does. I do not know if it is a big deal, though.
I believe this is what Martin wanted. I think it's a good idea since
sendmail binaries tend to be more flexible, but I'm ok with it either
way.
Of course, Greg and Ryan were the original authors of this, so I'd
like their take on it, too.
> > + if ($smtp_server =~ m#^/#) {
>
> I like this if(){}else{} here, but have a feeling that the
> logging part should be placed outside it to be shared.
Cleaned that up a bit, patch coming. Also removed the Port: printout
completely, as it's rather redundant (see below).
> While we are at it, we might want to enhance $smtp_server parsing
> to take host:port notation so that people can use message
> submission port 587/tcp (RFC 4409) instead.
This already works, IO::Socket::INET (behind Net::SMTP) takes care of
it :)
--
Eric Wong
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 9:27 ` Eric Wong
@ 2006-05-15 9:34 ` Eric Wong
2006-05-15 9:47 ` Junio C Hamano
1 sibling, 0 replies; 17+ messages in thread
From: Eric Wong @ 2006-05-15 9:34 UTC (permalink / raw)
To: Junio C Hamano, Martin Langhoff, Ryan Anderson, Greg KH; +Cc: Eric Wong
This should make local mailing possible for machines without
a connection to an SMTP server.
It'll default to using /usr/sbin/sendmail or /usr/lib/sendmail
if no SMTP server is specified (the default). If it can't find
either of those paths, it'll fall back to connecting to an SMTP
server on localhost.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-send-email.perl | 60 ++++++++++++++++++++++++++++++++++-----------------
1 files changed, 40 insertions(+), 20 deletions(-)
d4248a8ab7c883ab0f4dc080374bf60dc582f0f4
diff --git a/git-send-email.perl b/git-send-email.perl
index d8c4b1f..0540e93 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -40,7 +40,8 @@ # Variables we fill in automatically, or
my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time);
# Behavior modification variables
-my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, "localhost", 0, 0, 0);
+my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc) = (1, 0, 0, 0);
+my $smtp_server;
# Example reply to:
#$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';
@@ -179,8 +180,14 @@ if (!defined $initial_reply_to && $promp
$initial_reply_to =~ s/(^\s+|\s+$)//g;
}
-if (!defined $smtp_server) {
- $smtp_server = "localhost";
+if (!$smtp_server) {
+ foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
+ if (-x $_) {
+ $smtp_server = $_;
+ last;
+ }
+ }
+ $smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*
}
if ($compose) {
@@ -358,26 +365,39 @@ X-Mailer: git-send-email $gitversion
";
$header .= "In-Reply-To: $reply_to\n" if $reply_to;
- $smtp ||= Net::SMTP->new( $smtp_server );
- $smtp->mail( $from ) or die $smtp->message;
- $smtp->to( @recipients ) or die $smtp->message;
- $smtp->data or die $smtp->message;
- $smtp->datasend("$header\n$message") or die $smtp->message;
- $smtp->dataend() or die $smtp->message;
- $smtp->ok or die "Failed to send $subject\n".$smtp->message;
-
+ if ($smtp_server =~ m#^/#) {
+ my $pid = open my $sm, '|-';
+ defined $pid or die $!;
+ if (!$pid) {
+ exec($smtp_server,'-i',@recipients) or die $!;
+ }
+ print $sm "$header\n$message";
+ close $sm or die $?;
+ } else {
+ $smtp ||= Net::SMTP->new( $smtp_server );
+ $smtp->mail( $from ) or die $smtp->message;
+ $smtp->to( @recipients ) or die $smtp->message;
+ $smtp->data or die $smtp->message;
+ $smtp->datasend("$header\n$message") or die $smtp->message;
+ $smtp->dataend() or die $smtp->message;
+ $smtp->ok or die "Failed to send $subject\n".$smtp->message;
+ }
if ($quiet) {
printf "Sent %s\n", $subject;
} else {
- print "OK. Log says:
-Date: $date
-Server: $smtp_server Port: 25
-From: $from
-Subject: $subject
-Cc: $cc
-To: $to
-
-Result: ", $smtp->code, ' ', ($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
+ print "OK. Log says:\nDate: $date\n";
+ if ($smtp) {
+ print "Server: $smtp_server\n";
+ } else {
+ print "Sendmail: $smtp_server\n";
+ }
+ print "From: $from\nSubject: $subject\nCc: $cc\nTo: $to\n\n";
+ if ($smtp) {
+ print "Result: ", $smtp->code, ' ',
+ ($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
+ } else {
+ print "Result: OK\n";
+ }
}
}
--
1.3.2.g7d11
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH] send-email: quiet some warnings, reject invalid addresses
2006-05-15 6:04 ` Junio C Hamano
@ 2006-05-15 9:41 ` Eric Wong
0 siblings, 0 replies; 17+ messages in thread
From: Eric Wong @ 2006-05-15 9:41 UTC (permalink / raw)
To: git, Junio C Hamano, Martin Langhoff, Ryan Anderson, Greg KH; +Cc: Eric Wong
I'm not sure why we never actually rejected invalid addresses in
the first place. We just seemed to be using our email validity
checkers to kill duplicates.
Now we just drop invalid email addresses completely and warn
the user about it.
Since we support local sendmail, we'll also accept username-only
addresses.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-send-email.perl | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
f069e9a9cee726d82dfeee1d477152a0fe0651c1
diff --git a/git-send-email.perl b/git-send-email.perl
index 0540e93..312a4ea 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -307,6 +307,10 @@ our ($message_id, $cc, %mail, $subject,
sub extract_valid_address {
my $address = shift;
+
+ # check for a local address:
+ return $address if ($address =~ /^([\w\-]+)$/);
+
if ($have_email_valid) {
return Email::Valid->address($address);
} else {
@@ -498,9 +502,14 @@ sub unique_email_list(@) {
my @emails;
foreach my $entry (@_) {
- my $clean = extract_valid_address($entry);
- next if $seen{$clean}++;
- push @emails, $entry;
+ if (my $clean = extract_valid_address($entry)) {
+ $seen{$clean} ||= 0;
+ next if $seen{$clean}++;
+ push @emails, $entry;
+ } else {
+ print STDERR "W: unable to extract a valid address",
+ " from: $entry\n";
+ }
}
return @emails;
}
--
1.3.2.g7d11
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 9:27 ` Eric Wong
2006-05-15 9:34 ` Eric Wong
@ 2006-05-15 9:47 ` Junio C Hamano
2006-05-15 10:11 ` Eric Wong
2006-05-15 21:01 ` Ryan Anderson
1 sibling, 2 replies; 17+ messages in thread
From: Junio C Hamano @ 2006-05-15 9:47 UTC (permalink / raw)
To: Eric Wong; +Cc: git
Eric Wong <normalperson@yhbt.net> writes:
> I believe this is what Martin wanted. I think it's a good idea since
> sendmail binaries tend to be more flexible, but I'm ok with it either
> way.
I am not opposed to have an option to run a local submission
agent binary (I said I like that if(){}else{} there, didn't I?).
The ability to do so is a good thing. I am not however sure
about changing the default when no option is specified on the
command line.
>> > + if ($smtp_server =~ m#^/#) {
>>
>> I like this if(){}else{} here, but have a feeling that the
>> logging part should be placed outside it to be shared.
>
> Cleaned that up a bit, patch coming. Also removed the Port: printout
> completely, as it's rather redundant (see below).
>
>> While we are at it, we might want to enhance $smtp_server parsing
>> to take host:port notation so that people can use message
>> submission port 587/tcp (RFC 4409) instead.
>
> This already works, IO::Socket::INET (behind Net::SMTP) takes care of
> it :)
Thanks. Maybe the next option would be delivery to a file (or
even SMTP batch)? ;-)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 9:47 ` Junio C Hamano
@ 2006-05-15 10:11 ` Eric Wong
2006-05-15 10:37 ` Martin Langhoff
2006-05-15 21:01 ` Ryan Anderson
1 sibling, 1 reply; 17+ messages in thread
From: Eric Wong @ 2006-05-15 10:11 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Martin Langhoff
Junio C Hamano <junkio@cox.net> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
>
> > I believe this is what Martin wanted. I think it's a good idea since
> > sendmail binaries tend to be more flexible, but I'm ok with it either
> > way.
>
> I am not opposed to have an option to run a local submission
> agent binary (I said I like that if(){}else{} there, didn't I?).
> The ability to do so is a good thing. I am not however sure
> about changing the default when no option is specified on the
> command line.
By "I believe this is what Martin wanted", I meant changing the default to
sendmail: <46a038f90604271804j195d62f3x93ae816e809f4ffd@mail.gmail.com>
> Oh, it should just work with sendmail if it's there and we don't
> provide --smtp-server ;-)
> >> > + if ($smtp_server =~ m#^/#) {
> >>
> >> I like this if(){}else{} here, but have a feeling that the
> >> logging part should be placed outside it to be shared.
> >
> > Cleaned that up a bit, patch coming. Also removed the Port: printout
> > completely, as it's rather redundant (see below).
> >
> >> While we are at it, we might want to enhance $smtp_server parsing
> >> to take host:port notation so that people can use message
> >> submission port 587/tcp (RFC 4409) instead.
> >
> > This already works, IO::Socket::INET (behind Net::SMTP) takes care of
> > it :)
>
> Thanks. Maybe the next option would be delivery to a file (or
> even SMTP batch)? ;-)
Sure :) Authentication and SSL may be worth looking into, though. I'm
pretty content these days with my autossh tunnel to my mail server,
though.
--
Eric Wong
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 10:11 ` Eric Wong
@ 2006-05-15 10:37 ` Martin Langhoff
2006-05-15 16:25 ` Junio C Hamano
2006-05-15 19:10 ` Eric Wong
0 siblings, 2 replies; 17+ messages in thread
From: Martin Langhoff @ 2006-05-15 10:37 UTC (permalink / raw)
To: Eric Wong; +Cc: Junio C Hamano, git
On 5/15/06, Eric Wong <normalperson@yhbt.net> wrote:
> Junio C Hamano <junkio@cox.net> wrote:
> > I am not opposed to have an option to run a local submission
> > agent binary (I said I like that if(){}else{} there, didn't I?).
> > The ability to do so is a good thing. I am not however sure
> > about changing the default when no option is specified on the
> > command line.
>
> By "I believe this is what Martin wanted", I meant changing the default to
> sendmail: <46a038f90604271804j195d62f3x93ae816e809f4ffd@mail.gmail.com>
>
> > Oh, it should just work with sendmail if it's there and we don't
Thanks Eric! git-send-email used to default to using local binaries.
It was only with the switch to Net::SMTP that the default changed to
localhost:25.
IMHO the developer's machine is more likely to have a working
/usr/sbin/sendmail than an SMTP server (specially looking at current
linux desktop configurations).
OTOH, as long as I can override it to use sendmail, it's all good.
martin
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 10:37 ` Martin Langhoff
@ 2006-05-15 16:25 ` Junio C Hamano
2006-05-15 19:10 ` Eric Wong
1 sibling, 0 replies; 17+ messages in thread
From: Junio C Hamano @ 2006-05-15 16:25 UTC (permalink / raw)
To: Martin Langhoff; +Cc: Eric Wong, Junio C Hamano, git
"Martin Langhoff" <martin.langhoff@gmail.com> writes:
> On 5/15/06, Eric Wong <normalperson@yhbt.net> wrote:
>> Junio C Hamano <junkio@cox.net> wrote:
>> > I am not opposed to have an option to run a local submission
>> > agent binary (I said I like that if(){}else{} there, didn't I?).
>> > The ability to do so is a good thing. I am not however sure
>> > about changing the default when no option is specified on the
>> > command line.
>>
>> By "I believe this is what Martin wanted", I meant changing the default to
>> sendmail: <46a038f90604271804j195d62f3x93ae816e809f4ffd@mail.gmail.com>
>>
>> > Oh, it should just work with sendmail if it's there and we don't
>
> Thanks Eric! git-send-email used to default to using local binaries.
> It was only with the switch to Net::SMTP that the default changed to
> localhost:25.
Thanks, and I think it makes sense.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 10:37 ` Martin Langhoff
2006-05-15 16:25 ` Junio C Hamano
@ 2006-05-15 19:10 ` Eric Wong
1 sibling, 0 replies; 17+ messages in thread
From: Eric Wong @ 2006-05-15 19:10 UTC (permalink / raw)
To: Martin Langhoff; +Cc: Junio C Hamano, git
Martin Langhoff <martin.langhoff@gmail.com> wrote:
> Thanks Eric! git-send-email used to default to using local binaries.
> It was only with the switch to Net::SMTP that the default changed to
> localhost:25.
You're welcome.
That's odd, though, looking at Mail::Sendmail, I don't think it actually
uses the sendmail binary, either. The FAQ
<http://alma.ch/perl/Mail-Sendmail-FAQ.html> confirms this, too.
Of course documentation may be lying and the code I'm looking at may be
*very* well obfuscated :D
--
Eric Wong
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 9:47 ` Junio C Hamano
2006-05-15 10:11 ` Eric Wong
@ 2006-05-15 21:01 ` Ryan Anderson
2006-05-15 21:13 ` Junio C Hamano
1 sibling, 1 reply; 17+ messages in thread
From: Ryan Anderson @ 2006-05-15 21:01 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Eric Wong, git
On Mon, May 15, 2006 at 02:47:31AM -0700, Junio C Hamano wrote:
> Eric Wong <normalperson@yhbt.net> writes:
>
> > I believe this is what Martin wanted. I think it's a good idea since
> > sendmail binaries tend to be more flexible, but I'm ok with it either
> > way.
>
> I am not opposed to have an option to run a local submission
> agent binary (I said I like that if(){}else{} there, didn't I?).
> The ability to do so is a good thing. I am not however sure
> about changing the default when no option is specified on the
> command line.
I think, in practice, that /usr/lib/sendmail will exist anywhere you hve
something running on port 25, at least on unixy machines. In my
searches at an old job, that appeared to be the canonical place to call
sendmail from, and every MTA appears to provide an appropriate binary
there.
So, I'm not overly worried about it.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 21:01 ` Ryan Anderson
@ 2006-05-15 21:13 ` Junio C Hamano
2006-05-15 21:52 ` Ryan Anderson
2006-05-15 22:07 ` Martin Langhoff
0 siblings, 2 replies; 17+ messages in thread
From: Junio C Hamano @ 2006-05-15 21:13 UTC (permalink / raw)
To: Ryan Anderson; +Cc: git
Ryan Anderson <ryan@michonline.com> writes:
> I think, in practice, that /usr/lib/sendmail will exist anywhere you hve
> something running on port 25, at least on unixy machines. In my
> searches at an old job, that appeared to be the canonical place to call
> sendmail from, and every MTA appears to provide an appropriate binary
> there.
>
> So, I'm not overly worried about it.
exim, postfix and friends?
I used to know somebody who port-forwarded 25/tcp to central
smtp server from smaller machines in her intranet installation,
but I would say that is rare. I am not worried about it either;
I just wanted to make sure _somebody_ thought the potential
issues through and agreed with the change the patch makes.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 21:13 ` Junio C Hamano
@ 2006-05-15 21:52 ` Ryan Anderson
2006-05-15 22:07 ` Martin Langhoff
1 sibling, 0 replies; 17+ messages in thread
From: Ryan Anderson @ 2006-05-15 21:52 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Ryan Anderson, git
On Mon, May 15, 2006 at 02:13:25PM -0700, Junio C Hamano wrote:
> Ryan Anderson <ryan@michonline.com> writes:
>
> > I think, in practice, that /usr/lib/sendmail will exist anywhere you hve
> > something running on port 25, at least on unixy machines. In my
> > searches at an old job, that appeared to be the canonical place to call
> > sendmail from, and every MTA appears to provide an appropriate binary
> > there.
> >
> > So, I'm not overly worried about it.
>
> exim, postfix and friends?
At least as packaged by Debian and Ubuntu, exim and postfix both fit
that rule.
It's just that there is no other canonical name for the binary that
provides the functionality, so everyone steals the name.
> I used to know somebody who port-forwarded 25/tcp to central
> smtp server from smaller machines in her intranet installation,
> but I would say that is rare. I am not worried about it either;
> I just wanted to make sure _somebody_ thought the potential
> issues through and agreed with the change the patch makes.
Fair enough.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 21:13 ` Junio C Hamano
2006-05-15 21:52 ` Ryan Anderson
@ 2006-05-15 22:07 ` Martin Langhoff
1 sibling, 0 replies; 17+ messages in thread
From: Martin Langhoff @ 2006-05-15 22:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Ryan Anderson, git
On 5/16/06, Junio C Hamano <junkio@cox.net> wrote:
> Ryan Anderson <ryan@michonline.com> writes:
>
> > I think, in practice, that /usr/lib/sendmail will exist anywhere you hve
> > something running on port 25, at least on unixy machines.
...
> exim, postfix and friends?
/usr/sbin/sendmail is there for any current MTA, so if qmail, exim,
postfix, sendmail and all MTAs I can think of install a working
sendmail binary.
Newish desktop-targetted distros (and MacOSX) are leaning towards not
running an MTA on port 25 any more unless you ask them for it. They'll
do crontab-driven queue flushes, so the messages you feed to
/usr/sbin/sendmail will be sent a few minutes later.
That is why IMHO /usr/sbin/sendmail is a better default than
localhost:25, but I can live with either ;-)
> I used to know somebody who port-forwarded 25/tcp to central
> smtp server from smaller machines in her intranet installation,
I can understand that, but I think the changes in unixy distros
mentioned above make it unnecessary today.
cheers,
martin
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2006-05-15 22:07 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-15 2:32 [PATCH] send-email: allow sendmail binary to be used instead of SMTP Eric Wong
2006-05-15 2:34 ` Eric Wong
2006-05-15 2:38 ` [PATCH] send-email: quiet some warnings Eric Wong
2006-05-15 6:04 ` Junio C Hamano
2006-05-15 9:41 ` [PATCH] send-email: quiet some warnings, reject invalid addresses Eric Wong
2006-05-15 5:52 ` [PATCH] send-email: allow sendmail binary to be used instead of SMTP Junio C Hamano
2006-05-15 9:27 ` Eric Wong
2006-05-15 9:34 ` Eric Wong
2006-05-15 9:47 ` Junio C Hamano
2006-05-15 10:11 ` Eric Wong
2006-05-15 10:37 ` Martin Langhoff
2006-05-15 16:25 ` Junio C Hamano
2006-05-15 19:10 ` Eric Wong
2006-05-15 21:01 ` Ryan Anderson
2006-05-15 21:13 ` Junio C Hamano
2006-05-15 21:52 ` Ryan Anderson
2006-05-15 22:07 ` Martin Langhoff
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 NNTP newsgroup(s).