1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#! /bin/sh /usr/share/dpatch/dpatch-run
## 30banner.dpatch by Niko Tyni <ntyni@iki.fi>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix mishandling of IMAP banner (#256836)
## DP: Originally by Jaldhar H. Vyas
@DPATCH@
diff -urNad trunk~/Net/IMAP.pm trunk/Net/IMAP.pm
--- trunk~/Net/IMAP.pm 2006-05-13 20:40:28.000000000 +0300
+++ trunk/Net/IMAP.pm 2006-05-13 20:40:48.565229898 +0300
@@ -233,6 +233,12 @@
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,14 +269,6 @@
} 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;
|