#3475: New mail not detected in current maildir folder
--------------------+-------------------------------------------------------
 Reporter:  vinc17  |       Owner:  me      
     Type:  defect  |      Status:  accepted
 Priority:  major   |   Milestone:          
Component:  mutt    |     Version:          
 Keywords:          |  
--------------------+-------------------------------------------------------
Changes (by me):

  * owner:  mutt-dev => me
  * status:  new => accepted


Old description:

> In the current folder, several minutes after new mail has arrived:
> {{{
> ---Mutt: =Maildir [Msg:954 New:468 Inc:12
> 128M]---(threads)---------------(end)-
> }}}
> Moving the cursor has no effect on the folder (the new message is still
> missing from the index).
>
> If I open the same folder in another Mutt instance:
> {{{
> ---Mutt: =Maildir [Msg:955 New:469 Inc:12
> 128M]---(threads)---------------(end)-
> }}}
>
> This is the first time I notice such a problem (but this doesn't mean
> that it hasn't occurred before).

New description:

 In the current folder, several minutes after new mail has arrived:
 {{{
 ---Mutt: =Maildir [Msg:954 New:468 Inc:12
 128M]---(threads)---------------(end)-
 }}}
 Moving the cursor has no effect on the folder (the new message is still
 missing from the index).

 If I open the same folder in another Mutt instance:
 {{{
 ---Mutt: =Maildir [Msg:955 New:469 Inc:12
 128M]---(threads)---------------(end)-
 }}}

 This is the first time I notice such a problem (but this doesn't mean that
 it hasn't occurred before).

--

Comment:

 mh_sync_mailbox() calls maildir_update_mtime() after changes are written
 out.  So you are correct that if a new mail arrives during this time, it
 will not be noticed.  Presumably, the mtime is updated to avoid needing to
 rescan the mailbox after a sync.

 In the normal case new mail gets delivered to into the new subdir, but
 mail could also arrive via a save from another client (probably unlikely
 since the user would have to simultaneously sync one client, and save in
 another).

 So perhaps we want to just rescan the new subdir once after each sync.

 ctx->mtime is the mtime for the new subdirectory.  A quick grep tells me
 this is not consulted by any other code that this mailbox driver.  So
 maybe instead of the rescan flag you suggest, it would be sufficient to
 NOT update ctx->mtime (but DO update data->mtime, which is the cur
 subdir).  This would cause mh_check_mailbox() to rescan the new subdir on
 its next pass.

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

Reply via email to