Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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.

Comment on Re: Mail::IMAPClient->new hangs in Windows
Download Code
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-11-28 01:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (736 votes), past polls