🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
5 messages
5 total messages Started by Steve Crook Fri, 09 Jul 2010 20:30
Usenet message format
#83296
Author: Steve Crook
Date: Fri, 09 Jul 2010 20:30
37 lines
2444 bytes
Hi all,

I'm struggling to get to grips with how I should correctly terminate
lines when posting articles.  I'm using Python's nntplib to inject
messages to various INN servers and don't seem to be finding a
combination that suits them all.

Looking at RFC5536 and it appears that all header lines should be
terminated with CRLF (\x0D\x0a).  I believe the same applies to the
payload.

If I terminate headers with CRLF then newer versions of INN seem happy
enough about it but older versions reject messages with errors like:
437 Bad "Message-ID" header
Putting a CRLF between header and body seems to also cause confusion
with some servers seeing the first line of the body as a header, thus
rejecting them with:
437 No colon-space in "-----BEGIN PGP MESSAGE-----" header

I also note that even headers added by the server, such as
Injection-Info are only terminated with a LF.  (I'm using hexedit to
view these articles directly from a tradspool.)


In the payload, if an entire message doesn't contain a CR then newer
versions of INN seem to reject them with errors like:
437 No body
or
437 Empty article

If I terminate lines with CRLF then my reader (slrn) shows "^M" on the
end of every line but Windows based readers like Thunderbird display
them correctly.

I suspect I'm doing something fundamentally stupid to have got myself
into such a state of confusion.  I'd appreciate it if somebody could
point it out and put me out of my misery.  :)
Re: Usenet message format
#83297
Author: Russ Allbery
Date: Fri, 09 Jul 2010 20:43
41 lines
2835 bytes
Steve Crook <steve@mixmin.net> writes:

> I'm struggling to get to grips with how I should correctly terminate
> lines when posting articles.  I'm using Python's nntplib to inject
> messages to various INN servers and don't seem to be finding a
> combination that suits them all.

> Looking at RFC5536 and it appears that all header lines should be
> terminated with CRLF (\x0D\x0a).  I believe the same applies to the
> payload.

It does.

> If I terminate headers with CRLF then newer versions of INN seem happy
> enough about it but older versions reject messages with errors like:
> 437 Bad "Message-ID" header

I suspect that some underlying library inside nntplib is being excessively
helpful and changing your CRLF to CRCRLF.

> I also note that even headers added by the server, such as
> Injection-Info are only terminated with a LF.  (I'm using hexedit to
> view these articles directly from a tradspool.)

That's not a good way to look at the articles, since depending on the
wireformat setting in your inn.conf, INN will have converted the files on
disk back to native line end conventions.  You need to look at a dump of
the message as sent over the wire.

> If I terminate lines with CRLF then my reader (slrn) shows "^M" on the
> end of every line but Windows based readers like Thunderbird display
> them correctly.

Yeah, it definitely sounds like something is being excessively helpful and
adding an extra CR.

-- 
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: Usenet message format
#83298
Author: Julien ÉLIE
Date: Fri, 09 Jul 2010 23:04
61 lines
3638 bytes
Hi Steve,

> If I terminate headers with CRLF then newer versions of INN seem happy
> enough about it but older versions reject messages with errors like:
> 437 Bad "Message-ID" header

With the new way we parse already injected articles (innd), I believe
we're less strict than before.  But we're stricter at the injection point
(nnrpd) where only *WSP will be allowed (that is to say spaces and tabs)
before the single final CRLF of the Message-ID: header field.

If you find something suspicious during your tests on one of INN 2.5.2,
STABLE 2.5.3 and CURRENT 2.6.0, do not hesitate to tell.



> I also note that even headers added by the server, such as
> Injection-Info are only terminated with a LF.  (I'm using hexedit to
> view these articles directly from a tradspool.)

That's OK if you're not using wireformat, as Russ said.

Also, please note that if you look at the source code of INN, you will
only see LF for the Injection-Info: header field.  It's fine at that
very point in the source code.  See:
    http://inn.eyrie.org/trac/changeset/8878/trunk


