Date: | Tue, 16 Nov 2004 22:32:04 +0100 |
From: | Karl Gaissmaier <karl.gaissmaier [...] kiz.uni-ulm.de> |
To: | bug-Mail-IMAPClient [...] rt.cpan.org |
Subject: | more Mail::IMAPClient, connect() and 'Socket' problems, small patch supplied |
Hi,
bug or feature, please read on
Versions (doesn't matter:
=========================
mizar$ perl -v
This is perl, v5.8.5 built for sun4-solaris
...
mizar$ perl -MMail::IMAPClient -e 'print "$Mail::IMAPClient::VERSION\n"'
2.2.9
mizar$ uname -a
SunOS mizar 5.9 Generic_112233-11 sun4u sparc
SUNW,UltraSPARC-IIi-cEngine Solaris
Problem description:
====================
When you use SSL sockets, you can't call the connect()
method, since then the socket_handle would be unconditionally
be overridden.
But it would be very useful for me calling your
connect() method, since connect isn't just a connect
on the socket layer it also reads the greeting message
from the imap server in order to start with the login().
If I can't call your connect() I would have to implement
a lot of code already in Mail::IMAPClient to read away
the greeting and handling all special conditions already
done in connect() and _read_lines(), etc.
Please apply the follwoing patch to Version 2.2.9:
--- old/Mail/IMAPClient.pm 2003-07-02 19:28:54.000000000 +0200
+++ new/Mail/IMAPClient.pm 2004-11-16 22:27:07.255240000 +0100
@@ -240,6 +240,7 @@
sub connect {
my $self = shift;
+ unless ( $self->Socket && $self->Socket->connected ) {
$self->Port(143)
if defined ($IO::Socket::INET::VERSION)
and $IO::Socket::INET::VERSION eq '1.25'
@@ -262,10 +263,10 @@
return undef;
}
$self->Socket($sock);
+ $sock->autoflush(1) ;
+ }
$self->State(Connected);
- $sock->autoflush(1) ;
-
my ($code, $output);
$output = "";
Best Regards
Charly
--
Karl Gaissmaier KIZ/Infrastructure, University of Ulm, Germany
Email:karl.gaissmaier@kiz.uni-ulm.de Service Group Network