From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: how to gracefully handle spaces in Message-IDs?
Date: Tue, 31 Mar 2020 08:32:50 +0000 [thread overview]
Message-ID: <20200331083250.GA27164@dcvr> (raw)
There exist Message-IDs with spaces in them, at least (and
maybe other strangeness)
Take this example:
https://lore.kernel.org/lkml/200203040330.g243URr05337@3%20(NXDOMAIN)%20/
That is:
Message-ID: <200203040330.g243URr05337@3 (NXDOMAIN) >
RFC 3977 (NNTP) struggles with that with HDR/XHDR commands,
since it's split-on-spaces-or-tabs behavior.
Not only that, even with a successful attempt to handle
parsing of spaces in the Message-ID for -nntpd requests,
Net::NNTP has trouble parsing responses with spaces in the
Message-ID. I haven't tried other NNTP clients, but I don't
expect clients to know what to do with invalid Message-IDs
in responses, either...
RFC 5322, Appendix A.6.3. Obsolete White Space and Comments
<https://tools.ietf.org/html/rfc5322#appendix-A.6.3> has
a particularly nasty example:
Message-ID : <1234 @ local(blah) .machine .example>
And RFC 733 is full of examples with spaces in Message-IDs for
the historically-inclined: <https://tools.ietf.org/html/rfc733>
But I haven't found relevant docs on how to handle that case
for NNTP in RFC 977 or 3977...
In innd(*), the nnrpd/article.c::CMDpat function for HDR/XHDR
commands calls lib/messageid.c::IsValidMessageID with the
`stripspaces' parameter as `true', but `stripspaces' only strips
leading and trailing whitespace.
So I'm thinking at least stripping leading+trailing spaces
is something we should be doing, and spaces in the middle
of the Message-ID need to be preserved.
But, maybe non-printable control characters can also be filtered
out entirely, since I've definitely seen those in headers when
they don't belong. I suspect those were introduced by hardware
errors or software bugs.
Anyways, my head hurts :<
(*) svn co https://inn.eyrie.org/svn/trunk innd,
next reply other threads:[~2020-03-31 8:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-31 8:32 Eric Wong [this message]
2020-03-31 8:49 ` [WIP 1/?] v2writable: index Message-IDs w/ spaces properly Eric Wong
2020-04-01 0:05 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200331083250.GA27164@dcvr \
--to=e@yhbt.net \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).