mbox

Python 3.1.3 open mbox file, really slow compared to python 2.x?

会有一股神秘感。 提交于 2019-12-01 22:58:26
I tried in python 3.1.3 to open an mbox file, with the mailbox module. There are only 3 mails in it and it is only 27k big. But when reading the mails my CPU uses 100% for about 2-3 minutes, until it completes it task without an error. I tried the same with python 2.7.1 and it takes only about 1-2 seconds?! Did I found ah bug or I'm doing something wrong? I also tested this on windows and linux, same results :(. Here's the code I used, from the docs: import mailbox for message in mailbox.mbox('~/mbox'): subject = message['subject'] # Could possibly be None. if subject and 'python' in subject

Reading an mbox file in C#

喜欢而已 提交于 2019-12-01 07:38:54
One of our staff members has lost his mailbox but luckily has a dump of his email in mbox format. I need to somehow get all the messages inside the mbox file and squirt them into our tech support database (as its a custom tool there are no import tools available). I've found SharpMimeTools which breaks down a message but not allow you to iterate through a bunch of messages in a mbox file. Does anyone know of a decent parser thats open without having to learn the RFC to write one out? I don't know any parser, but mbox is really a very simple format. A new email begins on lines starting with

Reading an mbox file in C#

荒凉一梦 提交于 2019-12-01 05:20:44
问题 One of our staff members has lost his mailbox but luckily has a dump of his email in mbox format. I need to somehow get all the messages inside the mbox file and squirt them into our tech support database (as its a custom tool there are no import tools available). I've found SharpMimeTools which breaks down a message but not allow you to iterate through a bunch of messages in a mbox file. Does anyone know of a decent parser thats open without having to learn the RFC to write one out? 回答1: I

Reading the mail content of an mbox file using python mailbox

只谈情不闲聊 提交于 2019-11-30 17:46:34
I am trying to print the content of the mail ( Mail body) using Python mailbox. import mailbox mbox = mailbox.mbox('Inbox') i=1 for message in mbox: print i print "from :",message['from'] print "subject:",message['subject'] print "message:",message['**messages**'] print "**************************************" i+=1 But I feel message[' messages '] is not the right one to print the mail content here. I could not understand it from the documentation To get the message content, you want to use get_payload() . mailbox.Message is a subclass of email.message.Message . You'll also want to check is