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

Re: NULL vs. ""

2005-05-30 09:10:28

The discussion reminds me of when I was trying to write gui to say "when
header X is empty" [...] I eventually ended up with:

if not header :regex "Cc" "." // If there is no Cc header that contains
any character

Which felt pretty clumsy for what seems to be a pretty obvious use for
Sieve.

can you expound a little on this obvious use?  I don't see the use case,
myself, and am therefore skeptical to the need for a new reserved word
NULL.

Well the user is trying to say "where there is no information in XXXX headers". They don't care if the the header is absent, or is empty, they just care that it contains no data and want to switch on both in the same manner. So I could imagine script wanting to say:

"If there are no Cc addresses"
"If there is no subject"
"If there is no spam score header"
"If there is no virus score header information"
"If the priority of the message is not specified"

Headers with no value to them sound pretty useless, but of course some headers are required to be there to meet the standards, and a header with no value isn't prohibted by the standards, so a sensible filter really should accommodate them. It feels as though sieve as it stands leaves the user to write a couple of faulty scripts before they finally write their anyof(not exists, is empty) test.

Of course this issue can be abstracted away and solved in the gui, I just thought it was an issue worth bringing up in the context of this NULL/"" discussion, and wondered if it was worth us providing an easier solution for writing these filters.

Nigel

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