Most viewed Python recipes tagged "meta:requires=email.parser"http://code.activestate.com/recipes/langs/python/tags/meta:requires=email.parser/views/2013-09-07T10:24:17-07:00ActiveState Code RecipesUsing the email module to recursively unpack a multipart MIME message (simpler method) (Python)
2001-11-03T14:16:16-08:00Matthew Cowleshttp://code.activestate.com/recipes/users/139430/http://code.activestate.com/recipes/86676-using-the-email-module-to-recursively-unpack-a-mul/
<p style="color: grey">
Python
recipe 86676
by <a href="/recipes/users/139430/">Matthew Cowles</a>
(<a href="/recipes/tags/network/">network</a>).
</p>
<p>An example of using the email module to unpack and decode a MIME message. This
example uses the message's walk() method.</p>
extract emails from a mbox read on stdin (Python)
2013-09-07T10:24:17-07:00Romain Dartigueshttp://code.activestate.com/recipes/users/4167472/http://code.activestate.com/recipes/576553-extract-emails-from-a-mbox-read-on-stdin/
<p style="color: grey">
Python
recipe 576553
by <a href="/recipes/users/4167472/">Romain Dartigues</a>
(<a href="/recipes/tags/email/">email</a>, <a href="/recipes/tags/generators/">generators</a>, <a href="/recipes/tags/mbox/">mbox</a>, <a href="/recipes/tags/read_only/">read_only</a>, <a href="/recipes/tags/stdin/">stdin</a>).
Revision 2.
</p>
<p>The Python <code>mailbox.mbox</code> class require a real file to initialize, which was an issue in my case. These simple functions let you iter through a mailbox read from a read-only file descriptor (like <code>sys.stdin</code>).</p>
<p>This script use the generators which were introduced in Python-2.2. Let me know if you are interested a similar functionnality on older Python versions.</p>
Using the email module to recursively unpack a multipart MIME message (Python)
2001-11-03T14:12:23-08:00Matthew Cowleshttp://code.activestate.com/recipes/users/139430/http://code.activestate.com/recipes/86675-using-the-email-module-to-recursively-unpack-a-mul/
<p style="color: grey">
Python
recipe 86675
by <a href="/recipes/users/139430/">Matthew Cowles</a>
(<a href="/recipes/tags/network/">network</a>).
</p>
<p>An example of using the email module to unpack and decode a MIME message.</p>