[Twisted-Python] Re: IMAP fixes

Tony Meyer ta-meyer at ihug.co.nz
Wed Jul 9 00:47:57 EDT 2003

> > For example, this command:
>     0003 FETCH 1 BODY.PEEK[HEADER.FIELDS (References X-Ref)] UID
> Ideally, I'd like to see this parsed into a structure 
> resembling this:
>     [Header(peek=1, name=1, value=1, ['References', 'X-Ref']), UID()]
> Would you be interested in patching the fetch methods to 
> generate a structure like the one I described above?

This command now becomes:
    ["BODY(PEEK=1, HEADER=1, FIELDS=1, fielditems=['References', 'X-Ref'])",

Is this suitable?  I presume(d) from the structure that you suggested that
one way of handling this would be to then exec each element (having a
BODY(), UID function, and so on).

If there are problems with this, I'm happy to make changes.  I wrote it
against the RFC, so there may be things that need to be changed if there are
clients that do things illegally that are meant to be supported.  It also
_only_ supports rfc2060, not any extra additions, although if they are
simple ones or macros then it would be easy to simply append them to the
appropriate list.

Anyway, here it is, let me know what you think.

=Tony Meyer
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fetch_att.py
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20030709/4fea0991/attachment.txt 

More information about the Twisted-Python mailing list