🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #86727

Re: How are supersedes and Message-ID being handled now?

#86727
From: Michael Baeuerle
Date: Mon, 04 May 2015 12:34
125 lines
7354 bytes
Joshua Cranmer 🐧 wrote:
> On 5/3/2015 12:51 PM, Michael Baeuerle wrote:
> > 
> > I agree with you that current MIME format is ugly, but UTF-8 will not be
> > a simple drop-in replacement for US-ASCII. Since several years there is
> > this recommendation in RFC5198 ("Unicode Format for Network
> > Interchange"):
> > |
> > | Before transmission, all character sequences SHOULD be normalized
> > | according to Unicode normalization form "NFC" (see Section 3)
> > 
> > But nobody cares and most newsreaders simply ignore this completely
> > (do no normalization at all and fail to compare and match Unicode
> > strings correctly).
> 
> So, there's a funny thing about normalization. Only one person has to 
> do the normalization, but no one wants to be that person.

And it doesn't work if it is not done by the first instance (before
injection). Therefore everybody need to be "that person". I will try
to explain why ...

> In truth, 
> nearly all strings with non-ASCII characters tend to be ultimately 
> started by someone typing them on a keyboard. As long as IMEs generate 
> only NFC-normalized strings, you can generally ignore NFC and no one 
> will notice or care.

But that is not the case. Text is not only typed, but also copied via
cut and paste from unknown sources or filled in automatically by click
on something. Remember that Unicode has not only 2 canonical
normalization forms, but also allow arbitrary order of codepoints with
nonzero and different character combining class. Arbitrary levels of
composition are also valid.

Some time ago I have created a small test program to demonstrate this
for Unicode filenames (but the same can happen for every data that is
used as name/identifier):
------------------------------------------------------------------------
$ cat uc_test.c 
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>

int  main(void)
{
   int  rv;
   const char*  file1 = "\xC3\xA4\x62\xC3\xA4";
   const char*  file2 = "\x61\xCC\x88\x62\xC3\xA4";
   const char*  file3 = "\xC3\xA4\x62\x61\xCC\x88";
   const char*  file4 = "\x61\xCC\x88\x62\x61\xCC\x88";

   rv = creat(file1, S_IRWXU);  if(-1 == rv)  { exit(1); }
   rv = creat(file2, S_IRWXU);  if(-1 == rv)  { exit(1); }
   rv = creat(file3, S_IRWXU);  if(-1 == rv)  { exit(1); }
   rv = creat(file4, S_IRWXU);  if(-1 == rv)  { exit(1); }

   exit(0);
}
------------------------------------------------------------------------
This program creates 4 files in the current directory that all have the
same name (in the sense of Unicode). On GNU/Linux the result looks like
this with an Unicode locale:
------------------------------------------------------------------------
$ ls -l
insgesamt 96
-rwx------ 1 baeuerle users     0 Mai  4 12:26 äbä
-rwx------ 1 baeuerle users     0 Mai  4 12:26 äbä
-rwx------ 1 baeuerle users     0 Mai  4 12:26 äbä
-rwx------ 1 baeuerle users     0 Mai  4 12:26 äbä
-rwxr-xr-x 1 baeuerle users  5678 Nov 21 18:36 uc_test
-rw-r--r-- 1 baeuerle users   551 Nov 21 18:36 uc_test.c
------------------------------------------------------------------------
The hardlink count shows that all 4 files with the name "äbä" are
different files (that can have different content). With traditional Unix
you can create and access all of them, but with other operating systems
you may get problems (if there is some kind of defined internal
representation as with Apple operating systems).

If these files are located on a server, it is not trivial to determine
what happens if you access/modify/delete them. And your view may not be
the same as what other machines see (think about server side backup and
restore or removable media).

The common "solution" is the same in most cases: Don't use the "wrong"
operating systems to access the files. For WWW pages the corresponding
solution is "Your browser is not supported, please install $BROWSER".
Such workarounds (that only work by coincidence on a few mainstream
platforms) are IMHO not what we want for USENET.

> > A possible first step with no collateral damage and the same transport
> > protocol would be the introduction of additional header fields with
> > UTF-8 encoding. If the newsreader need to use RFC2047 encoding, it
> > creates a second header field with direct UTF-8 encoding.
> 
> There's no need. Usenet is very tolerant of 8-bit headers,

