mailbox multipart

J

janwillem

I am trying to analyze mailboxes using an iterator:
for key, message in mbox.iteritems():

When message is a simple mail message['date'] results the date.
When, however, it is a multipart message this results in None. How can
you full proof get the "date", "from" and "to" of of a multipart mail
using python?
Thanks janwillem
 
J

janwillem

janwillem said:
I am trying to analyze mailboxes using an iterator:
   for key, message in mbox.iteritems():
When message is a simple mail message['date']  results the date.
When, however, it is a multipart message this results in None. How can
you full proof get the "date", "from" and "to" of of a multipart mail
using python?

Perhaps you should post your code.  There's no particular reason why you
should see this.  The mailbox iterator should return the outer multipart
container, which has the headers.

Thanks Tim,
There you have a point, after I find it is a multipart message I dive
into it recursively and so loose the outer header info. That was all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top