any code for parsing the values of mail headers like Content-Disposition?

Bill Janssen janssen at parc.xerox.com
Fri Feb 18 14:49:53 EST 2000


Hi, folks.  I'm looking for code to parse the value of headers like
Content-Disposition, which are of the form

  Content-Disposition: attachment; filename="foo.txt", charset=iso-8859-1

Ideally, I'd like a routine which would return a 2-ple of the
disposition, as a string, plus a dictionary containing all of the
parameters, with touches like having the quoting strings stipped from
around "foo.txt".  I'm familiar with the rfc822 and mhlib packages,
but there may be code like this in another package that I haven't come
across.  Does anyone know of such?

Thanks.

Bill




More information about the Python-list mailing list