Mail::IMAPClient and Net::SSLeay

J

Josef Moellers

Hi,

I use Mail::IMAPClient version 2.2.9 and perl-Net_SSLeay-1.23-51

I need to combine Mail::IMAPClient and Net::SSLeay to retrieve mail via
imaps. I try
socket (S, &AF_INET, &SOCK_STREAM, 0);
connect (S, $dest_serv_params);
select (S); $| = 1; select (STDOUT);
$ctx = Net::SSLeay::CTX_new();
Net::SSLeay::CTX_set_options($ctx, &Net::SSLeay::OP_ALL);
$ssl = Net::SSLeay::new($ctx);
Net::SSLeay::set_fd($ssl, fileno(S));
Net::SSLeay::connect($ssl);
# Then I need to
$resp = Net::SSLeay::read($ssl);
Net::SSLeay::write($ssl, "A01 LOGIN $imap_user $imap_pass\r\n");
$resp = Net::SSLeay::read($ssl);
$connection = Mail::IMAPClient->new(
# User => $imap_user,
# Password => $imap_pass,
);
$connection->Socket(\*S);
$connection->State($connection->Authenticated);

After that, however, every use of any function in Mail::IMAPClient
fails, e.g.
$connection->select("INBOX");

What am I missing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top