eval { require IO::Socket::Socks } or die <<EOM;
IO::Socket::Socks missing for socks5h://$h:$p
EOM
- # for Mail::IMAPClient
+ # for IO::Socket::Socks
return { ProxyAddr => $h, ProxyPort => $p };
}
die "$val not understood (only socks5h:// is supported)\n";
require IO::Socket::Socks;
my %opt = %$sa;
+ $opt{SocksDebug} = 1 if $mic_arg{Debug};
$opt{ConnectAddr} = delete $mic_arg{Server};
$opt{ConnectPort} = delete $mic_arg{Port};
$mic_arg{Socket} = IO::Socket::Socks->new(%opt) or die
};
$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
my $nn;
if (defined $nn_arg->{ProxyAddr}) {
require PublicInbox::NetNNTPSocks;
+ $nn_arg->{SocksDebug} = 1 if $nn_arg->{Debug};
eval { $nn = PublicInbox::NetNNTPSocks->new_socks(%$nn_arg) };
die "E: <$uri> $@\n" if $@;
} else {