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

Re: [Mutt] #3473: spam tags retrieved from header cache are not updated when spam rules change



#3473: spam tags retrieved from header cache are not updated when spam rules
change
-------------------------+--------------------------------------------------
 Reporter:  dgc          |       Owner:  dgc     
     Type:  defect       |      Status:  accepted
 Priority:  minor        |   Milestone:  1.6     
Component:  mutt         |     Version:  1.5.20  
 Keywords:  hcache spam  |  
-------------------------+--------------------------------------------------

Comment(by dgc):

 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:2>
Mutt <http://www.mutt.org/>
The Mutt mail user agent