Re: [PATCH] send-email: remove documented requirement for Net::SMTP::SSL
- From
Todd Zullinger <tmz@pobox.com>
- Date
- May 28, 2019, 01:56 UTC
- Message-ID
- <20190528015621.GZ3654@pobox.com>
- In-Reply-To
- <87h89fmjzc.fsf@evledraar.gmail.com>
Hi,
Sorry I missed your earlier reply which also mentioned using $obj->can() Ævar. That's what I get for typing a reply and then walking away for a few hours before hitting send. ;)
Ævar Arnfjörð Bjarmason wrote:
Show 15 quoted lines
> 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')) {
> I think we'd need to use 'if ! ...' there, or more likely, switch the blocks which follow because the code following 'if ($use_net_smtp_ssl)' is for Net::SMTP::SSL with the 'else' block handling the case where Net::SMTP has ssl/tls support. Right?
I know I read the $use_net_smtp_ssl bit backwards the first time or two as well.
-- Todd