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
0
votes
1 answer

How to extract all email headers and only the headers from an mbox (email) file containing many emails?

How can one extract all email headers and only the headers from an mbox (email) file containing many emails?
Johnny Utahh
  • 2,389
  • 3
  • 25
  • 41
0
votes
1 answer

Mail_Mbox() PEAR script - load mbox message from string instead of file

It works great if I try to load from a file, but I'm working with mbox formatted messages previously stored in a MySQL table. I've loaded the message into a $variable and for whatever reason it doesn't want to accept it. Any ideas? Sample…
Will Ashworth
  • 1,058
  • 3
  • 13
  • 28
0
votes
1 answer

Python unable to add message into Thunderbird Mbox

I am using python 2.7 on ubuntu 16.04. I have been using python to read emails out of mbox files on my pc which were created by thunderbird. I now want to add messages into those mbox files. I shut down thunderbird and then I try to run my python…
Jan Lamprecht
  • 71
  • 1
  • 1
  • 2
0
votes
1 answer

Show the full original source of an email with Python

The main answer of Reading the mail content of an mbox file using python mailbox shows how to display the content of an email from a .mbox file: if message.is_multipart(): content = ''.join(part.get_payload(decode=True) for part in…
Basj
  • 41,386
  • 99
  • 383
  • 673
0
votes
2 answers

I can't find a way to compare the body of emails in python because some of the email contains extra license messages in the end

I have a problem to compare body emails in python. I get the body from text files that contain emails and populate the list with the body of emails: for enum in original_list: with open(enum, 'r') as f: enum = f.read() msg =…
shpeki
  • 1
0
votes
1 answer

How to concatenate a json.dumps output with a string

Summary I am attempting to concatenate the output of json.dumps - converting part dictionary variable, that has been passed from a client to a server, to a string - with a string, before passing it to a variable where it defines the name of a mbox…
0
votes
1 answer

reading mbox files using python and batch

Hello I have the following two scripts where a batch script calls a python script that prints the last email in a mbox file.But an error pops up in command window name msg is not defined How can I initialize an mbox variable to execute my script?…
mamadou
  • 135
  • 2
  • 13
0
votes
1 answer

Extract the last mail from a mbox file

I have a mbox file that contains many emails,I tried this code that typically reads all messages,what i want is to read and print only the last email of the mbox file and store it alone in another mbox file. This is the simple code that I wrote:…
mamadou
  • 135
  • 2
  • 13
0
votes
1 answer

AWK to Python For Mbox

What would be the best Pythonic way of implementing this awk command in python? awk 'BEGIN{chunk=0} /^From /{msgs++;if(msgs==500){msgs=0;chunk++}}{print > "chunk_" chunk ".txt"}' mbox I'm using this now to split up enormous mailbox (mbox format)…
ganicus
  • 321
  • 5
  • 12
0
votes
0 answers

Use Python on Windows OS to convert Outlook Data File (.pst) to mbox

I'm having trouble figuring out how to convert an Outlook Data File (.pst file extension) to an mbox file using Python on Windows. On Mac, it was relatively straightforward - just install libpst and then use the following. def…
Tony Ojeda
  • 53
  • 1
  • 8
0
votes
1 answer

How to handle Spam Deleting in ReactJs

I have a list of items that each have a trash can beside them(ie delete button). Since there are so many possible results I display 25 results and then page the rest(when a user clicks the next page button at this time I get the next…
chobo2
  • 83,322
  • 195
  • 530
  • 832
0
votes
1 answer

Mozilla Thunderbird: recovering emails from global-messages-db.sqlite

How can I recover lost emails from Thunderbird's global-messages-db.sqlite? My PC kernel panicked in the middle of migrating some emails from Imap to local storage. As a result, that migration did not complete writing to disk. Due to the failed…
Rick Ramstetter
  • 332
  • 3
  • 9
0
votes
1 answer

non-recursive walk of email message from mailbox message

I'm trying to work with email messages in Python 3.7 and struggling with what looks like compatibility issues. The docs mention email.message.Message having an iter_parts method that should allow me to do a non-recursive walk of message parts. This…
Sam Mason
  • 15,216
  • 1
  • 41
  • 60
0
votes
1 answer

imap_fetchbody vs Gmail api get method

The return format of html imap_fetchbody vs Gmail api GET method are different. I write the emails to a file and then re-import into Thunderbird. With imap_fetchbody written emails are loaded into Thunderbird with no padding issues while the same…
Basheer Kharoti
  • 4,202
  • 5
  • 24
  • 50
0
votes
1 answer

Why doesn't this code using the ruby-mbox gem parse mbox files?

I installed ruby-mbox by doing gem install ruby-mbox Running this: #!/usr/bin/ruby require 'rubygems' require 'mbox' m = IO.read('test.eml') puts m.size m = Mbox.new(m) puts m produces this exception (at line…
Dafydd Rees
  • 6,941
  • 3
  • 39
  • 48