Marcel Logen wrote:
> Thomas Barghahn in de.comm.provider.usenet:
> >
> > Herangezogen wird/wurde RFC 5322 (siehe OP), wobei /ich/ persönlich in
> > jenem RFC nichts von einem *muss* bzgl. CRLF an den "Faltstellen" bei
> > gefalteten Headern lese (Punkt 2.2.3).
>
> Da steht aber
>
> | The general rule is that wherever this specification
> | allows for folding white space (not simply WSP charac-
> | ters), a CRLF may be inserted before any WSP.
>
> Etwas anderes als CRLF kommt demnach nicht in Frage.
>
> CRLF ist ja sowieso als Zeilenende vorgeschrieben,
> insbesodere für die Faltung.
>
> <
https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.2>:
>
> | FWS = ([*WSP CRLF] 1*WSP) / obs-FWS
> | ; Folding white space
Davor steht noch in Kapitel 2.2:
<
https://datatracker.ietf.org/doc/html/rfc5322#section-2.2>
|
| [...] A field body MUST NOT include CR and LF except
| when used in "folding" and "unfolding", as described in section
| 2.2.3. All field bodies MUST conform to the syntax described in
| sections 3 and 4 of this specification.
Faltung mit LF statt CRLF ist demnach beim Versand nicht zulässig.
Kompliziert wird es beim Empfang. Ich arbeite gerade an einem neuen
Header-Parser für flnews, der bessere Fehlertoleranz haben, aber
trotzdem streng konform sein soll. D.h. er soll zulässige Syntax nicht
falsch interpretieren.
Dabei ist zu beachten, dass RFC 5322 vorschreibt, dass ein Parser auch
die in Kapitel 4 definierte "Obsolete Syntax" akzeptieren *muss*:
<
https://datatracker.ietf.org/doc/html/rfc5322#section-4>
|
| []... Though these syntactic
| forms MUST NOT be generated according to the grammar in section 3,
| they MUST be accepted and parsed by a conformant receiver. [...]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Und dort sind ganz wilde Sachen definiert. Beispiel:
<
https://datatracker.ietf.org/doc/html/rfc5322#section-4.1>
|
| [...]
| obs-NO-WS-CTL = %d1-8 / ; US-ASCII control
| %d11 / ; characters that do not
| %d12 / ; include the carriage
| %d14-31 / ; return, line feed, and
| %d127 ; white space characters
| [...]
| obs-utext = %d0 / obs-NO-WS-CTL / VCHAR
| [...]
| obs-unstruct = *((*LF *CR *(obs-utext *LF *CR)) / FWS)
Zusammen mit der Syntax eines unstrukturierten Headerfeldes ergibt sich:
<
https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.5>
|
| unstructured = (*([FWS] VCHAR) *WSP) / obs-unstruct
<
https://datatracker.ietf.org/doc/html/rfc5322#section-3.6.8>
|
| optional-field = field-name ":" unstructured CRLF
Da dürfen einzelne CR-, LF- (und sogar NUL-) Steuerzeichen vorkommen.
In so einem optionalen Headerfeld (wie z.B. X-Face, das meines Wissens
nicht genormt ist, auch nicht für News) ist ein einzelnes LF demnach
zulässiger Inhalt, den ein konformer Parser als solchen verstehen und
ausliefern muss (und nicht im Sinne der Fehlertoleranz als kaputte
Faltung entfernen darf).
Anders sieht das beim Headerfeld "User-Agent" aus:
<
https://datatracker.ietf.org/doc/html/rfc5536#section-3.2.13>
|
| user-agent = "User-Agent:" SP 1*product [CFWS] CRLF
| product = [CFWS] token [ [CFWS] "/" product-version ]
| product-version = [CFWS] token
Für <token> verweist RFC 5536 auf RFC 2045:
<
https://datatracker.ietf.org/doc/html/rfc2045#section-5.1>
|
| token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
| or tspecials>
<token> darf also keine Steuerzeichen enthalten.
Gemäß RFC 5322 Kapitel 4 gilt für CFWS:
<
https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.2>
|
| [...]
| FWS = ([*WSP CRLF] 1*WSP) / obs-FWS
| [...]
| CFWS = (1*([FWS] comment) [FWS]) / FWS
und:
<
https://datatracker.ietf.org/doc/html/rfc5322#section-4.2>
|
| obs-FWS = 1*WSP *(CRLF 1*WSP)
Ein einzelnes LF (außerhalb von <comment>) sollte hier einen
Syntaxfehler darstellen und die Fehlertoleranz dürfte die kaputte
Faltung korrigieren (wenn man das Feld gemäß RFC 5536 und nicht als
optionales Feld gemäß RFC 5322 parst).
Für deinen Testartikel:
<
news:kjihim...@o15.ybtra.de> (Msg-ID: <
kjihim...@o15.ybtra.de>)
zeigt flnews momentan den User-Agent wie folgt an:
|
| Programm: Gecko/20100101? Thunderbird
^
Das LF wird hier nicht als Faltung interpretiert (und entfernt).
[Xpost und Fup2 nach de.comm.software.newsreader gesetzt
Hat mehr mit dem Newsreader als mit dem Provider zu tun]