Subject: | Bad "waserr" logic in expunge_mailbox() when no message in mailbox |
Date: | Tue, 10 Dec 2013 18:25:44 +0100 |
To: | bug-Net-IMAP-Simple [...] rt.cpan.org |
From: | Újvári Áron <ujvari [...] microsec.hu> |
Dear Net::IMAP::Simple Maintainer!
I've experienced strange behavior with expunge_mailbox() when tried to
call expunge_mailbox() on a mailbox with 0 messages. expunge_mailbox()
returns with undef and waserr() returns 1, but errstr() returns no error
message.
I think the problem is that you set "$self->{_waserr} = 1" at beginning
of the command. The "process" sub deletes the value from
$self->{_waserr}, but it has been never called, since there was no
message to expunge in the mailbox. Finally the "final" sub check for
errors and returns undef in line "return if $self->{_waserr}". There is
no chance to return 0E0 later on line "return "0E0" unless @expunged".
You should change the waserr logic in a way to return 0E0 if there was
no expunged message instead of returning undef and setting waserr to 1.
I am using Net::IMAP::Simple version 1.2203 and Dovecot 2.1.
Best regards,
Aron Ujvari
IT Systems Engineer
Microsec Ltd.
--
Újvári Áron | Email | aron.ujvari@microsec.hu
IT rendszermérnök | Tel | +36 1 802-4425
| Fax | +36 1 505-4445
Microsec zrt. | Web | www.microsec.hu