Re: Detecting new mail in mbox format
- To: mutt-users@xxxxxxxx
- Subject: Re: Detecting new mail in mbox format
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Thu, 23 Apr 2009 18:13:38 -0500
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=ZsKwXnfuqBkWgZd/FkAjqRboeho=; b=QxSJ nfpAKVZmQk35TSLMJXAeAcMp5xnwb8d3K5wUaJaG3Se2rtit2LY8B0oseSm8tu9b o4Dx1nZ7T9luaYb9E2yp9S3MU0yCf8FtaV0tYkvUkBaoFRnZ0Tm7Ny8iFjwmDEtA Jok1sSJZSTJqT/MavzXVNuO5sHYTg8bdUEKuti4=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=b11JssaMQAwzwpGK4kMvHkci1AbPlSdMhRM7P3p65snZGrDgPmormM89nJnKzd/mNocSasCeyaZbOcDphitTyhSWwp2tsA5G4aF//Vj06t++I6KbMMJXdAmQjt6w1TM9wBmkvRMZGnWUj3Kax+P0qG6V+se78wCVoj+9yZtwn2o=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:OpenPGP:User-Agent;
- In-reply-to: <20090423221758.GA14205@chris>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- Openpgp: id=CA8E235E; url=http://www.memoryhole.net/~kyle/kyle-pgp.asc; preference=signencrypt
- References: <20090423221758.GA14205@chris>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.19 (2009-04-17)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday, April 23 at 11:17 PM, quoth Chris G:
> I know mutt detects new mail in mbox format by comparing the last
> access time with the modification time of the file. However I can't
> find anywhere that tells me the exact logic.
>
> In particular if the last access time is the *same* as the
> modification time does mutt treat the mailbox as having new mail or
> not?
The logic is defined in buffy.c:
sb.st_mtime > sb.st_atime || (tmp->newly_created && sb.st_ctime ==
sb.st_mtime && st.st_ctime == sb.st_atime)
Essentially, a mailbox is considered to have new mail if either the
modification time is newer than the access time OR it appears to have
been newly created, and the change time is equal to the modification
time and to the access time.
> On my system (Ubuntu 8.10) it seems impossible to create a file with
> an access time before the modification time. One can *add* to an
> exisitng mailbox and set the modification time later than the access
> time but one cannot *create* a new mbox file with access before
> modification.
That makes sense to me...
Of course, personally, I think recording access time (thereby turning
every disk access into a disk write) is a waste of my computer's time,
so I usually mount my filesystems with the "noatime" option. But then,
I also use Maildir instead of mbox, because it avoids lots of this
kind of silliness (it's also a more well-defined mailbox format).
~Kyle
- --
Holding on to anger, resentment and hurt only gives you tense muscles,
a headache and a sore jaw from clenching your teeth. Forgiveness gives
you back the laughter and the lightness in your life.
-- Joan Lunden
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iEYEARECAAYFAknw9iIACgkQBkIOoMqOI17Q1QCgj5jXNPycnHsVG6FELP+ZKPqG
eiwAoMZp1HDiizfTfoqtJilP+RXcrn5e
=5WlN
-----END PGP SIGNATURE-----