Skip Menu |
 

This queue is for tickets about the Net-IMAP-Simple CPAN distribution.

Report information
The Basics
Id: 91300
Status: resolved
Priority: 0/
Queue: Net-IMAP-Simple

People
Owner: jettero [...] cpan.org
Requestors: ujvari [...] microsec.hu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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>
Download (untitled) / with headers
text/plain 1.1k
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
Download (untitled) / with headers
text/plain 373b
On Tue Dec 10 12:26:18 2013, ujvari@microsec.hu wrote: Show quoted text
> You should change the waserr logic in a way to return 0E0 if there was
Don't suppose you want to fork on github or submit a patch? Otherwise, I'll try to get to it this weekend. -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
Download (untitled) / with headers
text/plain 513b
It's not clear to me that expunge ever produces an error anyway. And I have no way to produce an error that I can test with, so I'm going to leave the behavior probably janky: _process_cmd doesn't seem to detect errors automatically, so if expunge does produce an error this function won't notice. And I think that's ok. (Note: I didn't write this, I'm just the maintainer.) -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.