ietf-mta-filters
[Top] [All Lists]

Re: Three new drafts and a question

2003-04-30 02:56:37

[Marc Mutz]:

  On Wednesday 30 April 2003 01:07, Kjetil Torgrim Homme wrote:
  > I know you wanted a failed match to not influence the numeric
  > variables, Ned, it seems like you were right.
  
  Well, _obviously_ this particular problem stems from
  unconditionally executing deleteheader+addheader. The correct way
  to do this would be:
  
  if header :matches "Subject" "[ietf] *" {
      deleteheader "Subject";
      addheader "Subject" "${1}";
  }

it is always possible to add code to avoid the problem, e.g.,

   set "oldsubj" "${1}"

the question is which behaviour is more convenient.  my previous
example omitted the classifying test, it could look like this:

   if header :contains "List-ID" "ietf" {
      deleteheader :matches "Subject" "[ietf] *";
      deleteheader :matches "Subject" "Re: [ietf] *";
      addheader "Subject" "${1}";
   }

another test inside the block is a bit more verbose, but it may be
clearer code.
-- 
Kjetil T.