bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

movemail and file locking over NFS


From: Stein A. Strømme
Subject: movemail and file locking over NFS
Date: Thu, 05 Jul 2001 10:59:49 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.103

I apologize for the length of this post, and for possibly repeating
earlier posts, partly in gnu.emacs.gnus.  I wanted to present the
problem as cleanly as possible.

I'm unable to use emacs/movemail to get mail from an NFS-mounted mail
spool directory.  Trying M-x rmail for example, I get the message 

    movemail: No locks available for /net/mail/stromme

This happens under SuSE Linux 7.1, NFS 3.0, and did not occur under
erlier versions of SuSE.  It happens both for the Emacs 20.7 that
comes with the distribution, and for the Emacs 21.103 that I have
compiled myself.  (By the way, /bin/mail has the same problem, with the
message 

    Unable to lock mailbox: No locks available

but other mail software like pine or procmail are doing just fine.)

I'm aware of the following section from /etc/PROBLEMS:

    * rmail gets error getting new mail

    rmail gets new mail from /usr/spool/mail/$USER using a program
    called `movemail'.  This program interlocks with /bin/mail using
    the protocol defined by /bin/mail.

    There are two different protocols in general use.  One of them uses
    the `flock' system call.  The other involves creating a lock file;
    `movemail' must be able to write in /usr/spool/mail in order to do
    this.  You control which one is used by defining, or not defining,
    the macro MAIL_USE_FLOCK in config.h or the m- or s- file it includes.
    IF YOU DON'T USE THE FORM OF INTERLOCKING THAT IS NORMAL ON YOUR
    SYSTEM, YOU CAN LOSE MAIL!

    If your system uses the lock file protocol, and fascist restrictions
    prevent ordinary users from writing the lock files in /usr/spool/mail,
    you may need to make `movemail' setgid to a suitable group such as
    `mail'.  You can use these commands (as root):

            chgrp mail movemail
            chmod 2755 movemail

It so happens that I am under the equivalent of the above "fascist
restrictions".  However, I'm not so sure that this is the whole
story.  I'm able to move my mail to my home directory using procmail,
which seems to handle the file locking problems well.  But even if I
have thus put the mail in a directory with full permissions for
everybody, and certainly for myself, movemail cannot fetch it from
there.  My home directory is also NFS-mounted.  If I manually move the
mailbox to a *local* disk, movemail can get it without any problems, so
it is quite definitely the change in NFS which is behind this.

Kai pointed out to me the comment on locking near the beginning of
movemail.c, and also suggested that compiling procmail might give a
clue as to the type of file locking required.  I posted the results of
that before, but the gist of it is this:

    /* Procmail will lock via: dotlocking */
    #define NOfcntl_lock
    /* autoconf completed */

Now my wish for Emacs is that its configure program be made smart
enough to figure out by itself which file locking options movemail
should be compiled with; if procmail can do it why not Emacs?

In the meantime, is there any way that I can compile movemail so that
it works with "dotlocking"?  I tried the various possiblities for 
MOVE_FLAGS in lib-src/Makefile, with no success so far.

Thanks for any help.  

Stein 
-- 
Stein Arild Strømme  <http://www.mi.uib.no/~stromme>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]