Thread View: news.software.nntp
12 messages
12 total messages
Started by Steve Crook
Fri, 18 Dec 2009 17:03
Incorrect lines count in $hdr{__LINES__}
Author: Steve Crook
Date: Fri, 18 Dec 2009 17:03
Date: Fri, 18 Dec 2009 17:03
31 lines
2307 bytes
2307 bytes
Hi all,
Whilst scanning through some Cleanfeed logs for today, I noticed a
number of misplaced binaries that had not been trapped by Cleanfeed's
is_binary routine. I believe the reason for this is that
$hdr{__LINES__} in every instance was returning 7 instead of the actual
2000-3000 lines in the posting. Consequently the binary filter passed
them as being acceptably small.
Here is an example header:
INFO: Scoring filter (11)
Score: !!NoFup(4)!Lines:7-3151!!!PowerPost!!!CapRat(0.99)!!SymRat(0.87)#Adult+Url
Date: Sat, 19 Dec 2009 06:37:14 -0500
From: SydneyAust29@Hotmail.com
Lines: 3151
Message-ID: <P4OWm.99704$E62.2888@unlimited.newshosting.com>
Newsgroups: alt.sex.erotica.marketplace,alt.sex.erotica.marketplacen,alt.sex.fetish.feet,a
lt.sex.fetish
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Path:
hq-usenetpeers.eweka.nl!81.171.88.250.MISMATCH!newsfeed.eweka.nl!eweka.nl!feeder3.ew
eka.nl!69.16.177.246.MISMATCH!cyclone03.ams2.highwinds-media.com!npeer03.iad.highwinds-med
ia.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!new
shosting.com!post02.iad!not-for-mail
Subject: My colection___Alison - '121' of '148'
X-Complaints-To: abuse(at)newshosting.com
X-Newsposter: NNTP POWER-POST 2000 (Build 24b) - net-toys.8k.com
X-No-Archive: yes
The Lines header is more or less correct at 3151, but the
$hdr{__LINES__} (reported in the Score header) is 7.
Re: Incorrect lines count in $hdr{__LINES__}
Author: Julien ÉLIE
Date: Fri, 18 Dec 2009 20:27
Date: Fri, 18 Dec 2009 20:27
26 lines
2304 bytes
2304 bytes
Hi Steve,
> Whilst scanning through some Cleanfeed logs for today, I noticed a
> number of misplaced binaries that had not been trapped by Cleanfeed's
> is_binary routine. I believe the reason for this is that
> $hdr{__LINES__} in every instance was returning 7 instead of the actual
> 2000-3000 lines in the posting.
Do you have a sample of such an article?
I tried to "telnet news.mixmin.net 119" but the reported message-ID does
not exist any longer.
Especially, the next time you see that, could you please see how many lines
are reported by an OVER request on it?
What I think is happening is that these articles are malformed and contain
only "\n" as line delimitors, and not "\r\n". But only a careful inspection
of these articles will tell us.
If that is not the case, I do not see well why $hdr{__LINES__} would be wrong :-/
--
Julien ÉLIE
« Ne craignez pas d'être lent, craignez seulement d'être à l'arrêt. »
Re: Incorrect lines count in $hdr{__LINES__}
Author: Steve Crook
Date: Sat, 19 Dec 2009 16:30
Date: Sat, 19 Dec 2009 16:30
22 lines
2041 bytes
2041 bytes
On Fri, 18 Dec 2009 21:27:46 +0100, Julien ÉLIE wrote in Message-Id: <hggok5$u3p$1@news.trigofacile.com>: > Do you have a sample of such an article? > I tried to "telnet news.mixmin.net 119" but the reported message-ID does > not exist any longer. Yes, unfortunately I only noticed this instance because it was rejected by another filter after being passed by the binary check. I've put a filter in place now to log incorrect line counts so hopefully I'll catch some examples. > Especially, the next time you see that, could you please see how many lines > are reported by an OVER request on it? Certainly. > What I think is happening is that these articles are malformed and contain > only "\n" as line delimitors, and not "\r\n". But only a careful inspection > of these articles will tell us. You are correct. Using a hexeditor on the log, I can see that all the uuencoded lines in these articles are terminated with just 0A, not 0D0A. The text lines are correctly terminated which causes the reported line count of 7.
Re: Incorrect lines count in $hdr{__LINES__}
Author: Julien ÉLIE
Date: Sat, 19 Dec 2009 23:56
Date: Sat, 19 Dec 2009 23:56
52 lines
3064 bytes
3064 bytes
Hi Steve,
>> Especially, the next time you see that, could you please see how many lines
>> are reported by an OVER request on it?
>
> Certainly.
>
>> What I think is happening is that these articles are malformed and contain
>> only "\n" as line delimitors, and not "\r\n". But only a careful inspection
>> of these articles will tell us.
>
> You are correct. Using a hexeditor on the log, I can see that all the
> uuencoded lines in these articles are terminated with just 0A, not 0D0A.
> The text lines are correctly terminated which causes the reported line
> count of 7.
OK, then it explains the count.
Other examples will provide the same result. And an OVER request will
answer 7 (the number of "\r\n" in the article).
It is the real number of lines. We cannot do more with INN. Maybe these
articles should be rejected by Cleanfeed -- another parameter?
RFC 5536 (USEFOR) :
3.3.1. Lines
The line count is the number of CRLF separators in the <body>.
Note that the Lines: headers is deprecated.
RFC 3977 (NNTP) :
8.1.2. The :lines Metadata Item
The :lines metadata item for an article is a decimal integer. It
MUST equal the number of lines in the article body (excluding the
empty line separating headers and body). Equivalently, it is two
less than the number of CRLF pairs that the BODY command would return
for that article (the extra two are those following the response code
and the termination octet).
--
Julien ÉLIE
« Pourquoi les programmeurs confondent-ils Halloween et Noël ?
Parce que OCT 31 == DEC 25. »
Re: Incorrect lines count in $hdr{__LINES__}
Author: D. Stussy
Date: Sun, 20 Dec 2009 01:47
Date: Sun, 20 Dec 2009 01:47
39 lines
2704 bytes
2704 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:hgjp7i$rdn$1@news.trigofacile.com...
> >> Especially, the next time you see that, could you please see how many
lines
> >> are reported by an OVER request on it?
> >
> > Certainly.
> >
> >> What I think is happening is that these articles are malformed and
contain
> >> only "\n" as line delimitors, and not "\r\n". But only a careful
inspection
> >> of these articles will tell us.
> >
> > You are correct. Using a hexeditor on the log, I can see that all the
> > uuencoded lines in these articles are terminated with just 0A, not
0D0A.
> > The text lines are correctly terminated which causes the reported line
> > count of 7.
>
> OK, then it explains the count.
> Other examples will provide the same result. And an OVER request will
> answer 7 (the number of "\r\n" in the article).
>
> It is the real number of lines. We cannot do more with INN. Maybe these
> articles should be rejected by Cleanfeed -- another parameter?
Random thoughts:
I think that they should actually be rejected by INN (or whichever NNTP
server package one is using) as malformed ("line too long" error).
However, is there any restriction on the length of body lines?
Since NNTP is a TCP protocol, why isn't TCP converting the LFs into CRLFs?
Maybe there's something wrong at the protocol interface. Isn't there a
setting on UNIX-based machines for the TCP socket to do such a conversion?
Maybe some other news software is broken?
Re: Incorrect lines count in $hdr{__LINES__}
Author: Russ Allbery
Date: Sun, 20 Dec 2009 01:54
Date: Sun, 20 Dec 2009 01:54
34 lines
2561 bytes
2561 bytes
"D. Stussy" <spam+newsgroups@bde-arc.ampr.org> writes:
> I think that they should actually be rejected by INN (or whichever NNTP
> server package one is using) as malformed ("line too long" error).
> However, is there any restriction on the length of body lines?
Nope.
We experimented briefly with rejecting articles with bare LFs, but there
turn out to be a *lot* of them and it's not clear that you really want to
reject them all.
> Since NNTP is a TCP protocol, why isn't TCP converting the LFs into CRLFs?
TCP doesn't know anything at all about line endings or, for that matter,
lines. Maybe you're confusing TCP with telnet, which does, but which has
nothing to do with NNTP?
> Isn't there a setting on UNIX-based machines for the TCP socket to do
> such a conversion?
No. This is a feature of the network terminal model of telnet and,
separately, of the data model of the FTP protocol, and is specific to
those two protocols.
The telnet command-line client will convert LFs for you when talking to
any socket, as a convenience since most protocols require CRLF, but this
is a feature of the telnet client, not the protocol.
--
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: Incorrect lines count in $hdr{__LINES__}
Author: D. Stussy
Date: Sun, 20 Dec 2009 02:19
Date: Sun, 20 Dec 2009 02:19
41 lines
2941 bytes
2941 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87638276ld.fsf@windlord.stanford.edu...
> "D. Stussy" <spam+newsgroups@bde-arc.ampr.org> writes:
> > I think that they should actually be rejected by INN (or whichever NNTP
> > server package one is using) as malformed ("line too long" error).
> > However, is there any restriction on the length of body lines?
>
> Nope.
Maybe there should be (but it could be long - like the maximum TCP packet
size of 64kB).
> We experimented briefly with rejecting articles with bare LFs, but there
> turn out to be a *lot* of them and it's not clear that you really want to
> reject them all.
>
> > Since NNTP is a TCP protocol, why isn't TCP converting the LFs into
CRLFs?
>
> TCP doesn't know anything at all about line endings or, for that matter,
> lines. Maybe you're confusing TCP with telnet, which does, but which has
> nothing to do with NNTP?
>
> > Isn't there a setting on UNIX-based machines for the TCP socket to do
> > such a conversion?
>
> No. This is a feature of the network terminal model of telnet and,
> separately, of the data model of the FTP protocol, and is specific to
> those two protocols.
>
> The telnet command-line client will convert LFs for you when talking to
> any socket, as a convenience since most protocols require CRLF, but this
> is a feature of the telnet client, not the protocol.
That's probably what I was thinking of. I don't normally deal with raw
sockets.
Now, doesn't the UUCODE protocol require the conversion? That's not for
NNTP to detect or decide, but back to cleanfeed.
Re: Incorrect lines count in $hdr{__LINES__}
Author: Russ Allbery
Date: Sun, 20 Dec 2009 02:55
Date: Sun, 20 Dec 2009 02:55
36 lines
2792 bytes
2792 bytes
"D. Stussy" <spam+newsgroups@bde-arc.ampr.org> writes:
> "Russ Allbery" <rra@stanford.edu> wrote:
>> "D. Stussy" <spam+newsgroups@bde-arc.ampr.org> writes:
>>> I think that they should actually be rejected by INN (or whichever
>>> NNTP server package one is using) as malformed ("line too long"
>>> error). However, is there any restriction on the length of body
>>> lines?
>> Nope.
> Maybe there should be (but it could be long - like the maximum TCP
> packet size of 64kB).
Arbitrary limits are bad because they limit your ability to deal with the
unforseen (such as yEnc, for instance). We went out of our way to
eliminate as many of them as possible. I don't think we should
reintroduce them at the protocol level. Sites can always set a reasonable
local policy. (And it would be useful to have a best practices guide for
that sort of thing.)
> Now, doesn't the UUCODE protocol require the conversion? That's not for
> NNTP to detect or decide, but back to cleanfeed.
It's not really clear -- uuencode isn't horribly well-defined outside of a
UNIX environment. I don't think anyone's written an RFC specification for
it, for instance.
MIME base64 encoding does require CRLF line endings (since MIME in general
requires CRLF line endings for any article).
--
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: Incorrect lines count in $hdr{__LINES__}
Author: Steve Crook
Date: Sun, 20 Dec 2009 12:34
Date: Sun, 20 Dec 2009 12:34
28 lines
2209 bytes
2209 bytes
On Sun, 20 Dec 2009 00:56:33 +0100, Julien ÉLIE wrote in Message-Id: <hgjp7i$rdn$1@news.trigofacile.com>: > It is the real number of lines. We cannot do more with INN. Maybe these > articles should be rejected by Cleanfeed -- another parameter? Having done some initial logging, I don't think rejecting *all* articles with malformed line terminations is the correct action. There appears to be a lot of them, many with good, non-binary content. The issue for Cleanfeed is that it uses the line count to crudely determine the size of the article. Small articles with binary content are accepted, larger ones rejected. The easiest solution might be to reject *all* misplaced uu/yEnc encoded articles, regardless of size or number of lines. > RFC 5536 (USEFOR) : > > 3.3.1. Lines > > The line count is the number of CRLF separators in the <body>. > > > Note that the Lines: headers is deprecated. Yes, I need to strip out the various elements of Cleanfeed that use the Lines header. At the moment articles are being adversely scored for not having it.
Re: Incorrect lines count in $hdr{__LINES__}
Author: D. Stussy
Date: Sun, 20 Dec 2009 22:20
Date: Sun, 20 Dec 2009 22:20
33 lines
2581 bytes
2581 bytes
"Steve Crook" <steve@mixmin.net> wrote in message news:slrnhis6dp.mt9.steve@news.mixmin.net... > On Sun, 20 Dec 2009 00:56:33 +0100, Julien ÉLIE wrote in > Message-Id: <hgjp7i$rdn$1@news.trigofacile.com>: > > > It is the real number of lines. We cannot do more with INN. Maybe these > > articles should be rejected by Cleanfeed -- another parameter? > Having done some initial logging, I don't think rejecting *all* articles > with malformed line terminations is the correct action. There appears > to be a lot of them, many with good, non-binary content. > > The issue for Cleanfeed is that it uses the line count to crudely > determine the size of the article. Small articles with binary content > are accepted, larger ones rejected. The easiest solution might be to > reject *all* misplaced uu/yEnc encoded articles, regardless of size or > number of lines. Suggestions (to think about): For UUCODE: - Do most of the lines start with a "M" and have 60 characters following (before CRLF)? - Is there a "begin " within the first 10 lines of the body (or body section, if MIME)? - Is there an "end " within the last 10 lines of the body (or body section)? - Are there any characters that don't appear in the 64 that UUCODE uses? For yEnc: - Is there a "=ybegin " or "=yend ", similar to the above.
Re: Incorrect lines count in $hdr{__LINES__}
Author: Antti-Juhani Kaijanaho
Date: Mon, 21 Dec 2009 07:23
Date: Mon, 21 Dec 2009 07:23
12 lines
1515 bytes
1515 bytes
Steve Crook <steve@mixmin.net> kirjoitti 20.12.2009: > The issue for Cleanfeed is that it uses the line count to crudely > determine the size of the article. Small articles with binary content > are accepted, larger ones rejected. The easiest solution might be to > reject *all* misplaced uu/yEnc encoded articles, regardless of size or > number of lines. Or perhaps use the byte count instead of the line count. -- Mr. Antti-Juhani Kaijanaho, Jyvaskyla, Finland
Re: Incorrect lines count in $hdr{__LINES__}
Author: Steve Crook
Date: Mon, 21 Dec 2009 11:00
Date: Mon, 21 Dec 2009 11:00
21 lines
2156 bytes
2156 bytes
On 21 Dec 2009 07:23:02 GMT, Antti-Juhani Kaijanaho wrote in Message-Id: <slrnhiu8ik.4fu.antti-juhani@kukkaseppele.kaijanaho.fi>: > Steve Crook <steve@mixmin.net> kirjoitti 20.12.2009: >> The issue for Cleanfeed is that it uses the line count to crudely >> determine the size of the article. Small articles with binary content >> are accepted, larger ones rejected. The easiest solution might be to >> reject *all* misplaced uu/yEnc encoded articles, regardless of size or >> number of lines. > > Or perhaps use the byte count instead of the line count. I thought about this but it doesn't actually solve the problem of how much binary content is in the post. For example, you could have a 20KB text message with just a few lines of PGP signature. Conversely, binaries can be fragmented over thousands of very small messages which slip under the byte limit. Whilst I can see justification for small Base64 binaries in text groups for PGP signatures, key exchange and such like, I'm struggling to think of any justification why uu/yEnc should be permitted outside binary groups.
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