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

Re: Stripping leading/trailing spaces in relational draft

2005-10-12 15:45:11

On Wed, Oct 12, 2005 at 12:55:17PM +0200, Michael Haardt wrote:

I strongly disagree to always stripping white space.  To me, it is
intuitive to strip leading (not trailing) white space for header tests,
and no white space at all for address or envelope tests.

I am mostly in agreement there.  In header tests, my implementation only
strips leading spaces, but only because that is what I believed a script
writer would expect (and, as I mentioned before, is the only way some of
the examples could work).  I could probably get on board with stripping
trailing spaces from header tests for consistency's sake, but do not do
it at present.

Unfortunately I can envision a situation where a script writer might want
to test for sequences of leading and, particularly, trailing spaces.
But you can't really have it both ways without adding some kind of other
options.

As for address elements, I believe I am stripping whitespace only if the
address is not in anglebrackets, but if anglebrackets are present, am
taking the interior as the literal string.  Kjetil's comments about
address canonicalization for the tests are interesting though; I had
thought of the address test as a string comparison against the character
strings found in the message header, not as a semantic test (i.e. against
what the address means).  But that interpretation has a lot of appeal
and I am at the moment inclined to change.



If white space
is stripped on the left side (message value), it should be stripped on the
right side (literal) the same way, but that is an independent issue.

I agree with the last part, but not the first :-)  I think that the
space-stripping conversation should be focused on the test inputs that
the script writer doesn't explicitly control, i.e. to the inputs that
are supplied by the implementation "from the message."  If the script writer
supplies a literal with spaces in it, and it doesn't make sense, well
that's a script bug.  The script writer has the ability to repair that
mistake.


And I would love to keep this out of the relational extension, if I had
a choice.

Agreed.


The base specification indeed does not say anything on this, which means
implementations might differ depending on how the underlying systems
handles stuff.  Not good [tm].  What do

  header "subject" "abc"
  header "subject" " abc"

yield with different implementations on matching

  Subject:abc
  Subject: abc
  Subject:  abc

? My implementation evaluates the first test to be true, and the second
to false for all subjects.

Ditto.  But your description of your implementation seems to contradict
your belief (quoted above) that spaces should be stripped from literal
strings if they have been stripped from another input to the test.
Do I misunderstand?

Yours,
-mm-  (way behind on everything, still)