Subject: ABNF or example error in RFC 5228

From: Magnus Westerlund <[email-masked]>
Date: Wed, 17 Dec 2008 11:33:38 +0100

Hi,

When reviewing the ihave document I stumbled on what I believe to be a
bug in RFC 5228 regarding string list:

2.4.2.1.  String Lists

   When matching patterns, it is frequently convenient to match against
   groups of strings instead of single strings.  For this reason, a list
   of strings is allowed in many tests, implying that if the test is
   true using any one of the strings, then the test is true.

   For instance, the test 'header :contains ["To", "Cc"]
   ["[email-masked]", "[email-masked]"]' is true if either a To
   header or Cc header of the input message contains either of the email
   addresses "[email-masked]" or "[email-masked]".

   Conversely, in any case where a list of strings is appropriate, a
   single string is allowed without being a member of a list: it is
   equivalent to a list with a single member.  This means that the test
   'exists "To"' is equivalent to the test 'exists ["To"]'.

Section 3.2 for example contains the following example:

   Example:  require ["fileinto", "reject"];

However if one looks at the ABNF for string-list it says:

   string-list  = "[" string *("," string) "]" / string
                    ; if there is only a single string, the brackets
                    ; are optional

   string       = quoted-string / multi-line
   quoted-string      = DQUOTE quoted-text DQUOTE
   multi-line         = "text:" *(SP / HTAB) (hash-comment / CRLF)
                        *(multiline-literal / multiline-dotstart)
                        "." CRLF

So it seems that the description, the examples of string lists doesn't
match the ABNF syntax for string lists. If I am correct, I think the WG
needs to address this somehow.

Cheers

Magnus Westerlund

IETF Transport Area Director & TSVWG Chair
----------------------------------------------------------------------
Multimedia Technologies, Ericsson Research EAB/TVM
----------------------------------------------------------------------
Ericsson AB                | Phone  +46 10 7148287
Färögatan 6                | Mobile +46 73 0949079
SE-164 80 Stockholm, Sweden| mailto: [email-masked]
----------------------------------------------------------------------

---

From: Michael Haardt <[email-masked]>
Date: Wed, 17 Dec 2008 11:58:42 +0100

Could you elaborate where exactly the examples fail to be a word of
the grammar?

Michael

---

From: Alexey Melnikov <[email-masked]>
Date: Wed, 17 Dec 2008 10:56:45 +0000

>Hi,
Hi Magnus,

>                        *(multiline-literal / multiline-dotstart)
I am looking at the ABNF and not seeing anything wrong. Maybe I was 
looking for too long at this.
So can you elaborate on what you think is wrong?

---

From: Dave Cridland <[email-masked]>
Date: Wed, 17 Dec 2008 11:18:26 +0000

>                     ; if there is only a single string, the brackets

Are you referring to the "," instead of "," *WSP which is actually  
used?

If so, then yes, there's a minor error, which could be put as an  
erratum.

Dave.
-- 
Dave Cridland - mailto:[email-masked] - xmpp:[email-masked]
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade

---

From: Dave Cridland <[email-masked]>
Date: Wed, 17 Dec 2008 11:30:01 +0000

> If so, then yes, there's a minor error, which could be put as an   

Actually, no, there isn't an error there.

Section 8.2, from which the above ABNF fragment is extracted, begins  
"No whitespace or comments appear below."

Section 8.1 says "[whitespace characters] are ignored except as they  
separate tokens."

So I was talking rubbish, sorry.

Dave.

---

From: Magnus Westerlund <[email-masked]>
Date: Wed, 17 Dec 2008 13:05:27 +0100

Dave Cridland skrev:
>> Are you referring to the "," instead of "," *WSP which is actually  used?
>>
> Section 8.2, from which the above ABNF fragment is extracted, begins "No
> whitespace or comments appear below."
> 

Okay, the whitespacing was exactly what I saw was the problem as I
didn't see that comment. Implicit whitespacing is in my personal opinion
problematic, but that has no impact on the issue I raised. So apparently
no real issue.

Sorry for taking up your time.

Magnus Westerlund