Difference between revisions of "HOWTO: Read Microsoft Outlook .MSG files in Linux"
Latest revision as of 00:02, 31 December 2011
How to read Microsoft Outlook .MSG files in Linux
I have literally thousands of .MSG files which I saved from Outlook Exchange Server several years ago and now want to access under Linux. However Linux e-mail clients cannot read or import Microsoft Outlook .MSG files or .PST files. Nope, not even Evolution, KMail or Thunderbird. At least with .PST files one could import them into Microsoft Outlook Express, export them in MBOX format and then import them into Evolution, KMail or Thunderbird.
But with Outlook .MSG files a guy named Matijs van Zuijlen came to the rescue with a Perl utility he calls "MSGConvert: A .MSG to mime/mbox converter". You can read about installing and using it on his Web site (http://www.matijs.net/software/msgconv/) but I thought I'd explain here how to install and use it, as his instructions may be confusing to newcomers to Linux and/or Perl.
Run the following commands when connected to the Internet, to download and install certain Perl modules and their dependencies from CPAN (Comprehensive Perl Archive Network):
perl -MCPAN -e 'install("Email::Outlook::Message")' perl -MCPAN -e 'install("Email::LocalDelivery")' perl -MCPAN -e 'install("Getopt::Long")' perl -MCPAN -e 'install("Pod::Usage")' perl -MCPAN -e 'install("File::Basename")'
Then download the Perl script msgconvert.pl (see the link "script itself" near the bottom of the above-mentioned Web page). I would suggest saving the script in your home directory.
2. Using MSGConvert
If the Microsoft Outlook .msg file you want to convert is called test_message.msg then you would type the following at the command line (not as root):
perl -w ~/msgconvert.pl ~/test_message.msg
and the file ~/test_message.msg.mime will be created.
If KMail does not open the .mime file, do the following:
a) select K Menu > Control Centre > KDE Components > File Associations
b) click on the "+" next to "message" to expand it
c) select rfc822
d) On the General tab, under Filename Patterns click on Add and add *.mime to the box and click Apply.
Notes for newcomers to Linux: 1. The tilde means "your home directory". So in my case I can type either "~/test_message.msg" or "/home/fitzcarraldo/test_message.msg". 2. Linux is case-sensitive, and test_message.msg and test_message.MSG are two different file names as far as Linux is concerned.
Article created by Fitzcarraldo on 30 April 2008.