bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC 822 address parsing


From: Sam Roberts
Subject: RFC 822 address parsing
Date: Wed, 7 Mar 2001 00:57:44 -0500
User-agent: Mutt/1.3.16i

Attached is the beginnings of some documentation for the address
parsing functions, and some comments on things I think would
be useful.

I've started poking through the address parsing, and porting
an RFC822 address parser I wrote in C++ to C, mostly a tedious
task of converting levels of indirection in references, though
it is also made easier if I have an api that dynamically grows
a buffer as characters and strings are appended to it. Is
this code performance critical enough that realloc is considered
slow?

Alain, you've seen my parser.

I like it, I think it's easy to read, and follows the
structure of the EBNF in the spec closely enough that its
easy to convince yourself it works. It uses recursive
decent parsing, though, not iteration, and de-escape
stuffs comments and quoted strings as it finds them.

Is any of this interesting or horrifying? In my attached comments
you'll see my interest is in supporting more of the rfc address
syntax, groups in particular.

Also, I read the Sieve RFC last night, and it allows matching
based on the localpart or domain of an address, so it will
need to access them seperately, it'll also need to descape
the local part so it can perform matches against it. And,
since Sieve doesn't support groups, other than considering them
to be a list of addresses, I think my comments suggest an
API that would present groups it had parsed as just an
address list, perhaps part of a larger address list.

Sam

-- 
Sam Roberts <address@hidden> (http://www.emyr.net/Sam)

Attachment: mailutils.texi.diff
Description: Text document

Attachment: address.texi
Description: TeXInfo document

Attachment: address.h
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]