[Top] [All Lists]

Re: 'header' test and whitespace

2005-11-29 10:47:47

On Tue, Nov 29, 2005 at 12:28:57PM +0100, Kjetil Torgrim Homme wrote:

also in the latest draft is this:

   The preferred way to test whether a given header is either empty or
   absent is to combine an "exists" test and a "header" test:

           anyof (header :is "Cc" "", not exists "Cc")

this will evaluate to true for:

  Cc: someone(_at_)example(_dot_)org

it may not be worth considering this rather degenerate case.  it seems
to me Bcc is a more likely candidate for the stated test.  however, one
way of stating the test correctly is:

  not (header :matches "Cc" "?*")

it's not much more convoluted, so I think it is worthwhile to change the
"preferred way".

Parentheses aside... in my implementation at least, the "header" test
would return true (because of the non-empty 'cc'), and be notted to
return false.  So this wouldn't work.  In order for it to work, the
interior 'header' test would have to be influenced by the 'not' somehow,
so that it rearranged the logic to be:

   header :not :matches "Cc" "?*"

which would depend on how it treated the lack of a header field at all.

But I think you could say

   not allof (exists "cc", header :matches "cc" "?*")


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