Mail::Transport::IMAP4 bug
Raul Dias <[email protected]> Wed, 25 May 2005 01:41:22 -0300
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <[email protected]> |
Hi,
It is strange how this has pass by, unless I am missing something here.
When a Mail::Box::IMAP4 is created, the Mail::Transport::IMAP4
calls authentication() during init() with the authentication form
choosen (or AUTO).
Later on login() also calls authentication() to get the authentication
form without paramenters this time.
When called for the second time authentication() is supposed to returs
the array with the preferred authentication forms in order.
The problem is that this has not being saved in the first call,
because it returns undef because of a imapClient() call.
The solution is to place the first authentication() call after
the imapClient has being saved.
There is no way this would work for me without this change, so I might
be missing something.
The patch is below.
BTW, I spoted a bug in Mail::IMAPClient when doing a CRAM-MD5
authentication against a Cyrus-Imapd server without authentication
mechanism (other than PLAIN). In this case Mail::IMAPClient will hang
forever.
I have mailed the Mail::IMAPClient author, but I suggest that when
authenticate is 'AUTO' it should try plain 'PLAIN' before 'CRAM-MD5'.
The last thing I noticed is when authenticating with wrong credentials,
Mail::Transport::IMAP4 will loop forever in login, because 'retries' by
default is -1 which means forever.
[]'s
Raul Dias
===========================8<======================================
diff -Nru Mail-Box-2.060/lib/Mail/Transport/IMAP4.pm
Mail-Box-2.060_rsd/lib/Mail/Transport/IMAP4.pm
--- Mail-Box-2.060/lib/Mail/Transport/IMAP4.pm 2005-03-15
18:02:43.000000000 -0300
+++ Mail-Box-2.060_rsd/lib/Mail/Transport/IMAP4.pm 2005-05-25
00:52:28.104183873 -0300
@@ -29,7 +29,6 @@
$self->SUPER::init($args) or return;
- $self->authentication($args->{authenticate} || 'AUTO');
$self->{MTI_domain} = $args->{domain};
unless(ref $imap)
@@ -37,6 +36,7 @@
}
$self->imapClient($imap) or return undef;
+ $self->authentication($args->{authenticate} || 'AUTO');
$self->login or return undef;
}
------------------------------>8-----------------------------------