Do you see that with the messages you inject with your Python code?
or other messages?
I ask because you mention 437 error codes, which means that IHAVE is
used.  Do you send your articles to nnrpd (MODE READER) or innd?



> In the payload, if an entire message doesn't contain a CR then newer
> versions of INN seem to reject them with errors like:
> 437 No body
> or
> 437 Empty article

INN explicitly looks for CRLF for the start of the body.
Older versions had a bug.  The code dealing with "No body" and
"Empty article" in art.c totally changed in INN 2.5.
In our changelog, there is in INN 2.5.2:
    Fixed a bug in recognizing the article terminator when empty
    articles were fed to innd via IHAVE or TAKETHIS, leading to
    treating subsequent NNTP commands as part of the article.
It was the major consequence.  I believe other minor things were
also fixed.

Do not hesitate to tell us if you see any issue with how recent INN
versions parse headers.  Bugs may have been introduced and would then
need fixing...

-- 
Julien ÉLIE

« Quand on retire tout ce qu'on a dit, il reste tout ce qu'on n'a pas dit. »
  (Philippe Geluck) 
Re: Usenet message format
#83300
Author: Steve Crook
Date: Sat, 10 Jul 2010 10:30
19 lines
1813 bytes
On Fri, 09 Jul 2010 13:43:55 -0700, Russ Allbery wrote in
Message-Id: <8739vs4c8k.fsf@windlord.stanford.edu>:

> I suspect that some underlying library inside nntplib is being excessively
> helpful and changing your CRLF to CRCRLF.

Hi Russ,

Thanks, I suspected this might be happening but the "437 Empty Article"
and "437 No body" messages made me consider that I was offering malformed
articles.  Hence why I started going down the route of manually adding
CRLF to each line.

> That's not a good way to look at the articles, since depending on the
> wireformat setting in your inn.conf, INN will have converted the files on
> disk back to native line end conventions.  You need to look at a dump of
> the message as sent over the wire.
I'll try and do that today to convince myself one way or the other what
is actually being injected into the servers.
Re: Usenet message format
#83301
Author: Steve Crook
Date: Sat, 10 Jul 2010 10:47
39 lines
2830 bytes
On Sat, 10 Jul 2010 01:04:00 +0200, Julien ÉLIE wrote in
Message-Id: <i189t2$pgj$1@news.trigofacile.com>:

> If you find something suspicious during your tests on one of INN 2.5.2,
> STABLE 2.5.3 and CURRENT 2.6.0, do not hesitate to tell.

Hi Julien,

Below is a log snippet from my code for a typical article I'm trying to
inject via IHAVE to three newsservers:-

2010-07-09 10:34:53 19150 DEBUG Posting to news.glorb.com
2010-07-09 10:34:55 19150 INFO <20100709093453.k7VC3fMPwY0y@nymserv.mixmin.net>
 successful IHAVE to news.glorb.com.
2010-07-09 10:34:55 19150 DEBUG Posting to newsin.alt.net
2010-07-09 10:34:56 19150 INFO IHAVE to newsin.alt.net returned a temporary
 error: 437 No body.
2010-07-09 10:34:56 19150 DEBUG Posting to localhost
2010-07-09 10:34:56 19150 INFO IHAVE to localhost returned a temporary error:
 437 Empty article.

In this instance, localhost is news.mixmin.net (INN 20100416 prerelease)
Glorb seems to be running INN 2.5.2
Altopia doesn't provide a version on connection.

I'm not sure how well these articles will have propagated.  As you can
see, from my three injection servers, only Glorb is accepting them.
Here are another couple of Message-ID's for similar articles:
<20100708114733.t7ZFM38wAb0R@nymserv.mixmin.net>
<20100708162138.Hee8lqr3YbY9@nymserv.mixmin.net>

> Also, please note that if you look at the source code of INN, you will
> only see LF for the Injection-Info: header field.  It's fine at that
> very point in the source code.  See:
>     http://inn.eyrie.org/trac/changeset/8878/trunk
Yes, I searched through your code to see what was happening and read the
remark about LF at that point.  Thanks, life is so much easier with
nicely commented code!  :)
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