git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] send-email: remove documented requirement for Net::SMTP::SSL

From
EWEric Wong <e@80x24.org>
Date
May 28, 2019, 01:57 UTC
Message-ID
<20190528015759.GA13521@dcvr>
In-Reply-To
<87h89fmjzc.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 34 quoted lines
> On Tue, May 28 2019, Eric Wong wrote:
> > Todd Zullinger <tmz@pobox.com> wrote:
> >> Something like:
> >>
> >> diff --git i/git-send-email.perl w/git-send-email.perl
> >> index 24859a7bc3..84ac03994d 100755
> >> --- i/git-send-email.perl
> >> +++ w/git-send-email.perl
> >> @@ -1465,7 +1465,7 @@ sub send_message {
> >>  		}
> >>
> >>  		require Net::SMTP;
> >> -		my $use_net_smtp_ssl = version->parse($Net::SMTP::VERSION) < version->parse("2.34");
> >> +		my $use_net_smtp_ssl = Net::SMTP->can('starttls') ? 0 : 1;
> >>  		$smtp_domain ||= maildomain();
> >>
> >>  		if ($smtp_encryption eq 'ssl') {
> >
> > Looks much better to me.
> 
> Same, but to bikeshed a bit, at this point we can just do:
>     
>     diff --git a/git-send-email.perl b/git-send-email.perl
>     index 24859a7bc3..4ad2091a49 100755
>     --- a/git-send-email.perl
>     +++ b/git-send-email.perl
>     @@ -1468 +1467,0 @@ sub send_message {
>     -               my $use_net_smtp_ssl = version->parse($Net::SMTP::VERSION) < version->parse("2.34");
>     @@ -1485 +1484 @@ sub send_message {
>     -                       if ($use_net_smtp_ssl) {
>     +                       if (Net::SMTP->can('starttls')) {
>     @@ -1507 +1506 @@ sub send_message {
>     -                               if ($use_net_smtp_ssl) {
>     +                               if (Net::SMTP->can('starttls')) {
Higher probability of a typo slipping through the cracks, though :)
(I was just bit by a similar case with hashes that would've been
 caught by "use fields")
Previous: Todd Zullinger
Message 11 of 11 in “send-email: remove documented requirement for Net::SMTP::SSL”
  1. send-email: remove documented requirement for Net::SMTP::SSLChris Mayo, May 26, 2019
  2. Eric WongMay 27, 2019
  3. Ævar Arnfjörð BjarmasonMay 27, 2019
  4. brian m. carlsonMay 27, 2019
  5. Ævar Arnfjörð BjarmasonMay 28, 2019
  6. Eric WongMay 28, 2019
  7. Todd ZullingerMay 28, 2019
  8. Eric WongMay 28, 2019
  9. Ævar Arnfjörð BjarmasonMay 28, 2019
  10. Todd ZullingerMay 28, 2019
  11. Eric WongMay 28, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.