Subject: Stripping leading/trailing spaces in relational draft

From: Alexey Melnikov <[email-masked]>
Date: Wed, 21 Sep 2005 16:41:58 +0100

Hi folks,
One of the questions raised during the WGLC of 
draft-ietf-sieve-3431bis-01.txt was concerning the following text in the 
draft:

 >3.1.  Match Type Value
[...]
 >   Leading and trailing white space MUST be removed from the value of
 >   the message for the comparison.  White space is defined as
 >
 >       SP / HTAB / CRLF

I would like to poll people who've implemented the relational draft/RFC 
if they've been following this rule.

Thanks,
Alexey

---

From: "Nigel Swinson" <[email-masked]>
Date: Thu, 22 Sep 2005 14:42:54 +0100

Yeah I think we do.

---

From: Ned Freed <[email-masked]>
Date: Thu, 22 Sep 2005 10:11:12 -0700 (PDT)

> if they've been following this rule.

We handled the leading white space this way but not the trailing in this way.
I've already adjusted things so we follow the rule completely, but this 
isn't in our released product (yet).

				Ned

---

From: "Mark E. Mallett" <[email-masked]>
Date: Thu, 22 Sep 2005 13:26:33 -0400

> if they've been following this rule.

Yes but probably not because of that draft, but because that's what the
associated tests do, relational or not.  As I mentioned, if I had [yet]
implemented the variables draft, I probably would question the
whitespace skipping on the first argument in the "string" test.

Yours,
mm

---

From: Alexey Melnikov <[email-masked]>
Date: Thu, 22 Sep 2005 18:36:41 +0100

Mark E. Mallett wrote:

>As I mentioned, if I had [yet]
Yes, I will get to this once people respond to my poll ;-).

---

From: "Mark E. Mallett" <[email-masked]>
Date: Thu, 22 Sep 2005 13:56:51 -0400

> We handled the leading white space this way but not the trailing in this 

Shoot... having read that, I see that I ignored the "trailing" part in
the question, so I'll have to amend my response.  For 'header' test,
leading spaces are skipped, trailing are not.  I believe that address
tests are coded to work on address parts that have had leading and
trailing spaces removed.

Pardon,
mm

---

From: Kjetil Torgrim Homme <[email-masked]>
Date: Thu, 22 Sep 2005 20:51:11 +0200

> whitespace skipping on the first argument in the "string" test.

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.
-- 
Kjetil T.

---

From: Philip Guenther <[email-masked]>
Date: Thu, 22 Sep 2005 15:02:08 -0700

Alexey Melnikov <[email-masked]> writes:
...
>if they've been following this rule.

Sendmail's sieve implementation has always done so

Philip Guenther

---

From: Alexey Melnikov <[email-masked]>
Date: Fri, 23 Sep 2005 22:44:56 +0100

>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.

---

From: Michael Haardt <[email-masked]>
Date: Mon, 26 Sep 2005 11:44:51 +0200

> trailing spaces, but for other things, like addresses and variables - it 

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

---

From: Alexey Melnikov <[email-masked]>
Date: Tue, 27 Sep 2005 18:31:25 +0100

Alexey Melnikov wrote:

> draft-ietf-sieve-3431bis-01.txt was concerning the following text in 
> the draft:
>
> >3.1.  Match Type Value
> [...]
> I would like to poll people who've implemented the relational 
> draft/RFC if they've been following this rule.

The next question I would like to ask:
 Are people Ok with having this restriction for :address and :string tests?

---

From: Ned Freed <[email-masked]>
Date: Tue, 27 Sep 2005 13:31:16 -0700 (PDT)

>  Are people Ok with having this restriction for :address and :string tests?

I'm in favor of the behavior being consistent across all tests. If it isn't
we now hove to specify this obscure bit of behavior for every future
extension that introduces a test. Not good IMO.

				Ned

---

From: Kjetil Torgrim Homme <[email-masked]>
Date: Wed, 28 Sep 2005 00:23:48 +0200

> extension that introduces a test. Not good IMO.

I agree.
-- 
Kjetil T.