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

Re: Stripping leading/trailing spaces in relational draft

2005-09-26 02:56:48

On Fri, Sep 23, 2005 at 10:44:56PM +0100, Alexey Melnikov wrote:
well, this stripping only happens for relational tests, not ":is" and
friends.  although it's a trap for the unwary, it's not a big problem,
IMO.  you can work around it when needed by using explicit begin and end
markers in both strings:

      if string :gt "!${var1}!" "!${var2}!" ...

an example of this technique may be useful.


This would work but it is a hack!
I would rather say that for headers, relational strips leading and 
trailing spaces, but for other things, like addresses and variables - it 
does not.

If you go as far as breaking backward compatibility, then I suggest to let
"i;ascii-numeric" ignore heading and trailing white space when used with
the relational extension, and Sieve base comparators like "en;ascii-case"
obey it.  Numbers are numbers and strings are strings, and the latter may
contain white space and string comparisons in general do not ignore it.

The obvious solution would be to add an option :full to keep all white
space and to strip it otherwise, as done before.  I am not sure it's
worth it, though.  The next person may suggest two options for heading
and trailing white space and the third will suggest string functions,
and that's probably the most universal solution, but a whole different
thing than the relational extension.

Michael