Simon Burge <[EMAIL PROTECTED]> writes:
> Hi,
> 
> I use procmail and rcvstore to automatically sort my incoming mail, and
> twice in the last month I've had my context file get corrupted overnight
> and all following mail got dropped on the floor.  From my procmail log
> file, I see entries like:
> 
>       rcvstore: eof encountered in field "904"
>       rcvstore: context is poorly formatted
> 
> Luckily I use a procmail rule to keep the last N messages in a backup
> directory and I haven't actually lost any mail yet.
> 
> I've done a bit of searching, and can find references to people saying
> "yes, some files should be locked" but not much more than that.
> 
> Perhaps it's just as simple to ignore the whole file locking issue(s)
> and use rename(2) in context_save() so at least the file won't be
> read while it's being written, or the same file wont be written by
> two processes at the same time.  Busted sequences don't seem to cause
> ``fatal'' problems like a busted context file, but it would probably
> make sense to do the same change to seq_save() if we go down this path.

Sounds promising.

> Is rename() available everywhere?  My favorite "old" reference, Ultrix,
> has it.  I guess it'd be best to autoconf it anyway...

rename() is ANSI C.

-----------------------------------------------------------------------
Dan Harkless                   | To prevent SPAM contamination, please 
[EMAIL PROTECTED]      | do not post this private email address
SpeedGate Communications, Inc. | to the USENET or WWW.  Thank you.     

Reply via email to