file locking problem in /var/mail

Dan Drake <[email protected]> Sat, 30 Oct 2004 17:18:21 -0500
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <20041030221821.GA11846@aleph-one>
Hello,

I'm writing a script that searches through my inbox in /var/mail and
moves a message elsewhere, and it's complaining about file locking
problems. The exact error message is

  ERROR: Cannot get a lock on Mail::Box::Mbox folder /var/mail/dan.
  WARNING: Folder does not exist, failed opening mbox folder /var/mail/dan.
  Can't call method "isa" on an undefined value at
  /usr/share/perl5/Mail/Box/Search.pm line 65, <GEN13> line 199.

Everything works fine when I stay inside my home directory, so
it must be the permissions or ownership on /var/mail, which are:

    drwxrwsr-x  2 root mail 1024 2004-10-30 16:50 /var/mail/

My inbox has permissions

    -rw-rw----  1 dan mail 48866 2004-10-30 16:08 /var/mail/dan

I'm using Debian unstable with perl 5.8.4-3 and Mail::Box version
2.055-1. I don't know much about sticky-bitted directories, and turning
off file locking in my script seems unwise. Any suggestions?

Thanks,

Dan

-- 
Ceci n'est pas une .signature.
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBhBMtWvEsgqF+1YQRAsPSAJ0aUYMsK6juI7JNVhhIAOyQtrDXhwCgza1O
zwj0rU7tGUfifhR7yJXUifc=
=K3Tn
-----END PGP SIGNATURE-----