Re: [usefor] Trailing whitespace in header fields

Julien ÉLIE <> Mon, 08 August 2016 20:45 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id DFCBF12B02F for <>; Mon, 8 Aug 2016 13:45:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id CAcXpn54TDV3 for <>; Mon, 8 Aug 2016 13:45:40 -0700 (PDT)
Received: from ( []) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id DB9E012B078 for <>; Mon, 8 Aug 2016 13:45:39 -0700 (PDT)
Received: from macbook-pro-de-julien-elie.home ([]) by mwinf5d25 with ME id Ukld1t00417Lgi403kld7u; Mon, 08 Aug 2016 22:45:38 +0200
X-ME-Helo: macbook-pro-de-julien-elie.home
X-ME-Auth: anVsaWVuLmVsaWU0ODdAd2FuYWRvby5mcg==
X-ME-Date: Mon, 08 Aug 2016 22:45:38 +0200
References: <> <>
From: =?UTF-8?Q?Julien_=c3=89LIE?= <>
Organization: TrigoFACILE --
Message-ID: <>
Date: Mon, 8 Aug 2016 22:45:37 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Archived-At: <>
Subject: Re: [usefor] Trailing whitespace in header fields
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "Ongoing discussion of usefor issues." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 08 Aug 2016 20:45:43 -0000

Hi Russ,

>> It means that trailing whitespace SHOULD NOT be present in Netnews
>> header field lines.  (RFC 3977 uses a stricter definition of
>> "unstructured" than RFC 5536!)
>> Is it really a rule to enforce for Netnews articles?  And does someone
>> know why this is not mentioned at all in RFC 5536?
> I'm not sure how much we discussed this at the time, but normally trailing
> whitespace is a SHOULD NOT generate because it tends to get mangled by
> software and is very fragile.  But if that's the only justification (and I
> can't think of another off-hand), it's not the sort of thing for a server
> to enforce, just for a client to not do because it may not survive
> transit.  If the server *can* handle it, it probably should try.

OK, perfectly understood.
Let's just satisfy the "Duties of an Injecting Agent" (per RFC 5537), 
that require amongst other things to check the syntax defined by RFC 
5536.  It therefore does not include any checks about trailing whitespaces.

The general checks for headers are:
- line length (998 octets),
- no white-space-only lines in header field bodies,
- no control chars (except of course \r\n for folding, and \t),
- header name followed by colon+space and header body.

I believe these 4 checks can safely be implemented.
INN (nnrpd) already enforces the first.  It does not enforce the fourth, 
which is tolerated by RFC 5536 ("News agents MAY accept header fields 
that do not contain the required space.")  I believe it is OK to keep 
that tolerance.
However, the second and third checks should be enforced.  One can 
currently inject ^H in header names for instance.

I hope it corresponds to the rules USEFOR had in mind to enforce.

Julien ÉLIE

« Life is short… so eat dessert first! »