Subject: | Net::IMAP greeting bug |
Hi Kevin,
I try to connect to Samsung Contact IMAP server 8.0.3 with Net::IMAP witch
wont work for me. Sub _get_banner seeks for IMAP4rev1 in the greeting
and will not find some in the response of Samsung Contact.
The hole rfc2060 say that a greeting may response with OK or PREAUTH. Second
must contain IMAPrev1, first has not. The following little patch mey help
you to fix the problem. It just checks after calling _get_banner and getting
capabilities if the last one has IMAP4rev1.
NetxAP-0.02
This is perl, v5.8.2 built for i386-linux-thread-multi
Debian GNU Linux/unstable
Show quoted text
--------------------------- schnipp --------------------------------
--- NetxAP-0.02/Net/IMAP.pm 1999-10-03 16:56:21.000000000 +0200
+++ NetxAP-0.02-dex/Net/IMAP.pm 2004-01-14 12:23:32.000000000 +0100
@@ -232,6 +232,12 @@
$! = 5; # *sigh* error reporting needs to be improved
return undef;
}
+
+ unless ($self->has_capability("IMAP4rev1")){
+ carp "server does not support IMAP4rev1";
+ $self->close_connection or carp "error closing connection: $!";
+ return undef;
+ }
return $self;
}
@@ -263,15 +269,7 @@
} elsif (($list->[0] ne '*') || ($list->[1] !~ /^ok$/i)) {
return undef;
}
- my $supports_imap4rev1 = 0;
- for my $item (@{$list}) {
- $supports_imap4rev1++ if ($item =~ /^imap4rev1$/i);
- }
- unless ($supports_imap4rev1) {
- $self->close_connection;
- return undef;
- }
-
+
$self->{Banner} = $list;
return 1;
--------------------------- schnapp --------------------------------
have a nice day
Wenzel Peppmeyer