ietf-822
[Top] [All Lists]

Re: RFC validation samples?

2004-08-05 17:09:01

Laird Breyer wrote:

I'm new to this list. I've started implementing a mail header
scanner/parser which will eventually be released under the GPL, as
part of a wider mail classification package I'm working on (homepage
on sourceforge: http://dbacl.sourceforge.net).

If you are going to classify message content, you'll need to be able
to parse the message body in addition to the header.  For MIME
messages, you'll also need to be able to handle MIME-part headers,
boundary delimiters, and body sections.  Including base64 and
quoted-printable encoded body content.

I'm really a newby on mail headers, but I've come across some
discrepancies in the RFC2821/RFC2822 grammars which led me to this
group.

There are indeed a few differences; Some are because RFC 2821 is
SMTP-specific whereas RFC 2822 is intended to be a general message
format (so, for example, RFC 2822 has a very loose definition of
"domain-literal" and of the Received header field).  A very few
are genuine incompatibilities (likely to be corrected in the next
revisions, due soon).

My current subgoal is to validate each header line separately
according to the four standards 821/288/2821/2822 and any other
relevant ones. So each header line will be marked by all the standards
which apply.

There are a few dozen relevant RFCs (depending on what types of
messages you want to be able to handle, at what level of detail,
whether or not you want to be able to handle "old" messages, and
if so, how old, etc.).  Also, don't forget to look at the RFC
Errata page (http://www.rfc-editor.org/errata.html), as there
are some errors in published RFCs.

What I would like to know is if there are any publicly available
validation sample messages which I can use to check correctness of my
parser.  Apologies if this has been discussed on the list before, I
have only skimmed the archives. Any other comments and pointers welcome.

There is an open-source validating parser available at
http://users.erols.com/blilly/mparse.  It may do what you want,
and if not, the package does contain several dozen test messages,
many of them taken directly from the relevant RFCs (with
correction per the errata in most cases).


<Prev in Thread] Current Thread [Next in Thread>