<<< Date Index >>>     <<< Thread Index >>>

Re: [Mutt] #3310: Overhaul new mail reporting



#3310: Overhaul new mail reporting
----------------------+-----------------------------------------------------
  Reporter:  brendan  |       Owner:  mutt-dev
      Type:  task     |      Status:  new     
  Priority:  major    |   Milestone:  1.6     
 Component:  mutt     |     Version:          
Resolution:           |    Keywords:          
----------------------+-----------------------------------------------------

Old description:

> Support notification for both new and old mail (configurable) for all
> mailbox types. See NewMailHandling.
>
> There are two separate issues: one is distinguishing between new mail and
> old mail, and the other is being able to tell whether a mailbox has
> changed since it was last opened, without regard to whether the mail in
> it is new or old.
>
> For problem 2 (has the mailbox changed?) I think we'll need a function
> for each mailbox type that returns a type-specific cookie (e.g., for mbox
> timestamp+size, for IMAP UIDVALIDITY+UIDNEXT, for maildir perhaps the
> number of files under new and the name of the most recent under cur).
> None of these should be more expensive to calculate than what the buffy
> check already does.

New description:

 Support notification for both new and old mail (configurable) for all
 mailbox types. See NewMailHandling.

 There are two separate issues: one is distinguishing between new mail and
 old mail, and the other is being able to tell whether a mailbox has
 changed since it was last opened, without regard to whether the mail in it
 is new or old.

 For problem 2 (has the mailbox changed?) I think we'll need a function for
 each mailbox type that returns a type-specific cookie (e.g., for mbox
 timestamp+size, for IMAP UIDVALIDITY+UIDNEXT, for maildir perhaps the
 number of files under new and the name of the most recent under cur). None
 of these should be more expensive to calculate than what the buffy check
 already does.

--

Comment(by pdmef):

 Old mail detection is going to be really really expensive as that implies
 a full parse of the mailbox for mbox/mmdf and fully walking cur/new for
 maildir folders. So because of maildir I guess we do never ever want to
 make old mail detection defaulting to yes.

 For new mail detection, I don't see why need to scan cur/, that'll be
 painfully slow. Whether a maildir/mh folder has changed should be
 determined by looking at the mtime of cur/new or the dir itself. Until
 somebody reports this doesn't reliably work, looking at actual files takes
 way too long. The current buffy check for maildir is very fast as it
 doesn't walk the dir but usually can finish at the first message already
 because it's likely neither old nor trashed nor read. In the average case
 I think this even gives constant time (+ fs time) no matter how many new
 messages there are. I think we should keep it that way.

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/3310#comment:2>
Mutt <http://www.mutt.org/>
The Mutt mail user agent