🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
7 messages
7 total messages Started by Julien ÉLIE Sat, 27 Dec 2008 18:33
Converting quoted and escaped message-IDs
#79935
Author: Julien ÉLIE
Date: Sat, 27 Dec 2008 18:33
67 lines
3106 bytes
Hi,

RFC 3977 states that:

   RFC 2822 has a concept of "quoted" and "escaped" characters.  It
   therefore considers the three message-ids:

      <ab.cd@example.com>
      <"ab.cd"@example.com>
      <"ab.\cd"@example.com>

   as being identical.  Therefore, an NNTP implementation handing email
   articles must ensure that only one of these three appears in the
   protocol and that the other two are converted to it as and when
   necessary, such as when a client checks the results of a NEWNEWS
   command against an internal database of message-ids.


USEFOR states that:

   only the first of them is syntactically permitted by this standard,
   and hence a simple comparison of octets will always suffice to
   determine the identity of two <msg-id>s.



What should be done?

Every time a user gives a message-ID, should it be rewritten internally
by the news server?

If I send:

    ARTICLE <t\e\st@tes\t.fr>

should the news server understand:

    ARTICLE <test@test.fr>

or return that it is an invalid message-ID (501 syntax error)?



Is <"ab..cd"@example.com> (double dots) to be accepted?  And converted
to <ab.cd@example.com>?


Is <"ab.cd"@example.com> (single dot) invalid according to USEFOR and
valid according to RFC 3977?  What to do with it?



Another issue:  for articles already in the history of a news server,
what should be done?  If I have three stored articles as <"ab.cd"@example.com>,
<"ab..cd"@example.com> and <ab.cd@example.com>, how would I find them
with RFC 3977 and USEFOR?  Only the last one would be returned (and
a syntax error for the first one???).


Or maybe I am missing something...

-- 
Julien ÉLIE

« -- Il l'aura voulu.
  -- Tu crois vraiment ? » (Astérix) 
Re: Converting quoted and escaped message-IDs
#79936
Author: Curt Welch
Date: Sat, 27 Dec 2008 20:05
82 lines
4694 bytes
=?iso-8859-15?Q?Julien_=C9LIE?= <iulius@nom-de-mon-site.com.invalid> wrote:
> Hi,
>
> RFC 3977 states that:
>
>    RFC 2822 has a concept of "quoted" and "escaped" characters.  It
>    therefore considers the three message-ids:
>
>       <ab.cd@example.com>
>       <"ab.cd"@example.com>
>       <"ab.\cd"@example.com>
>
>    as being identical.  Therefore, an NNTP implementation handing email
>    articles must ensure that only one of these three appears in the
>    protocol and that the other two are converted to it as and when
>    necessary, such as when a client checks the results of a NEWNEWS
>    command against an internal database of message-ids.
>
> USEFOR states that:
>
>    only the first of them is syntactically permitted by this standard,
>    and hence a simple comparison of octets will always suffice to
>    determine the identity of two <msg-id>s.
>
> What should be done?
>
> Every time a user gives a message-ID, should it be rewritten internally
> by the news server?
>
> If I send:
>
>     ARTICLE <t\e\st@tes\t.fr>
>
> should the news server understand:
>
>     ARTICLE <test@test.fr>
>
> or return that it is an invalid message-ID (501 syntax error)?
>
> Is <"ab..cd"@example.com> (double dots) to be accepted?  And converted
> to <ab.cd@example.com>?
>
> Is <"ab.cd"@example.com> (single dot) invalid according to USEFOR and
> valid according to RFC 3977?  What to do with it?
>
> Another issue:  for articles already in the history of a news server,
> what should be done?  If I have three stored articles as
> <"ab.cd"@example.com>, <"ab..cd"@example.com> and <ab.cd@example.com>,
> how would I find them with RFC 3977 and USEFOR?  Only the last one would
> be returned (and a syntax error for the first one???).
>
> Or maybe I am missing something...

I'm not aware of any news server or news client that deals with this for
standard Usenet messages.  Most news servers will accept just about any
character inside a message-id and none of them that I know of will check
for, or attempt to convert, messages like the above.  Diablo even accepted
spaces inside of message-ids (or at least it used to) - which breaks most
other servers.  I believe there are a lot of servers that don't even
require the @ in message ID's.

Test it on some servers you have access to and see what happens.  Try
posting messages in all three formats - I strongly suspect any server you
try will allow it, and see it as three different IDs, and that all three
formats will propitiate around Usenet just fine (as three different
messages).

I would suggest that the only time you have to deal with such issues if you
were writing a mail to Usenet gateway or a client that tried to integrate
email and Usenet messages in a common data base.  For purely NNTP clients
and servers, just doing a byte for byte comparison to whatever is given in
an article or as an argument to an NNTP command is the normal way the
servers are written.

