According to Mark Delany:
> At 11:16 PM Thursday 4/1/99, Miquel van Smoorenburg wrote:
> >The modification time on the tmp/ directory indicates when a new
> >message was last delivered, since that always goes through tmp/.
> >The access time on the new/ directory (set by readdir()) indicates when
> >a mail program last checked the maildir mbox.
> >
> >However, since quite a few existing programs take the scanning approach,
> >they change the access-time on the new/ directory making the above described
> >approach invalid.
>
> But mtime and atime are different right?
Yes, but mail-last-checked is indictated by the atime on the new/ directory,
not the mtime. Mtime is changed at mail delivery (move into new/) or when
mail is moved from new/ to cur/ . The atime is changed only when an application
does a readdir() aka a scan on the directory. That's what a MUA does.
> >Would it be possible to define the method I decribed above as "the"
> >method to check for new mail (for shells, status bars etc) and to also
> >define that programs that actually scan cur/ and new/ should use utime()
> >to reset the access time on those directories after the scan?
>
> Probably better not to have scanners invoking additional I/O if they can
> avoid it (and they may not have +w access).
Well aditional I/O .. if you're doing opendir() readdir() stat() stat()
stat() stat() ....... closedir() anyway, one extra utime() won't hurt.
And a maildir is usually drwx------ anyway, so any program scanning
a maildir supposedly has write access anyway.
> Making it "the" method would be interesting. If you are using your own MDA,
> then it's pretty hard to argue why you don't just touch a .new file or some
> such.
Well it's not too hard to find out when new mail arrived - that's easy,
the mtime on tmp/ reveals that pretty well.
The thing is how do I find out if the mail has been checked / read!
I don't want to modify all possible MUAs. In fact, the MUAs already all
scan new/ for a fact. So taking the atime of new/ is the natural way.
I just want to make sure no additional programs ruin the atime of new/
> And of course for those people who need it with mail-local, a
> | touch .new
> in a .qmail works just fine.
Yes but not for the MUA (Mail User Agent). I want to find out when mail
was last checked, not when it was last delivered.
> Not saying that you haven't a good idea, just that there are ways of
> achieving this already for those people who need it and (speculation) with
> declining direct shell access vs POP/IMAP. adding this requirement certainly
> doesn't fall into the category of everyone needing it.
My aim is to integrate Maildir into standard programs. I've written an
MDA, a POP3 daemon and a smrsh application that can support mbox and
maildir simultaneously so migration of mbox to maildir is painless.
I'm also working with the procmail maildir-patch maintainer to get
proper maildir support into that, and I'm involved in other things like
the Debian/Linux project. I want maildir to become a real standard
on multiple platforms.
> >[If so I could contact the authors of maildir-aware applications to
> > make sure they use that method]
>
> Good idea.
But first I need an answer on the new/atime thing - from djb, I guess
as he would be the final authority on this.
Mike.
--
Indifference will certainly be the downfall of mankind, but who cares?