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

Re: FETCH on save



On Sunday, February  5 at 08:41 AM, quoth Nicolas Rachinsky:
* Kyle Wheeler <kyle-mutt-dev@xxxxxxxxxxxxxx> [2006-02-05 00:51 -0500]:
   save-hook "~h 'X-Spam-Status: Yes'" =Spam

If I comment-out that hook, mutt doesn't do the FETCH and saving a message is much faster (especially for large messages). I would think

This would match a header X-Foo-X-Spam...., too. I think '=' instead of
'~' could possibly help.

                           You can force mutt to treat EXPR as a simple
  string instead of a regular expression by using = instead of ~ in the
  pattern name. For example, =b *.* will find all messages that contain
  the literal string '*.*'. Simple string matches are less powerful than
  regular expressions but can be considerably faster. This is especially
  true for IMAP folders, because string matches can be performed on the
  server instead of by fetching every message. IMAP treats =h specially:
  it must be of the form "header: substring" and will not partially
  match header names. The substring part may be omitted if you simply
  wish to find messages containing a particular header without regard to
  its value.

For some reason this doesn’t work for me. If I add

   save-hook "=h 'X-Spam-Status: Yes'" =Spam

to my muttrc instead of the previous hook, it doesn’t trigger on messages that I *know* have X-Spam-Status: Yes in their headers (and that matched and triggered the hook when the = was a ~).

~Kyle
--
If you are going through hell, keep going.
                                                   -- Winston Churchill

Attachment: pgpNMA0IxQg3y.pgp
Description: PGP signature