Questions tagged [mbox]

mbox is a generic term for a family of related file formats used for holding collections of electronic mail messages

All messages in an mbox mailbox are concatenated and stored as plain text in a single file. The beginning of each message is indicated by a line whose first five characters consist of "From" followed by a space (the so named "From_ line" or "'From ' line" or simply "From line") and the sender's e-mail address. A blank line is appended to the end of each message. For a while, the mbox format was popular because text processing tools can be readily used on the plain text files used to store the e-mail messages.

(source)

110 questions
4
votes
1 answer

Decode and access mbox file with mbox Python mdule

I need to migrate an email database to a CRMand have 2 problems: I get to access the mbox file but the content is not properly decoded. I want to create a dataframe like structure with following columns: "date, from, to, subject, body" I have tried…
Lucas
  • 549
  • 1
  • 4
  • 16
4
votes
1 answer

Python mailbox on large mbox datasets

I am using the python package mailbox, and I am trying to extract the messages and clean the data. I am running into the problem that for large databases, I can call the constructor with my sample file, but when I try to print any messages my…
user3696321
  • 137
  • 8
3
votes
4 answers

parsing mailbox (mbox or mbx) php

I need to parse mbox or email files using php, that is i would pass a file .mbox or .eml that contains several emails and parse it into its constituents e.g from, to, bcc etc. is there any library that does it, or any code on how to do this in…
Smith
  • 5,765
  • 17
  • 102
  • 161
3
votes
1 answer

Python 3.6 Mbox to CSV

I'm trying to write a script that will convert each email element of an .mbox file into a .csv file. I specifically need the following elements, but if there was a way to "write for each element," that'd be preferred: To, From, CC'd, BCC'd, Date,…
dnlarralde
  • 77
  • 1
  • 2
  • 12
3
votes
1 answer

Fetching emails from Gmail as mbox format in Zend Mail

I am working on an email project using Zend Mail. I have successfully fetched all folders of Gmail with emails and attachments. But I cannot figure out how to download emails as mbox format? Do I need to use file handling to create mbox or there is…
3
votes
1 answer

How to extract email fields from headers with awk or grep

Regarding: mailbox (mbox format) email messages Multi Message File: Inbox.mbox From - Thu Mar 26 16:16:21 2015 From: Mail Delivery System To: edge@notterribe.org Subject: Mail delivery failed: returning message to…
voiczed
  • 65
  • 2
  • 6
3
votes
2 answers

Saving IMAP messages with Python mailbox module

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",…
Basj
  • 41,386
  • 99
  • 383
  • 673
3
votes
2 answers

How to parse a Mbox file with JavaMail API?

I want to use JavaMail to parse an .mbox file just like this one http://mail-archives.apache.org/mod_mbox/lucene-java-user/201210.mbox. What I thought of doing was: Session session = Session.getDefaultInstance(new Properties()); Store store =…
Xipo
  • 1,765
  • 1
  • 16
  • 23
3
votes
3 answers

How to parse mailbox file in Ruby?

The Ruby gem rmail has methods to parse a mailbox file on local disk. Unfortunately this gem has broken (in Ruby 2.0.0). It might not get fixed, because folks are migrating to the gem mail. Gem mail has method Mail.read('filename.txt'), but that…
Camille Goudeseune
  • 2,934
  • 2
  • 35
  • 56
3
votes
2 answers

Convert simple emaildump to maildir or mbox format

In OTRS I've got a database with emails. I have the raw emails (in eml format) in a table called "article_plain". I can easily do a dump of this using a statement like: SELECT ap.body FROM article_plain ap INNER JOIN article a ON (a.id =…
Johan
  • 74,508
  • 24
  • 191
  • 319
3
votes
3 answers

How can I remove duplicates (deduplicate) a mbox format email mailbox?

I've got a mbox mailbox containing duplicate copies of messages, which differ only in their "X-Evolution:" header. I want to remove the duplicate ones, in as quick and simple a way as possible. It seems like this would have been written already, but…
JesseW
  • 1,255
  • 11
  • 19
2
votes
1 answer

What's the difference between a class and an ID in Omniture Test & Target?

I've been searching everywhere but cannot find the answer I am looking for, if anyone can enlighten me, it would be very much appreciated. What's the difference between a class and an ID in Omniture Test & Target, and when to use each one? Also what…
Van Nguyen
  • 682
  • 3
  • 11
  • 21
2
votes
1 answer

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

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…
new_snake
  • 21
  • 1
2
votes
1 answer

mime extracted emails back to mbox format

I have a special mbox file where each message in the mbox is has one or more attached messages. These were created from being forwarded as an attachment. I have a perl script that uses MIME::Tools and MIME::Parser to parse that mbox file. It can…
shorton
  • 323
  • 3
  • 13
2
votes
1 answer

Spark to analyse large mbox Mailbox file using map reduce in Python

I have large mbox file which I can parse using the mailbox api and dump to csv import mailbox import csv mbox = mailbox.mbox("emailfile.mbox") for message in mbox: with open('mail.csv','w') as fp: writer = csv.writer(fp,delimiter=',') for…
bbalegere
  • 141
  • 3