Re: [Exim] MBX, UW imapd & vanishing messages

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Mark Rigby-Jones
CC: exim-users
Subject: Re: [Exim] MBX, UW imapd & vanishing messages
On Thu, 25 Jul 2002, Mark Rigby-Jones wrote:

> Poking around the exim & c-client revealed that Exim was locking using
> fcntl(), whilst UW imapd was using flock(). On linux (certainly 2.2.x),
> these are entirely independant, so I hacked exim to do mbx locking using
> flock and retested.


The whole area of locking in Unix and Unix-like systems is a mess. I
used fcntl() because it's supposed to be compatible with lockf(), and
also because it's supposed to work over NFS, whereas flock() doesn't.
On some OS (e.g. Solaris), flock() is actually implemented by calling
lockf(), and I see on the FreeBSD man page that "flock, lockf, and fcntl
locks may safely be used concurrently", though it isn't clear what that
actually means. However, on Linux, they seem to be different.

When I started on Exim, I got the impression that flock() was
obsolescent, but I subsequently learned that some people have strong
views about all of this, which is, I believe, why flock() is used in
c-client.

> Has anyone else seen (or can reproduce) this behaviour? Anyone have any
> tips on how to get more reliable delivery into MBX mailboxes?


The big question is: are you using NFS?

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.