bug-mailutils
[Top][All Lists]
Advanced

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

Re: RFC 822 address parsing


From: Alain Magloire
Subject: Re: RFC 822 address parsing
Date: Thu, 8 Mar 2001 00:12:21 -0500 (EST)

Bonjour

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

I will print them out tomorrow.

> 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?

It depends, so far my experience shows where it counts is parsing
of the mailbox; pine/c-client kick ass, elm is close behind, mutt
falls way behind, dog slow.  Then again not everybody carries a
~30Meg mailbox except maybe Jeff.  A typical 200-600 messages mailbox
a few second more or less is not a big deal.

But once this is done, at work on my pentium 1GHZ 384M(512 now) of RAM,
I sincerly do not feel a difference.

For the POP server, it does not care.  The IMAP server will, it is
part of the address fields.  But then again the network is the bottleneck.
It may affect a client using a list to display the headers.

> 
> Alain, you've seen my parser.

Yes.

> 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

8-) Agreed.

> 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.

I'm currently busy with GNU grep tonight, see
ftp://alpha.gnu.org/gnu/grep/grep-2.5e.tar.gz
I'll take a look tomorrow.

Thanks for the patches.

--
alain




reply via email to

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