On Fri, Jul 17, 2020 at 08:37:50 +0200, Sebastian Stein wrote:
> Kevin J. McCarthy <ke...@8t8.us> [200716 18:18]:
> > If the access time is earlier than the modification time, it notifies for
> > new mail.
> 
> Wow, what a bad algorithm.

It is a super cheap test with zero storage overhead.

> I mean, this was probably perfect 20 years ago,
> but in times of desktop search engines, cloud backup services, etc.
> something more advanced is needed?!

The atime/ctime comparison isn't perfect, but it is a well known algorithm
that's been around for a long time.  One could make the argument that the
desktop search engine is buggy if it messes with the atime of every file it
looks at given what unix file system semantics are.

Finally, I'm not sure most people care.  I think most do not use mbox on a
desktop/laptop, or if they do the use is limited.  (mbox is a horrible
format for any sort of mailbox that sees modifications other than just
appending)

> When I open a folder, I can mark a mail as new. How does mutt keep track of
> this flag? Is this stored inside mbox file?

Yes, a header with this information is stuffed into the corresponding mail
in the mbox.  This may require rewriting the whole mbox file - which is the
big reason mbox is a terrible format :)

> Why not have a sidecar like .L-file1.mutt, where some essential stuff like
> last access time, checksum, etc. are stored?

Because that's extra overhead and well...it isn't mbox anymore.  There are
other mailbox formats that don't use atime/ctime comparison.

Server software like Dovecot maintains index files for each mailbox much
like what you are suggesting.  While some of the functionality is IMAP or
POP3 specific, the index code is generic and quite complex.  I doubt that
anyone will want to spend the effort to implement this client-side.

Mutt could of course have a setting that disables the atime/ctime behavior -
and every time it wants to check it could scan the mailbox to see if
anything appeared.

Ultimately, I think this is really a bug in the desktop search engine you're
using.

Jeff.

Attachment: signature.asc
Description: PGP signature

Reply via email to