Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 31182
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: Nobody in particular
Requestors: ROBN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.99_07
Fixed in: (no value)



Subject: [PATCH] UID command does not work with folder management commands
The subscribe, delete, myrights, create and close folder management commands are sent with the UID prefix if that option is enabled. This goes against the relevant specs, and breaks against Lotus Domino servers. Attached patch fixes this. Mail-IMAPClient-3.00 perl 5.8.8 Debian lenny/sid Linux 2.6.22
Subject: foldercmd-nouid.patch
diff --git a/lib/Mail/IMAPClient.pm b/lib/Mail/IMAPClient.pm index 4f6493e..0f87b40 100644 --- a/lib/Mail/IMAPClient.pm +++ b/lib/Mail/IMAPClient.pm @@ -1112,6 +1112,14 @@ sub _imap_uid_command $self->_imap_command("$uid$cmd$args"); } +sub _imap_plain_command +{ + my $self = shift; + my $cmd = shift; + my $args = @_ ? join(" ", '', @_) : ''; + $self->_imap_command("$cmd$args"); +} + sub run { my $self = shift; my $string = shift or return undef; @@ -1745,7 +1753,7 @@ sub subscribe { my ($self, @a) = @_; delete $self->{Folders}; $a[-1] = $self->Massage($a[-1]) if @a; - $self->_imap_uid_command(SUBSCRIBE => @a) + $self->_imap_plain_command(SUBSCRIBE => @a) or return undef; wantarray ? $self->History : $self->Results; } @@ -1754,7 +1762,7 @@ sub delete { my ($self, @a) = @_; delete $self->{Folders}; $a[-1] = $self->Massage($a[-1]) if @a; - $self->_imap_uid_command(DELETE => @a) + $self->_imap_plain_command(DELETE => @a) or return undef; wantarray ? $self->History : $self->Results; } @@ -1763,7 +1771,7 @@ sub myrights { my ($self, @a) = @_; delete $self->{Folders}; $a[-1] = $self->Massage($a[-1]) if @a; - $self->_imap_uid_command(MYRIGHTS => @a) + $self->_imap_plain_command(MYRIGHTS => @a) or return undef; wantarray ? $self->History : $self->Results; } @@ -1772,7 +1780,7 @@ sub create { my ($self, @a) = @_; delete $self->{Folders}; $a[0] = $self->Massage($a[0]) if @a; - $self->_imap_uid_command(CREATE => @a) + $self->_imap_plain_command(CREATE => @a) or return undef; wantarray ? $self->History : $self->Results; } @@ -1780,7 +1788,7 @@ sub create sub close { my $self = shift; delete $self->{Folders}; - $self->_imap_uid_command('CLOSE') + $self->_imap_command('CLOSE') or return undef; wantarray ? $self->History : $self->Results; }
Subject: Re: [rt.cpan.org #31182] [PATCH] UID command does not work with folder management commands
Date: Tue, 4 Dec 2007 14:30:41 +0100
To: ROBN via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* ROBN via RT (bug-Mail-IMAPClient@rt.cpan.org) [071204 00:17]: Show quoted text
> > Mon Dec 03 19:17:28 2007: Request 31182 was acted upon. > Transaction: Ticket created by ROBN > Queue: Mail-IMAPClient > Subject: [PATCH] UID command does not work with folder management commands > Broken in: 2.99_07 > Severity: Important > Owner: Nobody > Requestors: ROBN@cpan.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=31182 > > > > The subscribe, delete, myrights, create and close folder management > commands are sent with the UID prefix if that option is enabled. This > goes against the relevant specs, and breaks against Lotus Domino servers.
I do not known why I made this mistake. I am afraid there was an erroneous global replace. I'll have to check each case. Probably need till tomorrow to have time to fix this. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Looking into it, it seems you caught all the cases. Thanks.