mbox

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

假装没事ソ 提交于 2019-12-20 03:41:30
问题 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

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

拥有回忆 提交于 2019-12-20 03:41:12
问题 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

Reading the mail content of an mbox file using python mailbox

旧巷老猫 提交于 2019-12-18 19:01:49
问题 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 回答1: To get the message content, you want to

Open local mbox mail archive with imap_open() in PHP

邮差的信 提交于 2019-12-11 19:30:41
问题 I'm attempting to read an mbox email archive exported from another server locally, via file access, but for whatever reason everything I've tried fails. Is there some magical trick to parse a local file and access it with PHP's built-in IMAP functionality? 回答1: You should be able to use PHP's built-in IMAP functionality. Have you tried something like this: function openLocal($file_path) { $mbox = imap_open("$file_path",'',''); if (!mbox) { $errorMsg = imap_last_error(); // do something with

How to read mbox email messages using mstor

此生再无相见时 提交于 2019-12-11 09:49:50
问题 I am using mstor to read the mbox email messages, but i am not able to connect to the store using the urlName name which i m passing, by default its connecting to other location on my macbine.Do i need to create the store using mstor JCR before proceed to connect to the store? Session session = Session.getDefaultInstance(new Properties()); Store store = session.getStore(new URLName("mstor:C:/mailbox/MyStore/Inbox")); store.connect(); Folder inbox = store.getDefaultFolder().getFolder("inbox");

pst格式文件转eml或mbox

不问归期 提交于 2019-12-10 19:58:35
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> readpst -D -S -M -b -j 10 -o 001 001.pst 把001.pst文件转换成eml格式的单独文件并存储到001这个文件夹中 来源: oschina 链接: https://my.oschina.net/u/274778/blog/693075

Saving IMAP messages with Python mailbox module

旧时模样 提交于 2019-12-10 11:05:38
问题 I'm downloading messages from IMAP with imaplib into a mbox (with mailbox module): import imaplib, mailbox svr = imaplib.IMAP4_SSL('imap.gmail.com') svr.login('myname@gmail.com', 'mypaswword') resp, [countstr] = svr.select("[Gmail]/All Mail", True) mbox = mailbox.mbox('mails.mbox') for n in range(...): resp, lst1 = svr.fetch(n, 'UID') # the UID of the message resp, lst2 = svr.fetch(n, '(RFC822)') # the message itself mbox.add(lst2[0][1]) # add the downloaded message to the mbox # # how to

How can I reorder an mbox file chronologically?

可紊 提交于 2019-12-04 14:21:58
I have a single spool mbox file that was created with evolution, containing a selection of emails that I wish to print. My problem is that the emails are not placed into the mbox file chronologically. I would like to know the best way to place order the files from first to last using bash, perl or python. I would like to oder by received for files addressed to me, and sent for files sent by me. Would it perhaps be easier to use maildir files or such? The emails currently exist in the format: From x@blah.com Fri Aug 12 09:34:09 2005 Message-ID: <42FBEE81.9090701@blah.com> Date: Fri, 12 Aug 2005

Extracting the body of an email from mbox file, decoding it to plain text regardless of Charset and Content Transfer Encoding

佐手、 提交于 2019-12-03 10:01:28
问题 I am trying to use Python 3 to extract the body of email messages from a thunderbird mbox file. It is an IMAP account. I would like to have the text part of the body of the email available to process as a unicode string. It should 'look like' the email does in Thunderbird, and not contain escaped characters such as \r\n =20 etc. I think that it is the Content Transfer Encodings that I don't know how to decode or remove. I receive emails with a variety of different Content Types, and different

Convert Maildir to mbox

北城以北 提交于 2019-12-03 05:19:58
问题 Im changing hosts and i need to convert my maildir accounts on my old server to mbox on my new server. Any ideas on the best way to do this? I found this: for i in new/* cur/*;do formail <”$i” >> ../mbox;done But i dont really understand it. I have a basic knowledge of linux and I have root access to my server via ssh. most of the Maildir folder have the following contents: cur new tmp dovecot.index.log dovecot-uidlist dovecot.index dovecot.index.log.2 dovecot.index.cache dovecot-keywords