SMTP Headers: How to parse

  • Thread starter Thread starter Howard Kaikow
  • Start date Start date
Howard Kaikow said:
I can get al the headers using the technique in
http://support.microsoft.com/default.aspx?scid=kb;en-us;194870, but
how can I then separate out the individual headers? SPLIT using vbcrlf
is not adequate as a header could take more than one line.

See ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt, section 2.2.3;

"The process of moving from this folded multiple-line representation
of a header field to its single line representation is called
"unfolding". Unfolding is accomplished by simply removing any CRLF
that is immediately followed by [whitespace]"

-- dan
 
Dan Mitchell said:
Howard Kaikow said:
I can get al the headers using the technique in
http://support.microsoft.com/default.aspx?scid=kb;en-us;194870, but
how can I then separate out the individual headers? SPLIT using vbcrlf
is not adequate as a header could take more than one line.

See ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt, section 2.2.3;

"The process of moving from this folded multiple-line representation
of a header field to its single line representation is called
"unfolding". Unfolding is accomplished by simply removing any CRLF
that is immediately followed by [whitespace]"

Thanx.
 
Dan Mitchell said:
Howard Kaikow said:
I can get al the headers using the technique in
http://support.microsoft.com/default.aspx?scid=kb;en-us;194870, but
how can I then separate out the individual headers? SPLIT using vbcrlf
is not adequate as a header could take more than one line.

See ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt, section 2.2.3;

"The process of moving from this folded multiple-line representation
of a header field to its single line representation is called
"unfolding". Unfolding is accomplished by simply removing any CRLF
that is immediately followed by [whitespace]"

An earlier version of RFC 822 includes the definition of whitespace.
For RFC 2822, it appears necessary to check RFC 2234.

Seems the relevant charaxters are space and horizontal tab.
 
Back
Top