#3473: spam tags retrieved from header cache are not updated when spam rules
change
---------------------+------------------------------------------------------
  Reporter:  dgc     |       Owner:  dgc        
      Type:  defect  |      Status:  closed     
  Priority:  minor   |   Milestone:  1.6        
 Component:  mutt    |     Version:  1.5.20     
Resolution:  fixed   |    Keywords:  hcache spam
---------------------+------------------------------------------------------
Changes (by David Champion <dgc@…>):

  * status:  accepted => closed
  * resolution:  => fixed


Comment:

 (In [b01d63af6fea]) Invalidate header caches when spam rules change.
 closes #3473

 User 'exg' on #mutt reported a problem when using header cache with IMAP
 and spam rules.  Spam tags are retrieved from cache and not updated when
 spam rules change.

 1. Enable header caching in muttrc
 2. Set spam rules in muttrc
 3. Use IMAP (or POP or Maildir).  Your spam rules store spam tags into
    your message headers, and these get cached.
 4. Quit mutt
 5. Change your spam rules in muttrc
 6. Relaunch mutt
 7. Because of header caching, the rfc822 headers are not reparsed, and
    spam rules are not reapplied.  User has outdated spam tags.

 Spam rules are applied during rfc822 header parsing because it's the
 only time we get a full and unadulterated view of all headers.  Once
 header parse is done we have only processed headers and 'user headers'
 (X-headers).  We might do spam rule matching against the struct HEADER
 copy of headers, except that:

 a. the header might not be in HEADER if it's non-standard and not an
    X-header;
 b. spam rules are regular expressions matching any arbitrary header
    line, and we would need to map these regexps to the header used to
    create the HEADER fields.  This would change the syntax and behavior
    of spam rules dramatically.

 One solution, perhaps stopgap, is to invalidate the header cache when
 spam rules change.  That's what this patch does.  It alters the hcache
 versioning algorithm so that in addition to using the compiled-in
 checksum of mutt's structures definitions, we also mix in the user's
 runtime spam rules.  Any time spam rules change the hcachever hash value
 changes, causing the hcache to be rewritten.

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

Reply via email to