If there's an effort afoot to try and make servers deal with this
complexity, I'm not aware of it, and if you start changing the message-id
as given, you will introduce complexity into the system that doesn't
currently exist.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                                        http://NewsReader.Com/
Re: Converting quoted and escaped message-IDs
#79937
Author: Russ Allbery
Date: Sat, 27 Dec 2008 20:50
45 lines
2916 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> RFC 3977 states that:
>
>   RFC 2822 has a concept of "quoted" and "escaped" characters.  It
>   therefore considers the three message-ids:
>
>      <ab.cd@example.com>
>      <"ab.cd"@example.com>
>      <"ab.\cd"@example.com>
>
>   as being identical.  Therefore, an NNTP implementation handing email
>   articles must ensure that only one of these three appears in the
>   protocol and that the other two are converted to it as and when
>   necessary, such as when a client checks the results of a NEWNEWS
>   command against an internal database of message-ids.

It's important to note that INN is *not* an NNTP implementation handling
email articles as was meant by this part of the standard.  (Some of its
supporting programs, like mailpost, are gateways that probably should
think about that, but that's slightly different.)  This was talking about
things like an NNTP interface to an IMAP store, where the underlying
articles can't be expected to comply with NNTP or Usenet article format
standards.

INN can assume that all articles in its spool are RFC 1036 messages and
therefore can ignore these sorts of quoting issues.

> What should be done?
>
> Every time a user gives a message-ID, should it be rewritten internally
> by the news server?

No, once the message ID reaches the NNTP protocol, it should be accepted
or rejected as-is and treated as a literal string.  Anything that needs to
be done here has to be done prior to that.

USEFOR is taking the approach of outlawing the ambiguous message IDs,
which puts the onus on clients to not generate them.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Converting quoted and escaped message-IDs
#79940
Author: Julien ÉLIE
Date: Sun, 28 Dec 2008 20:07
63 lines
3861 bytes
Hi Russ,

>>   Therefore, an NNTP implementation handing email
>>   articles must ensure that only one of these three appears in the
>>   protocol and that the other two are converted to it as and when
>>   necessary, such as when a client checks the results of a NEWNEWS
>>   command against an internal database of message-ids.
>
> It's important to note that INN is *not* an NNTP implementation handling
> email articles as was meant by this part of the standard.  (Some of its
> supporting programs, like mailpost, are gateways that probably should
> think about that, but that's slightly different.)  This was talking about
> things like an NNTP interface to an IMAP store, where the underlying
> articles can't be expected to comply with NNTP or Usenet article format
> standards.

Oh, all right.  I misunderstood the meaning of that appendix.
I thought for instance that nnrpd would have to rewrite the message-IDs
it sends as a result of NEWNEWS so that the client could check it.  But
as you told me, it is the client which has the responsibility to rewrite
what it receives.

Yet, <ab.cd@example.com>, <"ab.cd"@example.com>, <"ab.\cd"@example.com>
and <"ab..cd"@example.com> could be 4 different articles in INN's spool.
And the client would not see that if it converts everything.
(We could have a mix of Netnews and e-mails articles in the spool,
or a defect of the posting client.)


> INN can assume that all articles in its spool are RFC 1036 messages and
> therefore can ignore these sorts of quoting issues.

All right.
However, I hope clients manage to work fine with these message-IDs.



> USEFOR is taking the approach of outlawing the ambiguous message IDs,
> which puts the onus on clients to not generate them.

OK.
Consequently, message-IDs are to be considered for a news server
only as opaque strings that MUST meet the following requirements:

   o  A message-id MUST begin with "<", end with ">", and MUST NOT
      contain the latter except at the end.

   o  A message-id MUST be between 3 and 250 octets in length.

   o  A message-id MUST NOT contain octets other than printable US-ASCII
      characters.

(quoting RFC 3977)

A news server does not need to know more.  Perfectly understood.
Thanks for having made me aware of that fact!

-- 
Julien ÉLIE

« -- Connaissez-vous la différence entre l'ignorance et l'apathie ?
  -- J'en sais rien et je m'en fous. »
Re: Converting quoted and escaped message-IDs
#79941
Author: Julien ÉLIE
Date: Sun, 28 Dec 2008 20:24
47 lines
2876 bytes
Hi Curt,

> I'm not aware of any news server or news client that deals with this for
> standard Usenet messages.

I had in fact misunderstood what that appendix refered to.  It is not for
Usenet messages but e-mail messages, as Russ explained.


> Most news servers will accept just about any
> character inside a message-id and none of them that I know of will check
> for, or attempt to convert, messages like the above.  Diablo even accepted
> spaces inside of message-ids (or at least it used to) - which breaks most
> other servers.

Only printable US-ASCII are allowed.


> I believe there are a lot of servers that don't even
> require the @ in message ID's.

It is, indeed, not required by RFC 3977.


> Test it on some servers you have access to and see what happens.  Try
> posting messages in all three formats - I strongly suspect any server you
> try will allow it, and see it as three different IDs, and that all three
> formats will propitiate around Usenet just fine (as three different
> messages).

It is what happens with INN.


> For purely NNTP clients
> and servers, just doing a byte for byte comparison to whatever is given in
> an article or as an argument to an NNTP command is the normal way the
> servers are written.

OK.
Thanks for your answer.

-- 
Julien ÉLIE

« Ne parlez jamais de vous, ni en bien, car on ne vous
  croirait pas, ni en mal car on ne vous croirait que trop. » (Confucius) 
Re: Converting quoted and escaped message-IDs
#79945
Author: Curt Welch
Date: Mon, 29 Dec 2008 00:06
65 lines
4511 bytes
=?Windows-1252?Q?Julien_=C9LIE?= <iulius@nom-de-mon-site.com.invalid>
> wrote: Hi Curt,
>
> > I'm not aware of any news server or news client that deals with this
> > for standard Usenet messages.
>
> I had in fact misunderstood what that appendix refered to.  It is not for
> Usenet messages but e-mail messages, as Russ explained.
>
> > Most news servers will accept just about any
> > character inside a message-id and none of them that I know of will
> > check for, or attempt to convert, messages like the above.  Diablo even
> > accepted spaces inside of message-ids (or at least it used to) - which
> > breaks most other servers.
>
> Only printable US-ASCII are allowed.

Yes, but what's "allowed" and what's actually done seldom match up on
Usenet.  There's always a healthy percentage of "rogue" articles that
violate the specs because some servers don't enforce the standards and some
clients choose to inject crap simply because they tried it and it worked.

If you reject everything that doesn't fit the standards you will help clean
up Usenet, but you will also end up with a server that's missing a healthy
percent of articles that other servers carry.

For almost all the format restrictions I had at least two, and often three
different levels of enforcement depending on context.  The most strict is
for POST when new articles are being injected in Usenet and the least
strict are for reception from peers to allow your server to accept just
about anything that might exist on other sites.  What you send to peers is
someone between the two.  If you use only one level of checking, you are
forced to either be too lax for new articles which allows more poorly
formed articles to live on Usenet, or you end up dropping lots of articles
that other sites allow. It would be nice if we could all code to the specs,
but Usenet didn't start out that way, and its mass makes it very difficult
to bring it under control of any spec.  So you do what you can with your
server to make it follow the specs and not allow invalid articles on
Usenet, while at the same time, accepting what you must in order to deal
with how people are actually using it.

> > I believe there are a lot of servers that don't even
> > require the @ in message ID's.
>
> It is, indeed, not required by RFC 3977.
>
> > Test it on some servers you have access to and see what happens.  Try
> > posting messages in all three formats - I strongly suspect any server
> > you try will allow it, and see it as three different IDs, and that all
> > three formats will propitiate around Usenet just fine (as three
> > different messages).
>
> It is what happens with INN.
>
> > For purely NNTP clients
> > and servers, just doing a byte for byte comparison to whatever is given
> > in an article or as an argument to an NNTP command is the normal way
> > the servers are written.
>
> OK.
> Thanks for your answer.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                                        http://NewsReader.Com/
Re: Converting quoted and escaped message-IDs
#79955
Author: Julien ÉLIE
Date: Mon, 29 Dec 2008 06:49
26 lines
2566 bytes
Hi Curt,

> For almost all the format restrictions I had at least two, and often three
> different levels of enforcement depending on context.  The most strict is
> for POST when new articles are being injected in Usenet and the least
> strict are for reception from peers to allow your server to accept just
> about anything that might exist on other sites.

All right.
It is what USEPRO calls the well-known Internet Robustness Principle:

    Be liberal in what you accept, and conservative in what you send.

  As applied to Netnews, this primarily means that unwanted or non-compliant
  articles SHOULD be rejected as early as possible, but once they are in general
  circulation, relaying and serving agents may wish to accept them where possible
  rather than lose information.  Posting agents and injecting agents SHOULD
  therefore be maximally strict in their application of both this protocol and
  USEFOR, and reading agents SHOULD be robust in the presence of violations
  of the Netnews article format where possible.

-- 
Julien ÉLIE

« Ta remise sur pied lui a fait perdre la tête ! » (Astérix) 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads