🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
10 messages
10 total messages Started by Starmen Sat, 15 Nov 2003 12:56
Maximum length of 'subject' field in header ?
#67176
Author: Starmen
Date: Sat, 15 Nov 2003 12:56
12 lines
1494 bytes
Hi,
  I'm developing my own binary newsreader and I'm wondering what the maximum
length of the 'subject' field in an article header is. I've been trying to
find information on the net but I haven't been able to find it.
Currently I have the limit set at 160 characters, but I'm not sure that this
is enough.
Does anyone know ?

Thanks,
Starmen

Re: Maximum length of 'subject' field in header ?
#67179
Author: Dirk Nimmich
Date: Sat, 15 Nov 2003 15:45
44 lines
2679 bytes
Starmen wrote:
>  I'm developing my own binary newsreader and I'm wondering what
>  the maximum length of the 'subject' field in an article header
>  is.

In short: There is none.

> I've been trying to find information on the net but I haven't been
> able to find it.

You are developing a program without knowing any specification about
the topic? (Ok, rhetorical question. That seems to be normal these
days.)

Basic format:
RFC  822 <http://www.ietf.org/rfc/rfc822.txt>
RFC 1036 <http://www.ietf.org/rfc/rfc1036.txt>
RFC 2822 <http://www.ietf.org/rfc/rfc2822.txt>
USEFOR draft
<http://www.ietf.org/internet-drafts/draft-ietf-usefor-article-11.txt>

Encoding and declaration of content:
RFC 2045 <http://www.ietf.org/rfc/rfc2045.txt>
RFC 2046 <http://www.ietf.org/rfc/rfc2046.txt>
RFC 2047 <http://www.ietf.org/rfc/rfc2047.txt>
RFC 2183 <http://www.ietf.org/rfc/rfc2183.txt>
RFC 2231 <http://www.ietf.org/rfc/rfc2231.txt>
Content-Type database
<http://www.iana.org/assignments/media-types/index.html>

Transport:
RFC  977 <http://www.ietf.org/rfc/rfc977.txt>
RFC 2980 <http://www.ietf.org/rfc/rfc2980.txt>
NNTP draft
<http://www.ietf.org/internet-drafts/draft-ietf-nntpext-base-20.txt>

See also <http://www.tin.org/docs.html> for further references.

> Currently I have the limit set at 160 characters, but I'm not sure
> that this is enough.

No. If folded and (if needed) encoded properly, there is no limit at
all. (At least in theory.)
Re: Maximum length of 'subject' field in header ?
#67180
Author: Starmen
Date: Sat, 15 Nov 2003 17:21
82 lines
4486 bytes
> You are developing a program without knowing any specification about
> the topic? (Ok, rhetorical question. That seems to be normal these
> days.)

Thanks for the pointers.

