rss
logo

I provide consulting and custom development for Natural Language Processing, Information Extraction and Search solutions.Self Picture


 learn more   get in touch 

Logo - I Build Search
Jan 19
2009

Exporting Opera email to mbox format digg

The following snippet combines the various opera mbs into one mbox format which can be used by other email clients like Evolution to import mail

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python
# Quick hack to merge all opera mbs files into mbox format which can
# then be used by other email clients to import Opera email.
# by Pravin Paratey (January 19, 2009)
 
import os
 
# Change this value
folder = '/home/pravin/.opera/mail/store/account1/'
 
fp = open('combined.mbox', 'a')
 
for d0 in os.listdir(folder):
	p0 = os.path.join(folder,d0)
	if os.path.isfile(p0): continue
	for d1 in os.listdir(p0):
		p1 = os.path.join(p0, d1)
		for d2 in os.listdir(p1):
			p2 = os.path.join(p1, d2)
			for f in os.listdir(p2):
				fp2 = open(os.path.join(p2, f), 'r')
				fp.write(fp2.read())
				fp2.close()
fp.close()

2 Responses (rss) (trackback)

#1

neumayr

May 27th, 2009 at 7:01 am

Works as advertised, thanks for sharing.
I don’t get why Opera doesn’t include a way to export messages into some commonly accepted format..

#2

Joel

June 9th, 2009 at 8:28 pm

Surely you can just use find and cat on any *NIX box…

How does this handle differentiation between incoming and outgoing mail?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Latest Articles

Apr
07

Palindromic sub-sequences in python

This bit of python code returns all palindromic subsequences in the input string.

[Read More]
Feb
19

Join a list of integers in Python

How do you run a string join on a list of integers in Python? After googling for about 10 mins, I gave up and did this. I am sure there is a better way of doing it!

[Read More]

Featured Projects

NLP classes for PHP

NLP classes for PHP

This is an ongoing project to develop a set of classes for Natural Language Processing. Some code would be ported from the NLTK project.

[Read More]

Indic to English Transliterator

Indic to English Transliterator

Transliteration is the process of converting a word from one language to another while retaining its phonetic characteristics. This application lets you convert a word from any major Indian language (currently supports Hindi, Marathi, Sanskrit and Bengali) to English.

[Read More]

This page and its contents are copyright © 2010, Pravin Paratey.