See http://www.ietf.org/rfc/rfc0822.txt.
For comments about long header fields, take special notice of section 3.1.1.
According to RFC 822, header fields have been defined as follows (* means multiple, 1* means multiple, at least one):
field = field-name ":" [ field-body ] CRLF
field-name = 1*<any CHAR, excluding CTLs, SPACE, and ":">
field-body = field-body-contents
[CRLF LWSP-char field-body]
field-body-contents =
<the ASCII characters making up the field-body, as
defined in the following sections, and consisting
of combinations of atom, quoted-string, and
specials tokens, or else consisting of texts>
LWSP-char = SPACE / HTAB ; semantics = SPACE
linear-white-space = 1*([CRLF] LWSP-char) ; semantics = SPACE
; CRLF => folding
Please note a little slip of the pen made by the author of the RFC: in section 3.1.1 and further on in the text, he's talking about AT LEAST one LWSP-char, so he creates the tag 'linear-white-space'. But, in field-body, he uses 'LWSP-char' where he meant linear-white-space.
So, to answer your first question, every header field, including the Subject: field, can be unlimited in length.
Please note that the syntax does not explicily allow for spaces between the colon and the field-body. Nevertheless, in the examples given in Appendix A of RFC 822 these spaces are there just like LSoft does:
A.3.3. About as complex as you're going to get
Date : 27 Aug 76 0932 PDT
From : Ken Davis <[log in to unmask]>
Subject : Re: The Syntax in the RFC
Sender : KSecy@Other-Host
Reply-To : [log in to unmask]
To : George Jones <[log in to unmask]>,
[log in to unmask]
cc : Important folk:
Tom Softwood <[log in to unmask]>,
"Sam Irving"@Other-Host;,
Standard Distribution:
/main/davis/people/standard@Other-Host,
"<Jones>standard.dist.3"@Tops-20-Host>;
Comment : Sam is away on business. He asked me to handle
his mail for him. He'll be able to provide a
more accurate explanation when he returns
next week.
In-Reply-To: <[log in to unmask]>, George's message
X-Special-action: This is a sample of user-defined field-
names. There could also be a field-name
"Special-action", but its name might later be
preempted
Message-ID: <4231.629.XYzi-What@Other-Host>
To answer your second question, we have to look at section 4.1:
message = fields *( CRLF *text ) ; Everything after
; first null line
; is message body
fields = dates ; Creation time,
source ; author id & one
1*destination ; address required
*optional-field ; others optional
optional-field =
/ "Message-ID" ":" msg-id
/ "Resent-Message-ID" ":" msg-id
/ "In-Reply-To" ":" *(phrase / msg-id)
/ "References" ":" *(phrase / msg-id)
/ "Keywords" ":" #phrase
/ "Subject" ":" *text
/ "Comments" ":" *text
/ "Encrypted" ":" 1#2word
/ extension-field ; To be defined
/ user-defined-field ; May be pre-empted
Subject is an optional field, and there can be any number of optional fields. RFC 822 thus allows you to have more than one Subject: header.
Regards,
FrankL
> -----Oorspronkelijk bericht-----
> Van: Ballew Kinnaman [mailto:[log in to unmask]]
> Verzonden: zaterdag 8 december 2001 21:38
> Aan: LSTSRV-L
> Onderwerp: Re: [LSTSRV-L] prepending spaces to the subject line
>
>
> Dear FrankL and LSTSRV-L Folks,
>
> >line when the subject is too long to fit on one RFC822 header
> >line. It creates 'new' subjects and by doing that it spoils
> >threads in the archives.
> >
> >FrankL
>
> Okay, I'll bite. How long does RFC 822 say your
> Subject: line can (or can't) be?
>
> <smirk, scowl>
>
> What is this software that creates a SECOND
> Subject: line for a single message? <!>
>
> And, while we're at it, how does RFC 822 feel
> about having two or more Subject: lines on one
> message? That sounds like something RFC 822
> should be clear about...
>
> Pax,
> Ballew Kinnaman <[log in to unmask]> 206/463-2322
> Discussion list owner:
> Allergy ---> http://www.Immune.Com/allergy/index.html
> Arthritis ---> http://www.Emissary.Net/arthritis/index.html
> PCHealth ---> http://www.Emissary.Net/pchealth/index.html
> Latex Allergy ---> http://www.Immune.Com/rubber/index.html
> Thyroid ---> http://www.Emissary.Net/thyroid/index.html
>
>
|