Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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]
[marinersk]: I appear to be unusually dependent on spacial stability. I have had trouble from someone moving an object a mere four inches to the left.
[Eily]: I think the solution is to write posts so brilliant that you gain XP on each refresh, no matter how often :P
[marinersk]: Eily++ and LOL
[marinersk]: I get a lighter version of this disconcertion (new word?) when the n points remaining until rank disappears.
[choroba]: :-D
[marinersk]: I've often marvelled over the past few decades at just how little it takes to mess me up with this spacial dependence thing. I wonder if I'm mildly autistic or something.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-05-29 13:57 GMT
Find Nodes?
    Voting Booth?