[Python-Dev] imap bodystructure parser - email.message.Message extension

Barry Warsaw barry at python.org
Thu Jan 15 19:29:38 CET 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jan 15, 2009, at 7:58 AM, Stéphane Konstantaropoulos wrote:

> I wrote an extension to the imaplib library that implements a  
> "BODYSTRUCTURE"
> parser.
>
> For this I wrote an extension to email.message.Message that allows a  
> message
> structure to be loaded from imap, the message can be used like a  
> normal
> email.message.Message but the actual payload is only loaded on the  
> fly. This
> makes it much quicker for imap applications.
>
> The code is here if anyone fancies a try:
>
> http://voyageonline.co.uk/blog/article/python-imaplibx
>
> I though it might be useful as imaplib is very low level.

This sounds very interesting.  One of the things I'd hoped to do for  
the next version of the email package is actually design an API for  
remotely loading and saving the payloads.  Yours is one of the use  
cases I've thought of, but also being able to store the payload in a  
disk cache so as not to chew up memory for say, lots of big image  
attachments.

Unfortunately I don't have time right now to work on this, but I'll  
keep your message.  You should think about joining the email-sig and  
bringing this up there, if  you want to discuss such a generic API.

Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iQCVAwUBSW+AknEjvBPtnXfVAQIuKgP/SQcqJ+mdV7P9Euphb4kYPlqHKn6iUYTE
uMSNIUvf49Z3pMoup8fJmnOjbela7hCW0g1ZIERaMSrttIq0RNACsoA9GSulfi2M
upXp+IE0bGpnxrd0TNNs0DiRHSlerH7okqsix07CdOK2KR3iKBLPypmqWz5T4BpK
PJbOEdUWSwo=
=q0R0
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list