Skip Menu |

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

Report information
The Basics
Id: 130193
Status: open
Priority: 0/
Queue: Mail-Box

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

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



Subject: Mail::Box::MH::readMessages leaves the folder locked
The Mail::Box::MH::readMessages function locks the mailbox, but never unlocks it. The following simple fragment illustrates the bug: use Mail::Box::Manager; my $mgr = Mail::Box::Manager->new(); my $folder = $mgr->open(type => 'mh', folder => $folder) $folder->addMessage($msg) The addMessage call would produce the "Folder already locked" warning. A trivial patch is attached.
Subject: 0001-Mail-Box-MH-readMessages-unlock-the-mailbox.patch
From c7939ba162927ca01b0eb02b8a2e316514063688 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff <gray@gnu.org> Date: Fri, 26 Jul 2019 15:51:31 +0300 Subject: [PATCH] Mail::Box::MH::readMessages: unlock the mailbox * lib/Mail/Box/MH.pm (readMessages): Unlock the mailbox prior to return return. --- lib/Mail/Box/MH.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Mail/Box/MH.pm b/lib/Mail/Box/MH.pm index 41b74a3..2ed3acc 100644 --- a/lib/Mail/Box/MH.pm +++ b/lib/Mail/Box/MH.pm @@ -464,6 +464,7 @@ sub readMessages(@) } $self->{MBM_highest_msgnr} = $msgnrs[-1]; + $locker->unlock; $self; } -- 2.14.5
CC: ;
Subject: Re: [rt.cpan.org #130193] Mail::Box::MH::readMessages leaves the folder locked
Date: Wed, 21 Aug 2019 21:43:39 +0200
To: Sergey Poznyakoff via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Sergey Poznyakoff via RT (bug-Mail-Box@rt.cpan.org) [190726 13:02]: Show quoted text
> Subject: Mail::Box::MH::readMessages leaves the folder locked > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=130193 > > > The Mail::Box::MH::readMessages function locks the mailbox, but never > unlocks it. The following simple fragment illustrates the bug:
You are correct. Still people using MH? I will release the fix when I have collected more changes, after a few month, or whenever you ask me for the new release ;-) -- Thanks, MarkOv ------------------------------------------------------------------------ drs Mark A.C.J. Overmeer MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
RT-Send-CC: Mark [...] Overmeer.net
On Wed Aug 21 16:00:47 2019, Mark@Overmeer.net wrote: Show quoted text
> You are correct. Still people using MH?
Oh, yes, they do :) It's pretty handy. Show quoted text
> I will release the fix when I have collected more changes, after a > few month, or whenever you ask me for the new release ;-)
Sure, take your time. Thanks a lot! Regards, Sergey