Hi,

On 12/31/03 01:52:11 -0800 Mark Crispin <[EMAIL PROTECTED]> wrote:
On Wed, 31 Dec 2003, Christian Kratzer wrote:
A frequently used solution will be to use an index file or a header in
the message store to mark messages as expunged and only rewrite the
mailbox when an exclusive lock on it has been obtained.

Correct.


With a maildirs like message store you could actually delete the
messages on expunge but you would only rewrite your index file
to reflect new sequence numbers when you get an exclusive lock
on it.

Alternatively, have a share count in the index file along with an "expunged" flag. As each process that has the mailbox selected notes the message as being expunged, decrement the share count. When the share count reaches zero, it is then safe to delete the message.

The update on the index file to clean up the zero-share-count expunged
message can be deferred until some process gets an exclusive lock on it.

of course there is no black magic that will extend the locking free aspects of maildirs to mailbox metadata or sequence of messages.

Courier seems to use some hacks with symlinks in an attempt to get locking
free keywords but I do not know of any locking free hack to get sequence
numbers for maildirs.

All maildirs imap implementations use an index file of some sort to
maintain sequence of messages.  This all translates to a variation on the
no free lunch theme and that imap is a database and you cannot cheat with
a large nfs toaster and maildirs ;-)

Greetings
Christian

--
Christian Kratzer                       [EMAIL PROTECTED]
CK Software GmbH                        http://www.cksoft.de/
Phone: +49 7452 889 135                 Fax: +49 7452 889 136



Reply via email to