diff options
author | Eric Wong <e@80x24.org> | 2021-09-18 09:33:29 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-18 20:25:30 +0000 |
commit | 74702eff18072dc8bf1c56ffa334b0dc998648b8 (patch) | |
tree | d50ab726acb04992c3428f7c556a4820c9e3ab84 /lib/PublicInbox | |
parent | 0412486a4abac9938bf756e35292d7b01d659ba9 (diff) | |
download | public-inbox-74702eff18072dc8bf1c56ffa334b0dc998648b8.tar.gz |
An Mail::IMAPClient object may be returned even on connection failure, so use IsConnected to check for it. This ensures git-credential will no longer prompt for passwords when there's no connection.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/NetReader.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm index e703cddb..8eff847e 100644 --- a/lib/PublicInbox/NetReader.pm +++ b/lib/PublicInbox/NetReader.pm @@ -108,7 +108,8 @@ sub mic_for ($$$$) { # mic = Mail::IMAPClient }; $mic_arg->{Ssl} = 1 if $uri->scheme eq 'imaps'; require PublicInbox::IMAPClient; - my $mic = mic_new($self, $mic_arg, $sec, $uri) or + my $mic = mic_new($self, $mic_arg, $sec, $uri); + ($mic && $mic->IsConnected) or die "E: <$uri> new: $@".onion_hint($lei, $uri); # default to using STARTTLS if it's available, but allow |