[Alpine-info] Mail spool status update on reading

Mark Crispin markrcrispin at panda.com
Mon Jan 19 11:34:37 PST 2009


On Mon, 19 Jan 2009, Jeremy Sanders wrote:

> I see alpine appears to write the "Status: O" immediately after the mail box

> is opened, so it doesn't seem that expensive.


Open itself does not do a checkpoint; however Alpine's open procedure does
a new mail test which does checkpoint upon seeing new mail.

A checkpoint does ALL updates at once. So if you have 100 new messages,
all 100 updates are done in a single, atomic operation.

Users generally don't complain if it takes a few seconds for a mailbox to
open. They are more likely to complain if it takes a few seconds to read
a message, or delete a message -- which would be the impact of real-time
update to a traditional UNIX mailbox file.


> It might be nice to have the 10

> minute update configurable, if it isn't already.


You have the source code.


> So doesn't Alpine write the "Status: O" when it sees a message? It doesn't

> appear in my spool fine until I start alpine with a new message.


Alpine does NOT write the "Status: O" when it sees a message. It ONLY
does so at a checkpoint.


> It could put the space there and optimise the update to OR if it hasn't been

> removed. Dovecot does this optimisation:

> http://wiki.dovecot.org/MailboxFormat/mbox


Which works only as long as you don't run certain other tools. It is very
easy to make decisions you arbitrarily assume that nobody will ever do the
things which cause bad consequences from your clever ideas.

I spent a great deal of effort nearly 20 years ago on this very issue.

Dovecot is not designed to share its mail store with timesharing, NFS,
Samba, etc. access. Dovecot does many clever things because it makes
simplifying assumptions that Alpine (and, for that matter, UW IMAP) was
never allowed to make.


>> If you really care about such things, you should use a better mailbox

>> format. Traditional UNIX format has been obsolete for decades.

> Obsolete in design, not in usage! I'm just trying to write a generally useful

> mail counter.


Use IMAP and/or the c-client library.

A program that does local file access to one obsolete format is not
generally useful.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.


More information about the Alpine-info mailing list