Bug#321085: (Mail::Box lock file sometimes put in current working dir with lockmethod multi)

Rainer Schöpf rainer.schoepf at proteosys.com
Sat Aug 27 08:10:00 UTC 2005

On Fri, 26 Aug 2005, Gunnar Wolf wrote:

 > But if I am working on a mbox folder, I get no error messages. Now, as
 > explained in the Mail::Box::Maildir man page, maildir does not provide
 > any locking mechanisms:
 >         lock_file          L<Mail::Box>     <not used>
 >         lock_timeout       L<Mail::Box>     <not used>
 >         lock_type          L<Mail::Box>     C<'NONE'> (constant)
 >         lock_wait          L<Mail::Box>     <not used>
 >         locker             L<Mail::Box>     undef

I append a more complete example, that exhibits the bug. Note that I was
not talking about maildir.

The point is that the bug is triggered when the working directory is
changed between opening and closing the mail folder:
 a) an error message is issued at folder->close
 b) the lock file is left
 c) when I run the script a second time it hangs since the lock file is
    still there (which is arguably another bug, by the way)

  Rainer Schöpf


use Mail::Box::Manager;

$dir = "/tmp";

$filename = "/var/spool/mail/rainer";

my $mgr    = Mail::Box::Manager->new;
my $folder = $mgr->open(folder => $filename,
                        access => "rw",
                        lock_file => "mylock",
                        lock_type => "Multi");

chdir $dir;



More information about the pkg-perl-maintainers mailing list