{"thread":{"id":"4140","subject":"[PATCH] send-email: allow sendmail binary to be used instead of SMTP","startedAt":"2006-05-15T02:32:25Z","lastAt":"2006-05-15T22:07:16Z","messageCount":17,"participants":["Eric Wong","Junio C Hamano","Martin Langhoff","Ryan Anderson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"19954","messageId":"1147660345772-git-send-email-normalperson@yhbt.net","threadId":"4140","inReplyTo":null,"subject":"[PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-15T02:32:25Z","receivedAt":"2006-05-15T02:32:25Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This should make local mailing possible for machines without\na connection to an SMTP server.\n\nIt'll default to using /usr/sbin/sendmail or /usr/lib/sendmail\nif no SMTP server is specified (the default).  If it can't find\neither of those paths, it'll fall back to connecting to an SMTP\nserver on localhost.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n---\n\n git-send-email.perl |   55 +++++++++++++++++++++++++++++++++++++++------------\n 1 files changed, 42 insertions(+), 13 deletions(-)\n\n1c9bacc5a2bfe382f68046aeba62302d28e4c976\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex d8c4b1f..d27a7a5 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -40,7 +40,8 @@ # Variables we fill in automatically, or\n my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time);\n \n # Behavior modification variables\n-my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, \"localhost\", 0, 0, 0);\n+my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc) = (1, 0, 0, 0);\n+my $smtp_server;\n \n # Example reply to:\n #$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';\n@@ -179,8 +180,14 @@ if (!defined $initial_reply_to && $promp\n \t$initial_reply_to =~ s/(^\\s+|\\s+$)//g;\n }\n \n-if (!defined $smtp_server) {\n-\t$smtp_server = \"localhost\";\n+if (!$smtp_server) {\n+\tforeach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {\n+\t\tif (-x $_) {\n+\t\t\t$smtp_server = $_;\n+\t\t\tlast;\n+\t\t}\n+\t}\n+\t$smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*\n }\n \n if ($compose) {\n@@ -358,18 +365,39 @@ X-Mailer: git-send-email $gitversion\n \";\n \t$header .= \"In-Reply-To: $reply_to\\n\" if $reply_to;\n \n-\t$smtp ||= Net::SMTP->new( $smtp_server );\n-\t$smtp->mail( $from ) or die $smtp->message;\n-\t$smtp->to( @recipients ) or die $smtp->message;\n-\t$smtp->data or die $smtp->message;\n-\t$smtp->datasend(\"$header\\n$message\") or die $smtp->message;\n-\t$smtp->dataend() or die $smtp->message;\n-\t$smtp->ok or die \"Failed to send $subject\\n\".$smtp->message;\n+\tif ($smtp_server =~ m#^/#) {\n+\t\tmy $pid = open my $sm, '|-';\n+\t\tdefined $pid or die $!;\n+\t\tif (!$pid) {\n+\t\t\texec($smtp_server,'-i',@recipients) or die $!;\n+\t\t}\n+\t\tprint $sm \"$header\\n$message\";\n+\t\tclose $sm or die $?;\n+\t\tif ($quiet) {\n+\t\t\tprintf \"Sent %s\\n\", $subject;\n+\t\t} else {\n+\t\t\tprint \"OK. Log says:\n+Date: $date\n+Sendmail: $smtp_server\n+From: $from\n+Subject: $subject\n+Cc: $cc\n+To: $to\n \n-\tif ($quiet) {\n-\t\tprintf \"Sent %s\\n\", $subject;\n+Result: OK\\n\";\n+\t\t}\n \t} else {\n-\t\tprint \"OK. Log says:\n+\t\t$smtp ||= Net::SMTP->new( $smtp_server );\n+\t\t$smtp->mail( $from ) or die $smtp->message;\n+\t\t$smtp->to( @recipients ) or die $smtp->message;\n+\t\t$smtp->data or die $smtp->message;\n+\t\t$smtp->datasend(\"$header\\n$message\") or die $smtp->message;\n+\t\t$smtp->dataend() or die $smtp->message;\n+\t\t$smtp->ok or die \"Failed to send $subject\\n\".$smtp->message;\n+\t\tif ($quiet) {\n+\t\t\tprintf \"Sent %s\\n\", $subject;\n+\t\t} else {\n+\t\t\tprint \"OK. Log says:\n Date: $date\n Server: $smtp_server Port: 25\n From: $from\n@@ -378,6 +406,7 @@ Cc: $cc\n To: $to\n \n Result: \", $smtp->code, ' ', ($smtp->message =~ /\\n([^\\n]+\\n)$/s), \"\\n\";\n+\t\t}\n \t}\n }\n \n-- \n1.3.2.g1c9b\n"},{"id":"19955","messageId":"20060515023407.GA6855@localdomain","threadId":"4140","inReplyTo":"1147660345772-git-send-email-normalperson@yhbt.net","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-15T02:34:08Z","receivedAt":"2006-05-15T02:34:08Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Eric Wong <normalperson@yhbt.net> wrote:\n> This should make local mailing possible for machines without\n> a connection to an SMTP server.\n> \n> It'll default to using /usr/sbin/sendmail or /usr/lib/sendmail\n> if no SMTP server is specified (the default).  If it can't find\n> either of those paths, it'll fall back to connecting to an SMTP\n> server on localhost.\n> \n> Signed-off-by: Eric Wong <normalperson@yhbt.net>\n\nAlso, Thanks to Martin Langhoff for bringing this up.\n\n-- \nEric Wong\n"},{"id":"19957","messageId":"11476606883991-git-send-email-normalperson@yhbt.net","threadId":"4140","inReplyTo":"1147660345772-git-send-email-normalperson@yhbt.net","subject":"[PATCH] send-email: quiet some warnings","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-15T02:38:08Z","receivedAt":"2006-05-15T02:38:08Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Signed-off-by: Eric Wong <normalperson@yhbt.net>\n\n---\n\n git-send-email.perl |   12 ++++++++++--\n 1 files changed, 10 insertions(+), 2 deletions(-)\n\n0e5a33f56f62e527b74b2afbd93a1cca812f97af\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex d27a7a5..379e0c4 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -507,8 +507,16 @@ sub unique_email_list(@) {\n \tmy @emails;\n \n \tforeach my $entry (@_) {\n-\t\tmy $clean = extract_valid_address($entry);\n-\t\tnext if $seen{$clean}++;\n+\t\tif (my $clean = extract_valid_address($entry)) {\n+\t\t\t$seen{$clean} ||= 0;\n+\t\t\tnext if $seen{$clean}++;\n+\t\t} else {\n+\t\t\t# it could still be a local email address without '@',\n+\t\t\t# which neither Email::Valid or our own small regex says\n+\t\t\t# is valid...\n+\t\t\t$seen{$entry} ||= 0;\n+\t\t\tnext if $seen{$entry}++;\n+\t\t}\n \t\tpush @emails, $entry;\n \t}\n \treturn @emails;\n-- \n1.3.2.g0e5a\n"},{"id":"19966","messageId":"7vpsifx2b7.fsf@assigned-by-dhcp.cox.net","threadId":"4140","inReplyTo":"1147660345772-git-send-email-normalperson@yhbt.net","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-15T05:52:12Z","receivedAt":"2006-05-15T05:52:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> This should make local mailing possible for machines without\n> a connection to an SMTP server.\n\nWhich is a good thing, but\n\n> It'll default to using /usr/sbin/sendmail or /usr/lib/sendmail\n> if no SMTP server is specified (the default).  If it can't find\n> either of those paths, it'll fall back to connecting to an SMTP\n> server on localhost.\n\nI do not know if it is OK to change the default to first prefer\nlocal MDA executable and then \"localhost\".  That is, ...\n\n> @@ -179,8 +180,14 @@ if (!defined $initial_reply_to && $promp\n>  \t$initial_reply_to =~ s/(^\\s+|\\s+$)//g;\n>  }\n>  \n> -if (!defined $smtp_server) {\n> -\t$smtp_server = \"localhost\";\n> +if (!$smtp_server) {\n> +\tforeach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {\n> +\t\tif (-x $_) {\n> +\t\t\t$smtp_server = $_;\n> +\t\t\tlast;\n> +\t\t}\n> +\t}\n> +\t$smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*\n>  }\n>  \n>  if ($compose) {\n\nWithout this hunk, people who did not specify --smtp-server=host\ncould get away with having anything that listens to 25/tcp on\nthe localhost that is not either of the above two paths; now\nthey have to explicitly say --smtp-server=localhost to defeat\nwhat this hunk does.  I do not know if it is a big deal, though.\n\n> +\tif ($smtp_server =~ m#^/#) {\n\nI like this if(){}else{} here, but have a feeling that the\nlogging part should be placed outside it to be shared.\n\nWhile we are at it, we might want to enhance $smtp_server parsing\nto take host:port notation so that people can use message\nsubmission port 587/tcp (RFC 4409) instead.\n"},{"id":"19970","messageId":"7vlkt3x1qz.fsf@assigned-by-dhcp.cox.net","threadId":"4140","inReplyTo":"11476606883991-git-send-email-normalperson@yhbt.net","subject":"Re: [PATCH] send-email: quiet some warnings","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-15T06:04:20Z","receivedAt":"2006-05-15T06:04:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> @@ -507,8 +507,16 @@ sub unique_email_list(@) {\n>  \tmy @emails;\n>  \n>  \tforeach my $entry (@_) {\n> -\t\tmy $clean = extract_valid_address($entry);\n> -\t\tnext if $seen{$clean}++;\n> +\t\tif (my $clean = extract_valid_address($entry)) {\n> +\t\t\t$seen{$clean} ||= 0;\n> +\t\t\tnext if $seen{$clean}++;\n> +\t\t} else {\n> +\t\t\t# it could still be a local email address without '@',\n> +\t\t\t# which neither Email::Valid or our own small regex says\n> +\t\t\t# is valid...\n> +\t\t\t$seen{$entry} ||= 0;\n> +\t\t\tnext if $seen{$entry}++;\n> +\t\t}\n\nWouldn't you want three kinds of return values from\nsub extract_valid_address() if you want to do this?  That is, \n\n (1) address is valid and this is the cleaned up value;\n (2) address is known to be bogus; do not use it.\n (3) address might be local.\n\nAnd (1) and (3) are probably the same thing in practice.  In a\nlocalsite setting, it is often convenient to be able to use\naddr-spec that is local-part only, so something like the\nattached change, with your error squelching for 'undef' return\nin the second case, might be more appropriate.\n\n-- >8 --\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex d8c4b1f..7a89e26 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -300,6 +300,9 @@ our ($message_id, $cc, %mail, $subject, \n \n sub extract_valid_address {\n \tmy $address = shift;\n+\n+\treturn $address if ($address =~ /^(\\w+)$/);\n+\n \tif ($have_email_valid) {\n \t\treturn Email::Valid->address($address);\n \t} else {\n"},{"id":"19981","messageId":"20060515092704.GB6855@localdomain","threadId":"4140","inReplyTo":"7vpsifx2b7.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-15T09:27:04Z","receivedAt":"2006-05-15T09:27:04Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n> \n> > This should make local mailing possible for machines without\n> > a connection to an SMTP server.\n> \n> Which is a good thing, but\n> \n> > It'll default to using /usr/sbin/sendmail or /usr/lib/sendmail\n> > if no SMTP server is specified (the default).  If it can't find\n> > either of those paths, it'll fall back to connecting to an SMTP\n> > server on localhost.\n> \n> I do not know if it is OK to change the default to first prefer\n> local MDA executable and then \"localhost\".  That is, ...\n> \n> > @@ -179,8 +180,14 @@ if (!defined $initial_reply_to && $promp\n> >  \t$initial_reply_to =~ s/(^\\s+|\\s+$)//g;\n> >  }\n> >  \n> > -if (!defined $smtp_server) {\n> > -\t$smtp_server = \"localhost\";\n> > +if (!$smtp_server) {\n> > +\tforeach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {\n> > +\t\tif (-x $_) {\n> > +\t\t\t$smtp_server = $_;\n> > +\t\t\tlast;\n> > +\t\t}\n> > +\t}\n> > +\t$smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*\n> >  }\n> >  \n> >  if ($compose) {\n> \n> Without this hunk, people who did not specify --smtp-server=host\n> could get away with having anything that listens to 25/tcp on\n> the localhost that is not either of the above two paths; now\n> they have to explicitly say --smtp-server=localhost to defeat\n> what this hunk does.  I do not know if it is a big deal, though.\n\nI believe this is what Martin wanted.  I think it's a good idea since\nsendmail binaries tend to be more flexible, but I'm ok with it either\nway.\n\nOf course, Greg and Ryan were the original authors of this, so I'd\nlike their take on it, too.\n\n> > +\tif ($smtp_server =~ m#^/#) {\n> \n> I like this if(){}else{} here, but have a feeling that the\n> logging part should be placed outside it to be shared.\n\nCleaned that up a bit, patch coming.  Also removed the Port: printout\ncompletely, as it's rather redundant (see below).\n\n> While we are at it, we might want to enhance $smtp_server parsing\n> to take host:port notation so that people can use message\n> submission port 587/tcp (RFC 4409) instead.\n\nThis already works, IO::Socket::INET (behind Net::SMTP) takes care of\nit :)\n\n-- \nEric Wong\n"},{"id":"19982","messageId":"11476856841695-git-send-email-normalperson@yhbt.net","threadId":"4140","inReplyTo":"20060515092704.GB6855@localdomain","subject":"[PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-15T09:34:44Z","receivedAt":"2006-05-15T09:34:44Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This should make local mailing possible for machines without\na connection to an SMTP server.\n\nIt'll default to using /usr/sbin/sendmail or /usr/lib/sendmail\nif no SMTP server is specified (the default).  If it can't find\neither of those paths, it'll fall back to connecting to an SMTP\nserver on localhost.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n---\n\n git-send-email.perl |   60 ++++++++++++++++++++++++++++++++++-----------------\n 1 files changed, 40 insertions(+), 20 deletions(-)\n\nd4248a8ab7c883ab0f4dc080374bf60dc582f0f4\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex d8c4b1f..0540e93 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -40,7 +40,8 @@ # Variables we fill in automatically, or\n my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time);\n \n # Behavior modification variables\n-my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, \"localhost\", 0, 0, 0);\n+my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc) = (1, 0, 0, 0);\n+my $smtp_server;\n \n # Example reply to:\n #$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';\n@@ -179,8 +180,14 @@ if (!defined $initial_reply_to && $promp\n \t$initial_reply_to =~ s/(^\\s+|\\s+$)//g;\n }\n \n-if (!defined $smtp_server) {\n-\t$smtp_server = \"localhost\";\n+if (!$smtp_server) {\n+\tforeach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {\n+\t\tif (-x $_) {\n+\t\t\t$smtp_server = $_;\n+\t\t\tlast;\n+\t\t}\n+\t}\n+\t$smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*\n }\n \n if ($compose) {\n@@ -358,26 +365,39 @@ X-Mailer: git-send-email $gitversion\n \";\n \t$header .= \"In-Reply-To: $reply_to\\n\" if $reply_to;\n \n-\t$smtp ||= Net::SMTP->new( $smtp_server );\n-\t$smtp->mail( $from ) or die $smtp->message;\n-\t$smtp->to( @recipients ) or die $smtp->message;\n-\t$smtp->data or die $smtp->message;\n-\t$smtp->datasend(\"$header\\n$message\") or die $smtp->message;\n-\t$smtp->dataend() or die $smtp->message;\n-\t$smtp->ok or die \"Failed to send $subject\\n\".$smtp->message;\n-\n+\tif ($smtp_server =~ m#^/#) {\n+\t\tmy $pid = open my $sm, '|-';\n+\t\tdefined $pid or die $!;\n+\t\tif (!$pid) {\n+\t\t\texec($smtp_server,'-i',@recipients) or die $!;\n+\t\t}\n+\t\tprint $sm \"$header\\n$message\";\n+\t\tclose $sm or die $?;\n+\t} else {\n+\t\t$smtp ||= Net::SMTP->new( $smtp_server );\n+\t\t$smtp->mail( $from ) or die $smtp->message;\n+\t\t$smtp->to( @recipients ) or die $smtp->message;\n+\t\t$smtp->data or die $smtp->message;\n+\t\t$smtp->datasend(\"$header\\n$message\") or die $smtp->message;\n+\t\t$smtp->dataend() or die $smtp->message;\n+\t\t$smtp->ok or die \"Failed to send $subject\\n\".$smtp->message;\n+\t}\n \tif ($quiet) {\n \t\tprintf \"Sent %s\\n\", $subject;\n \t} else {\n-\t\tprint \"OK. Log says:\n-Date: $date\n-Server: $smtp_server Port: 25\n-From: $from\n-Subject: $subject\n-Cc: $cc\n-To: $to\n-\n-Result: \", $smtp->code, ' ', ($smtp->message =~ /\\n([^\\n]+\\n)$/s), \"\\n\";\n+\t\tprint \"OK. Log says:\\nDate: $date\\n\";\n+\t\tif ($smtp) {\n+\t\t\tprint \"Server: $smtp_server\\n\";\n+\t\t} else {\n+\t\t\tprint \"Sendmail: $smtp_server\\n\";\n+\t\t}\n+\t\tprint \"From: $from\\nSubject: $subject\\nCc: $cc\\nTo: $to\\n\\n\";\n+\t\tif ($smtp) {\n+\t\t\tprint \"Result: \", $smtp->code, ' ',\n+\t\t\t\t($smtp->message =~ /\\n([^\\n]+\\n)$/s), \"\\n\";\n+\t\t} else {\n+\t\t\tprint \"Result: OK\\n\";\n+\t\t}\n \t}\n }\n \n-- \n1.3.2.g7d11\n"},{"id":"19983","messageId":"11476860611181-git-send-email-normalperson@yhbt.net","threadId":"4140","inReplyTo":"7vlkt3x1qz.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] send-email: quiet some warnings, reject invalid addresses","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-15T09:41:01Z","receivedAt":"2006-05-15T09:41:01Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"I'm not sure why we never actually rejected invalid addresses in\nthe first place.  We just seemed to be using our email validity\ncheckers to kill duplicates.\n\nNow we just drop invalid email addresses completely and warn\nthe user about it.\n\nSince we support local sendmail, we'll also accept username-only\naddresses.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n---\n\n git-send-email.perl |   15 ++++++++++++---\n 1 files changed, 12 insertions(+), 3 deletions(-)\n\nf069e9a9cee726d82dfeee1d477152a0fe0651c1\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 0540e93..312a4ea 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -307,6 +307,10 @@ our ($message_id, $cc, %mail, $subject, \n \n sub extract_valid_address {\n \tmy $address = shift;\n+\n+\t# check for a local address:\n+\treturn $address if ($address =~ /^([\\w\\-]+)$/);\n+\n \tif ($have_email_valid) {\n \t\treturn Email::Valid->address($address);\n \t} else {\n@@ -498,9 +502,14 @@ sub unique_email_list(@) {\n \tmy @emails;\n \n \tforeach my $entry (@_) {\n-\t\tmy $clean = extract_valid_address($entry);\n-\t\tnext if $seen{$clean}++;\n-\t\tpush @emails, $entry;\n+\t\tif (my $clean = extract_valid_address($entry)) {\n+\t\t\t$seen{$clean} ||= 0;\n+\t\t\tnext if $seen{$clean}++;\n+\t\t\tpush @emails, $entry;\n+\t\t} else {\n+\t\t\tprint STDERR \"W: unable to extract a valid address\",\n+\t\t\t\t\t\" from: $entry\\n\";\n+\t\t}\n \t}\n \treturn @emails;\n }\n-- \n1.3.2.g7d11\n"},{"id":"19984","messageId":"7vmzdjtya4.fsf@assigned-by-dhcp.cox.net","threadId":"4140","inReplyTo":"20060515092704.GB6855@localdomain","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-15T09:47:31Z","receivedAt":"2006-05-15T09:47:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> I believe this is what Martin wanted.  I think it's a good idea since\n> sendmail binaries tend to be more flexible, but I'm ok with it either\n> way.\n\nI am not opposed to have an option to run a local submission\nagent binary (I said I like that if(){}else{} there, didn't I?).\nThe ability to do so is a good thing.  I am not however sure\nabout changing the default when no option is specified on the\ncommand line.\n\n>> > +\tif ($smtp_server =~ m#^/#) {\n>> \n>> I like this if(){}else{} here, but have a feeling that the\n>> logging part should be placed outside it to be shared.\n>\n> Cleaned that up a bit, patch coming.  Also removed the Port: printout\n> completely, as it's rather redundant (see below).\n>\n>> While we are at it, we might want to enhance $smtp_server parsing\n>> to take host:port notation so that people can use message\n>> submission port 587/tcp (RFC 4409) instead.\n>\n> This already works, IO::Socket::INET (behind Net::SMTP) takes care of\n> it :)\n\nThanks.  Maybe the next option would be delivery to a file (or\neven SMTP batch)? ;-)\n"},{"id":"19989","messageId":"20060515101142.GD6855@localdomain","threadId":"4140","inReplyTo":"7vmzdjtya4.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-15T10:11:42Z","receivedAt":"2006-05-15T10:11:42Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n> \n> > I believe this is what Martin wanted.  I think it's a good idea since\n> > sendmail binaries tend to be more flexible, but I'm ok with it either\n> > way.\n> \n> I am not opposed to have an option to run a local submission\n> agent binary (I said I like that if(){}else{} there, didn't I?).\n> The ability to do so is a good thing.  I am not however sure\n> about changing the default when no option is specified on the\n> command line.\n\nBy \"I believe this is what Martin wanted\", I meant changing the default to\nsendmail: <46a038f90604271804j195d62f3x93ae816e809f4ffd@mail.gmail.com>\n\n\t> Oh, it should just work with sendmail if it's there and we don't\n\t> provide --smtp-server ;-)\n\n> >> > +\tif ($smtp_server =~ m#^/#) {\n> >> \n> >> I like this if(){}else{} here, but have a feeling that the\n> >> logging part should be placed outside it to be shared.\n> >\n> > Cleaned that up a bit, patch coming.  Also removed the Port: printout\n> > completely, as it's rather redundant (see below).\n> >\n> >> While we are at it, we might want to enhance $smtp_server parsing\n> >> to take host:port notation so that people can use message\n> >> submission port 587/tcp (RFC 4409) instead.\n> >\n> > This already works, IO::Socket::INET (behind Net::SMTP) takes care of\n> > it :)\n> \n> Thanks.  Maybe the next option would be delivery to a file (or\n> even SMTP batch)? ;-)\n\nSure :)  Authentication and SSL may be worth looking into, though.  I'm\npretty content these days with my autossh tunnel to my mail server,\nthough.\n\n-- \nEric Wong\n"},{"id":"19991","messageId":"46a038f90605150337l3357ce3by22834823eee7b87c@mail.gmail.com","threadId":"4140","inReplyTo":"20060515101142.GD6855@localdomain","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-05-15T10:37:18Z","receivedAt":"2006-05-15T10:37:18Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 5/15/06, Eric Wong <normalperson@yhbt.net> wrote:\n> Junio C Hamano <junkio@cox.net> wrote:\n> > I am not opposed to have an option to run a local submission\n> > agent binary (I said I like that if(){}else{} there, didn't I?).\n> > The ability to do so is a good thing.  I am not however sure\n> > about changing the default when no option is specified on the\n> > command line.\n>\n> By \"I believe this is what Martin wanted\", I meant changing the default to\n> sendmail: <46a038f90604271804j195d62f3x93ae816e809f4ffd@mail.gmail.com>\n>\n>         > Oh, it should just work with sendmail if it's there and we don't\n\nThanks Eric! git-send-email used to default to using local binaries.\nIt was only with the switch to Net::SMTP that the default changed to\nlocalhost:25.\nIMHO the developer's machine is more likely to have a working\n/usr/sbin/sendmail than an SMTP server (specially looking at current\nlinux desktop configurations).\n\nOTOH, as long as I can override it to use sendmail, it's all good.\n\n\nmartin\n"},{"id":"20008","messageId":"7viro7tful.fsf@assigned-by-dhcp.cox.net","threadId":"4140","inReplyTo":"46a038f90605150337l3357ce3by22834823eee7b87c@mail.gmail.com","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-15T16:25:38Z","receivedAt":"2006-05-15T16:25:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Martin Langhoff\" <martin.langhoff@gmail.com> writes:\n\n> On 5/15/06, Eric Wong <normalperson@yhbt.net> wrote:\n>> Junio C Hamano <junkio@cox.net> wrote:\n>> > I am not opposed to have an option to run a local submission\n>> > agent binary (I said I like that if(){}else{} there, didn't I?).\n>> > The ability to do so is a good thing.  I am not however sure\n>> > about changing the default when no option is specified on the\n>> > command line.\n>>\n>> By \"I believe this is what Martin wanted\", I meant changing the default to\n>> sendmail: <46a038f90604271804j195d62f3x93ae816e809f4ffd@mail.gmail.com>\n>>\n>>         > Oh, it should just work with sendmail if it's there and we don't\n>\n> Thanks Eric! git-send-email used to default to using local binaries.\n> It was only with the switch to Net::SMTP that the default changed to\n> localhost:25.\n\nThanks, and I think it makes sense.\n"},{"id":"20022","messageId":"20060515190953.GA4368@localdomain","threadId":"4140","inReplyTo":"46a038f90605150337l3357ce3by22834823eee7b87c@mail.gmail.com","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-15T19:10:36Z","receivedAt":"2006-05-15T19:10:36Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Martin Langhoff <martin.langhoff@gmail.com> wrote:\n> Thanks Eric! git-send-email used to default to using local binaries.\n> It was only with the switch to Net::SMTP that the default changed to\n> localhost:25.\n\nYou're welcome.\n\nThat's odd, though, looking at Mail::Sendmail, I don't think it actually\nuses the sendmail binary, either.  The FAQ\n<http://alma.ch/perl/Mail-Sendmail-FAQ.html> confirms this, too.\n\nOf course documentation may be lying and the code I'm looking at may be\n*very* well obfuscated :D\n\n-- \nEric Wong\n"},{"id":"20028","messageId":"20060515210110.GR32076@h4x0r5.com","threadId":"4140","inReplyTo":"7vmzdjtya4.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-05-15T21:01:21Z","receivedAt":"2006-05-15T21:01:21Z","isPatch":true,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"On Mon, May 15, 2006 at 02:47:31AM -0700, Junio C Hamano wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n> \n> > I believe this is what Martin wanted.  I think it's a good idea since\n> > sendmail binaries tend to be more flexible, but I'm ok with it either\n> > way.\n> \n> I am not opposed to have an option to run a local submission\n> agent binary (I said I like that if(){}else{} there, didn't I?).\n> The ability to do so is a good thing.  I am not however sure\n> about changing the default when no option is specified on the\n> command line.\n\nI think, in practice, that /usr/lib/sendmail will exist anywhere you hve\nsomething running on port 25, at least on unixy machines.  In my\nsearches at an old job, that appeared to be the canonical place to call\nsendmail from, and every MTA appears to provide an appropriate binary\nthere.\n\nSo, I'm not overly worried about it.\n"},{"id":"20030","messageId":"7vhd3rgfey.fsf@assigned-by-dhcp.cox.net","threadId":"4140","inReplyTo":"20060515210110.GR32076@h4x0r5.com","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-15T21:13:25Z","receivedAt":"2006-05-15T21:13:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ryan Anderson <ryan@michonline.com> writes:\n\n> I think, in practice, that /usr/lib/sendmail will exist anywhere you hve\n> something running on port 25, at least on unixy machines.  In my\n> searches at an old job, that appeared to be the canonical place to call\n> sendmail from, and every MTA appears to provide an appropriate binary\n> there.\n>\n> So, I'm not overly worried about it.\n\nexim, postfix and friends?\n\nI used to know somebody who port-forwarded 25/tcp to central\nsmtp server from smaller machines in her intranet installation,\nbut I would say that is rare.  I am not worried about it either;\nI just wanted to make sure _somebody_ thought the potential\nissues through and agreed with the change the patch makes.\n"},{"id":"20032","messageId":"20060515215236.GA31164@h4x0r5.com","threadId":"4140","inReplyTo":"7vhd3rgfey.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-05-15T21:52:36Z","receivedAt":"2006-05-15T21:52:36Z","isPatch":true,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"On Mon, May 15, 2006 at 02:13:25PM -0700, Junio C Hamano wrote:\n> Ryan Anderson <ryan@michonline.com> writes:\n> \n> > I think, in practice, that /usr/lib/sendmail will exist anywhere you hve\n> > something running on port 25, at least on unixy machines.  In my\n> > searches at an old job, that appeared to be the canonical place to call\n> > sendmail from, and every MTA appears to provide an appropriate binary\n> > there.\n> >\n> > So, I'm not overly worried about it.\n> \n> exim, postfix and friends?\n\nAt least as packaged by Debian and Ubuntu, exim and postfix both fit\nthat rule.\n\nIt's just that there is no other canonical name for the binary that\nprovides the functionality, so everyone steals the name.\n\n> I used to know somebody who port-forwarded 25/tcp to central\n> smtp server from smaller machines in her intranet installation,\n> but I would say that is rare.  I am not worried about it either;\n> I just wanted to make sure _somebody_ thought the potential\n> issues through and agreed with the change the patch makes.\n\nFair enough.\n"},{"id":"20033","messageId":"46a038f90605151507p313386efv7998b2376cd85b2c@mail.gmail.com","threadId":"4140","inReplyTo":"7vhd3rgfey.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] send-email: allow sendmail binary to be used instead of SMTP","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-05-15T22:07:16Z","receivedAt":"2006-05-15T22:07:16Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 5/16/06, Junio C Hamano <junkio@cox.net> wrote:\n> Ryan Anderson <ryan@michonline.com> writes:\n>\n> > I think, in practice, that /usr/lib/sendmail will exist anywhere you hve\n> > something running on port 25, at least on unixy machines.\n...\n> exim, postfix and friends?\n\n/usr/sbin/sendmail is there for any current MTA, so if qmail, exim,\npostfix, sendmail and all MTAs I can think of install a working\nsendmail binary.\n\nNewish desktop-targetted distros (and MacOSX) are leaning towards not\nrunning an MTA on port 25 any more unless you ask them for it. They'll\ndo crontab-driven queue flushes, so the messages you feed to\n/usr/sbin/sendmail will be sent a few minutes later.\n\nThat is why IMHO /usr/sbin/sendmail is a better default than\nlocalhost:25, but I can live with either ;-)\n\n> I used to know somebody who port-forwarded 25/tcp to central\n> smtp server from smaller machines in her intranet installation,\n\nI can understand that, but I think the changes in unixy distros\nmentioned above make it unnecessary today.\n\ncheers,\n\n\nmartin\n"}]}