I disagree. For fields like "Subject" this may be true. But for the
fields with identifiers like "Message-ID", "References" or "Newsgroups",
I have doubts.

Think about software like leafnode which creates files with the name of
groups and Message-IDs on disk and you already have the problems from my
example above - on your disk.

My newsreader also create directories on disk with the name of groups.
It will therefore be broken by arbitrary Unicode groupnames too
(depending on the underlaying operating system and filesystem).

> RFC 5536 
> notwithstanding. My understanding is that RFC 5536 gives a dictate of 
> ASCII headers primarily to be a subset of RFC 5322, which is US-ASCII, 
> but RFC 6532 provides for UTF-8 header values to allow non-ASCII email 
> addresses.

But RFC6532 message format requires the SMTPUTF8 extension on protocol
level. Because on USENET even the rollout of NNTP V2 is not completed,
I think we can't hope for some kind of "NNTPUTF8" capability to be
available soon.

> You have to write clients to conform to reality, not the wishful 
> thinking that specifications tend to inhabit. The reality is that 8-bit 
> headers are in use [...]

Yes, but that shouldn't stop us from thinking about problems with it.
Technical Details
Message-ID: <AABVRz0NTVsAAA1Q.A1.flnews@WStation3.stz-e.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20150601.mbox.gz!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <mgfuq0$8ee$1@news.mixmin.net> <mggkev$j2u$1@dont-email.me> <mgst9h$nvr$1@news.mixmin.net> <mgtpgp$ije$1@dont-email.me> <mgv2ro$8u6$1@news.mixmin.net> <mh0e69$4d6$1@dont-email.me> <mh0puu$one$1@news.mixmin.net> <mh3qq9$6j5$1@dont-email.me> <mh4fbh$jft$1@news.mixmin.net> <mh714j$40v$1@dont-email.me> <mh77tl$emi$1@news.mixmin.net> <mh92h9$p83$1@dont-email.me> <mhtv8k$s1i$1@news.trigofacile.com> <mhupvp$3c6$1@dont-email.me> <mhvgje$j5p$1@news.trigofacile.com> <mi2pcd$cvl$1@dont-email.me> <AABVRjobIhkAAAoh.A1.flnews@WStation1.micha.freeshell.org> <mi5qh9$ebq$1@dont-email.me>

Show Full Headers
Complete Article Headers
Message-ID: <AABVRz0NTVsAAA1Q.A1.flnews@WStation3.stz-e.de>
Subject: Re: How are supersedes and Message-ID being handled now?
Date: Mon, 04 May 2015 12:34:27 +0000
From: Michael Baeuerle <michael.baeuerle@stz-e.de>
References: <mgfuq0$8ee$1@news.mixmin.net> <mggkev$j2u$1@dont-email.me> <mgst9h$nvr$1@news.mixmin.net> <mgtpgp$ije$1@dont-email.me> <mgv2ro$8u6$1@news.mixmin.net> <mh0e69$4d6$1@dont-email.me> <mh0puu$one$1@news.mixmin.net> <mh3qq9$6j5$1@dont-email.me> <mh4fbh$jft$1@news.mixmin.net> <mh714j$40v$1@dont-email.me> <mh77tl$emi$1@news.mixmin.net> <mh92h9$p83$1@dont-email.me> <mhtv8k$s1i$1@news.trigofacile.com> <mhupvp$3c6$1@dont-email.me> <mhvgje$j5p$1@news.trigofacile.com> <mi2pcd$cvl$1@dont-email.me> <AABVRjobIhkAAAoh.A1.flnews@WStation1.micha.freeshell.org> <mi5qh9$ebq$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20150601.mbox.gz!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.nntp
Lines: 125
Reply-To: Michael Baeuerle <michael.baeuerle@gmx.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net Au1RbkEb9g03Ty+fapa0MAKHvVXdrdQ7nNXNYM6cZ/abi5b64H
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:8/FsOr093VuIXujNDEIS2bIIowY=
 sha1:QdMIyMjUDJcD3uWWKEePrqk9L+o=
Injection-Date: 4 May 2015 12:34:27 -0000
User-Agent: flnews/0.11pre15 (for GNU/Linux)