procmail
[Top] [All Lists]

Re: sync References with In-Reply-To

2006-02-10 03:55:59
Ian Zimmerman schreef:

BTW I tried this; it didn't work (it always run the filter, even if
the parent Message-ID was present in References).  Care to explain
why?

The MATCH would always start with whitespace, because the ' *' will
match nothing (because the \/ is greedy). Further it can remove
perfectly well Refererences header fields.

Some other cases in which it would or could fail:
1. when tabs are used for whitespace
2. when IRT ends in whitespace
3. when IRT contains 2 or more Message-IDs

The unanchored condition on the References is actually safer than mine,
because mine can result in a circular loop inside the References: when
the IRT-Message-ID is found in a different position than the last one.
That doesn't occur often, but is sometimes used to nag.

  SPC = ' '
  TAB = '    '  # literal tab, so 1 character
  WS  = "$SPC$TAB"

  :0
  *   ^In-Reply-To:.*\/<.+>

  * ! ^References:.*$\MATCH
  * ! MATCH ?? @.*@
  * ! MATCH ?? ()<.*<
  {
    H_IRT = $MATCH
    :0 fh
    * ^References:.*\/<.+>
    | formail -i"References: $MATCH $H_IRT"
    :0E fh
    | formail -i"References: $H_IRT"
  }

(untested)

-- 
Grtz, Ruud


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>