Re: [HC Evolution] mbox locking



Dan Winship wrote:

From what I've seen of what mail programs do, it seems like the safe
way to read the system mail folder is to always do dot locking, and
also do fcntl locking if the mail spool is on a local filesystem. (And
don't hold one if the other fails, to prevent deadlock.)

Anyone disagree?

I strongly recommend you just use dot-locking, and stay away from fcntl.
Dot-locking works everywhere you care about, so at best, fcntl will be
redundant, and at worst, it will cause a crash or deadlock.  Stay away.

http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/movemail.html

This means we may need to use a setuid movemail program on some
systems. emacs's movemail doesn't support the "we like both kinds"
method of locking... the options would seem to be:

Emacs's movemail is extra crappy.  The code is very hard to read,
because there's lots of legacy in there for systems that nobody has 
used for a decade, and that you surely don't care about.

Netscape has an option to use the built-in movemail, or to use an
external movemail program (e.g., the emacs movemail.)  You should
do this; it's a good idea.

You should just lift the Mozilla code:
    http://lxr.mozilla.org/mozilla/source/cmd/xfe/movemail.c
This is the code that Netscape has been using since version 2.0 --
it hasn't changed.

It's NPLed, but it's only 300 lines, mostly  comments.  Get
Shaver/Brendan to donate it.  Or don't bother -- just read the 
comments and write your own that does exaclty the same thing, 
it's pretty trivial.

I especially don't like #4 since in the process of investigating this
stuff, I discovered that my MH install was only using dot locking and
my sendmail was only using fcntl locking.

This is very surprising -- how did your sendmail end up that way?
Are you sure?  Are you really really sure?

If this is the case, this means that Unix Netscape would run the same
risk of losing mail that MH does, and I have *never* heard a report of
that.  Not once.  So I'm inclined to believe that either: you're wrong
about your sendmail not doing dot-locking; or your sendmail installation
is highly unusual.

-- 
Jamie Zawinski
jwz jwz org             http://www.jwz.org/
jwz dnalounge com       http://www.dnalounge.com/




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