Of course I have studied a lot of information before I started developing !
But I never seemed to be able to find this particular piece of information
because it is simply not there. Often I also like to write some sample code
to see whether specifications match with the real world (and more often than
not they don't !).

Also, in real life a programmer cannot deal efficiently with theoretically
unlimited data structures. Some limits are imposed sooner or later to avoid
the 'claim <unlimited> amount of memory to hold potentially <unlimited> long
subject lines' problem.
I'm trying to find the common denominator which will enable my program to
catch 99.999 % of all articles. I will gladly pass over the 0.001 % that
chooses to use insanely long subject lines and let the usenet community
flame them into never doing it again.

I need to impose some limits because I'm storing article subject lines into
a database which only handles fixed-length datastructures. So far it's
working very well, the program doesn't need to hold all articles from a
newsgroup in memory (like newsbin pro does for example, making it use 300+
MB of main memory for the largest binary newsgroups :( ) but yanks them
real-time from the database as soon as the user presses the
'pageup/pagedown/etc.' key. This also means there is no delay when switching
from one newsgroup to another :).

Regards,
Starmen


"Dirk Nimmich" <nimmich@muenster.de> wrote in message
news:bp5hml$8tt$05$1@news.t-online.com...
> Starmen wrote:
> >  I'm developing my own binary newsreader and I'm wondering what
> >  the maximum length of the 'subject' field in an article header
> >  is.
>
> In short: There is none.
>
> > I've been trying to find information on the net but I haven't been
> > able to find it.
>
> You are developing a program without knowing any specification about
> the topic? (Ok, rhetorical question. That seems to be normal these
> days.)
>
> Basic format:
> RFC  822 <http://www.ietf.org/rfc/rfc822.txt>
> RFC 1036 <http://www.ietf.org/rfc/rfc1036.txt>
> RFC 2822 <http://www.ietf.org/rfc/rfc2822.txt>
> USEFOR draft
> <http://www.ietf.org/internet-drafts/draft-ietf-usefor-article-11.txt>
>
> Encoding and declaration of content:
> RFC 2045 <http://www.ietf.org/rfc/rfc2045.txt>
> RFC 2046 <http://www.ietf.org/rfc/rfc2046.txt>
> RFC 2047 <http://www.ietf.org/rfc/rfc2047.txt>
> RFC 2183 <http://www.ietf.org/rfc/rfc2183.txt>
> RFC 2231 <http://www.ietf.org/rfc/rfc2231.txt>
> Content-Type database
> <http://www.iana.org/assignments/media-types/index.html>
>
> Transport:
> RFC  977 <http://www.ietf.org/rfc/rfc977.txt>
> RFC 2980 <http://www.ietf.org/rfc/rfc2980.txt>
> NNTP draft
> <http://www.ietf.org/internet-drafts/draft-ietf-nntpext-base-20.txt>
>
> See also <http://www.tin.org/docs.html> for further references.
>
> > Currently I have the limit set at 160 characters, but I'm not sure
> > that this is enough.
>
> No. If folded and (if needed) encoded properly, there is no limit at
> all. (At least in theory.)
>

Re: Maximum length of 'subject' field in header ?
#67182
Author: Dirk Nimmich
Date: Sat, 15 Nov 2003 19:07
44 lines
3254 bytes
Starmen wrote:
> Of course I have studied a lot of information before I started
> developing !  But I never seemed to be able to find this
> particular piece of information because it is simply not there.

No limit mentioned => no limit intended.

> Often I also like to write some sample code to see whether
> specifications match with the real world (and more often than not
> they don't !).

You'll notice that this is even true for the references I gave you.
That's why you would have to deal with overlong subjects no matter
if there was a limit. For example, RFC 2047 imposes a limit on a
physical subject line (though not the subject's overall length) if
there is an encoded word in it, but this limit is often ignored.
(And especially speaking of usenet, the real world doesn't match the
specifications because they are simply not read or understood by
many developers.)

> Also, in real life a programmer cannot deal efficiently with
> theoretically unlimited data structures. Some limits are imposed
> sooner or later to avoid the 'claim <unlimited> amount of memory
> to hold potentially <unlimited> long subject lines' problem.

Correct. That's why I added the "in theory".

> I'm trying to find the common denominator which will enable my
> program to catch 99.999 % of all articles. I will gladly pass over
> the 0.001 % that chooses to use insanely long subject lines and
> let the usenet community flame them into never doing it again.

Well, in tin we had an old 2048 byte limit somewhere and got caught
recently. Even if the author is flamed down that shouldn't cause any
problems for the reader using your (or our) tool.

> I need to impose some limits because I'm storing article subject
> lines into a database which only handles fixed-length
> datastructures.

That's ok. But you should be prepared to encounter postings that
have _very_ long lines even if you cut them somewhere and ignore the
rest.
Re: Maximum length of 'subject' field in header ?
#67184
Author: Starmen
Date: Sat, 15 Nov 2003 19:25
56 lines
3596 bytes
I'll stick to 200 characters for now and see whether this poses any real
problems.

Thanks for your help and comments Dirk.

Regards,
Starmen

"Dirk Nimmich" <nimmich@muenster.de> wrote in message
news:bp5tid$jpv$02$1@news.t-online.com...
> Starmen wrote:
> > Of course I have studied a lot of information before I started
> > developing !  But I never seemed to be able to find this
> > particular piece of information because it is simply not there.
>
> No limit mentioned => no limit intended.
>
> > Often I also like to write some sample code to see whether
> > specifications match with the real world (and more often than not
> > they don't !).
>
> You'll notice that this is even true for the references I gave you.
> That's why you would have to deal with overlong subjects no matter
> if there was a limit. For example, RFC 2047 imposes a limit on a
> physical subject line (though not the subject's overall length) if
> there is an encoded word in it, but this limit is often ignored.
> (And especially speaking of usenet, the real world doesn't match the
> specifications because they are simply not read or understood by
> many developers.)
>
> > Also, in real life a programmer cannot deal efficiently with
> > theoretically unlimited data structures. Some limits are imposed
> > sooner or later to avoid the 'claim <unlimited> amount of memory
> > to hold potentially <unlimited> long subject lines' problem.
>
> Correct. That's why I added the "in theory".
>
> > I'm trying to find the common denominator which will enable my
> > program to catch 99.999 % of all articles. I will gladly pass over
> > the 0.001 % that chooses to use insanely long subject lines and
> > let the usenet community flame them into never doing it again.
>
> Well, in tin we had an old 2048 byte limit somewhere and got caught
> recently. Even if the author is flamed down that shouldn't cause any
> problems for the reader using your (or our) tool.
>
> > I need to impose some limits because I'm storing article subject
> > lines into a database which only handles fixed-length
> > datastructures.
>
> That's ok. But you should be prepared to encounter postings that
> have _very_ long lines even if you cut them somewhere and ignore the
> rest.
>

Re: Maximum length of 'subject' field in header ?
#67185
Author: J.B. Moreno
Date: Mon, 17 Nov 2003 03:15
11 lines
1624 bytes
Starmen <someone@microsoft.com> wrote:

> I'll stick to 200 characters for now and see whether this poses any real
> problems.

Assuming your program gets used, that *will* be a problem -- Dirk gave
a lot of references for his answer, I'm not going to do that (partially
because I don't think you're really interested in that): 998+CRLF.

-- 
J.B. Moreno
Re: Maximum length of 'subject' field in header ?
#67222
Author: Solo
Date: Fri, 21 Nov 2003 22:59
21 lines
2119 bytes
"J.B. Moreno" <planb@newsreaders.com> wrote in message news:161120032215152306%planb@newsreaders.com...
> Starmen <someone@microsoft.com> wrote:
>
> > I'll stick to 200 characters for now and see whether this poses any real
> > problems.
>
> Assuming your program gets used, that *will* be a problem -- Dirk gave
> a lot of references for his answer, I'm not going to do that (partially
> because I don't think you're really interested in that): 998+CRLF.
>
> -- 
> J.B. Moreno


Seems if the guy is using a database it wouldn't be that
hard to create 2 fields, one of fixed length, and another
to accept the overflow in the rare case that a subject is longer.


Re: Maximum length of 'subject' field in header ?
#67225
Author: Dirk Nimmich
Date: Sat, 22 Nov 2003 11:41
23 lines
2440 bytes
Solo wrote:
> "J.B. Moreno" <planb@newsreaders.com> wrote
>> Starmen <someone@microsoft.com> wrote:
>>
>> > I'll stick to 200 characters for now and see whether this poses any real
>> > problems.
>>
>> Assuming your program gets used, that *will* be a problem -- Dirk gave
>> a lot of references for his answer, I'm not going to do that (partially
>> because I don't think you're really interested in that): 998+CRLF.

That's only the length of a physical line. The subject line as a
whole can be much longer.

> Seems if the guy is using a database it wouldn't be that
> hard to create 2 fields, one of fixed length, and another
> to accept the overflow in the rare case that a subject is longer.

There is nothing wrong with storing only 200 bytes/octets (not
characters, characters can span over several bytes) in his database.
But he must be aware of lines being longer than that or folded when
he reads them in from an untrusted source (= news server).
asefdfgjksdfjglsdjgdsfgasefdfgjksdfjglsdjgdsfgasefdfgjksdfjglsdjgdsfgasefdfgjksdfjglsdjgdsfgasefdfgjksdfjglsdjgdsfgasefdfgjksdfj...
#67227
Author: Solo
Date: Sat, 22 Nov 2003 17:34
34 lines
3034 bytes
"Dirk Nimmich" <nimmich@muenster.de> wrote in message news:bpni25$222$04$1@news.t-online.com...
> Solo wrote:
> > "J.B. Moreno" <planb@newsreaders.com> wrote
> >> Starmen <someone@microsoft.com> wrote:
> >>
> >> > I'll stick to 200 characters for now and see whether this poses any real
> >> > problems.
> >>
> >> Assuming your program gets used, that *will* be a problem -- Dirk gave
> >> a lot of references for his answer, I'm not going to do that (partially
> >> because I don't think you're really interested in that): 998+CRLF.
>
> That's only the length of a physical line. The subject line as a
> whole can be much longer.
>
> > Seems if the guy is using a database it wouldn't be that
> > hard to create 2 fields, one of fixed length, and another
> > to accept the overflow in the rare case that a subject is longer.
>
> There is nothing wrong with storing only 200 bytes/octets (not
> characters, characters can span over several bytes) in his database.
> But he must be aware of lines being longer than that or folded when
> he reads them in from an untrusted source (= news server).
>

Especially to the extent that his program doesn't crash
when someone is a bit wordy...

Ultimately, most news clients limit, and seems like a
good thing when there are discussions like this... :-)


