Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Mail::IMAPClient->new hangs in Windows

by Khen1950fx (Canon)
on Mar 25, 2013 at 22:13 UTC ( #1025404=note: print w/replies, xml ) Need Help??

in reply to Mail::IMAPClient->new hangs in Windows

For Windows, try SSLv2; also, SSL_verify_none is the default, so why write it longhand?
#!/usr/bin/perl use strict; use warnings; use IO::Socket::SSL; use Mail::IMAPClient; my $client = Mail::IMAPClient->new( Server => '', Port => 993, Ssl => 1, User => 'whateverUser', Password => 'aG00dP455w0rd', Socket => IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '', PeerPort => '993', SSL_version => 'SSLv3', SSL_verify_mode => 0), ); die $! unless print "Connected\n";
Updated: Fixed typo.

Replies are listed 'Best First'.
Re^2: Mail::IMAPClient->new hangs in Windows
by m0skit0 (Initiate) on Mar 26, 2013 at 19:22 UTC
    Thanks for the reply. I already solved this.
    sub connectGMail { my $socket = IO::Socket::SSL->new( PeerAddr => '', PeerPort => 993, SSL_verify_mode => SSL_VERIFY_NONE ) or die "socket(): $@"; my $client = Mail::IMAPClient->new ( User => 'whateverUser', Password => 'aG00dP455w0rd', Ssl => 1, Socket => $socket ) or die "Cannot connect ($@)\n"; return $client; }
    And yes, I have to explicitly specify the verify mode, otherwise it spits a warning message.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025404]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2018-06-20 21:48 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.