procmail
[Top] [All Lists]

Re: Missing F in From seperator

1996-07-31 13:35:21
Excerpts from mail: (28-Jul-96) Missing F in From seperator by Samuel Druker
I use VM under emacs (that means movemail) to read mail. I
occasionally get just a single 'F' in my crashbox, with the rest of
the message (starting with 'rom xxx') in my spool file. Generally I
fix this by clearing my crashbox and adding the F back to the start
of the spool file, but I'd be happier if I could figure out how to
prevent it in the first place.

I had the same problem when I started to read my e-mail with Emacs. I'm
guessing that you will need to recompile `movemail' with a couple of minor
modifications to its #defines in order for it to use and recognize ".lock"
files instead of using the default kernel locking methods.

Here's how to test to see if your movemail works correctly with .lock files
or not: (Do this in the directory where you keep your mail files before VM
reads them.)

% echo "Testing." > foo
% lockfile foo.lock
% ls -l
total 2
-rw-r--r--  1 sabol           9 Aug 30 14:28 foo
-r--r--r--  1 sabol           1 Aug 30 14:29 foo.lock
% /usr/local/libexec/emacs/19.31/sparc-sun-sunos4.1.3/movemail foo bar

OK, after you do that, if the directory listing looks like this:

% ls -l
total 1
-rw-r--r--  1 sabol           9 Aug 30 14:35 bar
-rw-r--r--  1 sabol           0 Aug 30 14:35 foo

... then that means movemail just ignored lockfile's .lock semaphore file!
This means movemail was compiled to use either lockf() or flock(). If your
home directory or mail spool directory is NFS-mounted, you should reconfigure
and recompile movemail to use .lock files instead. This is the way it is
supposed to work:

% ls -l
total 2
-rw-r--r--  1 sabol           9 Aug 30 14:35 foo
-r--r--r--  1 sabol           1 Aug 30 14:39 foo.lock
% ~/bin/movemail foo bar &
[1] 187
% ls -l
total 2
-rw-r--r--  1 sabol           9 Aug 30 14:41 foo
-r--r--r--  1 sabol           1 Aug 30 14:41 foo.lock
% rm -f foo.lock 
% [1]    Done                   ~/bin/movemail foo bar
ls -l
total 1
-rw-r--r--  1 sabol           9 Aug 30 14:41 bar
-rw-r--r--  1 sabol           0 Aug 30 14:41 foo

Perhaps the most reliable method is to create a wrapper script around a
movemail configured to use either lockf() or flock(). The wrapper script
would recognize and create .lock semaphore files using procmail's 'lockfile'.
This would give you the best of both worlds and be the most reliable. I
actually did this for a while, but it really slows down fetching new mail.
I finally got fed up with it and asked my system administrators for the
movemail source code and compiled my own version that uses .lock files. If
you can get your hands on the source code to movemail, just add these two
lines up near the top after all the #includes and before the "#ifdef
MAIL_USE_LOCKF":

#undef MAIL_USE_LOCKF
#undef MAIL_USE_FLOCK

Once you've recompiled the `movemail' source code and confirmed that the
above test works, you'll need to set some VM variable to tell VM that you
want to use this alternative `movemail' instead of the one that comes with
Emacs. For RMAIL, this variable is `rmail-movemail-program'. Gnus has a
similarly named variable. I don't know what it is in VM, but I'm sure you can
find it.

(A tip of the hat to Samuel Tardieu <sam(_at_)inf(_dot_)enst(_dot_)fr> who 
explained all of
this to me when I was a procmail newbie over a year ago.)

Good luck,
Ed

<Prev in Thread] Current Thread [Next in Thread>