Re: Maximum length of 'subject' field in header ?
#67230
Author: J.B. Moreno
Date: Mon, 24 Nov 2003 09:09
39 lines
2978 bytes
Dirk Nimmich <nimmich@muenster.de> wrote:

> Solo wrote:
> > "J.B. Moreno" <planb@newsreaders.com> wrote
> >> Starmen <someone@microsoft.com> wrote:
> >>
> >> > I'll stick to 200 characters for now and see whether this poses any real
> >> > problems.
> >>
> >> Assuming your program gets used, that *will* be a problem -- Dirk gave
> >> a lot of references for his answer, I'm not going to do that (partially
> >> because I don't think you're really interested in that): 998+CRLF.
> 
> That's only the length of a physical line. The subject line as a
> whole can be much longer.

Theoretically yes, but for sending it might run into practical
problems, and it's a safe max for storage.

> > Seems if the guy is using a database it wouldn't be that
> > hard to create 2 fields, one of fixed length, and another
> > to accept the overflow in the rare case that a subject is longer.
> 
> There is nothing wrong with storing only 200 bytes/octets (not
> characters, characters can span over several bytes) in his database.

He's doing binaries, I've seen plenty of binaries with Subjects longer
than that -- storing just 200 will be a problem.

> But he must be aware of lines being longer than that or folded when
> he reads them in from an untrusted source (= news server).

True.  You need to do proper error correction, if no other reason then
because you're bound to run into a corrupted article at some point
where the Subject is the last "good" header, and everything else gets
stuffed into it.

-- 
J.B. Moreno
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