MS Outlook to Unix Mailbox Conversion mini HOWTO Greg Lindahl, lindahl@pbm.com 1.0.1, 2001-01-26 This MiniHowto covers conversion of old email in Microsoft Outlook (not Outlook Express!) to typical Unix file formats. ______________________________________________________________________ Table of Contents 1. Introduction 1.1 Copyright 1.2 Disclaimer 1.3 Related Information 1.4 News 2. The Procedure 2.1 Install an IMAP server (temporarily!) on your Linux box 2.2 Connect your Outlook client to the server 2.3 Copy over all your email 2.4 Deinstall IMAP from your Linux box ______________________________________________________________________ 1. Introduction While programs exist to convert some formats such as Microsoft Outlook Express to Unix formats, Outlook users are in a bit of a bind. The database format that Outlook uses for .PST files, called Jet, is documented at: http://msdn.microsoft.com/library/techart/olexcoutlk.htm but there doesn't seem to be any enterprising programmer who's written a conversion program yet. Fortunately, Outlook is capable of talking to IMAP mail servers, and you can store old mail on the IMAP server. So, one easy way to convert your mail to a normal format is to install the IMAP server on a Linux box and transfer all your email to it. 1.1. Copyright Copyright (c) 2001 by Greg Lindahl Please freely copy and distribute (sell or give away) this document in any format. It's requested that corrections and/or comments be forwarded to the document maintainer. You may create a derivative work and distribute it provided that you: · Send your derivative work (in the most suitable format such as sgml) to the LDP (Linux Documentation Project) or the like for posting on the Internet. If not the LDP, then let the LDP know where it is available. · License the derivative work with this same license or use GPL. Include a copyright notice and at least a pointer to the license used. · Give due credit to previous authors and major contributors. If you're considering making a derived work other than a translation, it's requested that you discuss your plans with the current maintainer. 1.2. Disclaimer Use the information in this document at your own risk. I disavow any potential liability for the contents of this document. Use of the concepts, examples, and/or other content of this document is entirely at your own risk. All copyrights are owned by their owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements. You are strongly recommended to take a backup of your system before major installation and backups at regular intervals. Do not place your cat in a running microwave oven. 1.3. Related Information A list of conversion utilities, many commercial, may be found at: http://www.emailman.com/conversion/index.html 1.4. News 1.01: Fixed minor typo in inetd/xinetd startup instructions. 2. The Procedure 2.1. Install an IMAP server (temporarily!) on your Linux box Installing things varies from Linux distribution to distribution, so I will use RedHat 7.0 as an example. First you need to install the correct package, which generally is named "imap". cd /home/redhat-7.0-cd/RedHat/RPMS rpm -i imap* Actually, since I had a "workstation" install, I also had to install the xinetd package; rpm gave me an error which told me to do this. And, of course, it was on the second CD of RedHat 7.0. Debian users using "apt-get" don't have to worry about such issues. Next, we need to enable the imap server. This is usually controlled by a line in the file /etc/inetd.conf: #imap stream tcp nowait root /usr/sbin/tcpd /usr/sbin/imapd The above line is commented out; remove the leading # sign. On RedHat 7.0 systems and later with xinetd, instead edit /etc/xinetd.d/imap and change "disable=yes" to "disable=no". Then restart inetd or xinetd by doing: /etc/rc.d/init.d/inetd restart or /etc/rc.d/init.d/xinetd restart If all else fails, reboot. You don't actually want to leave the IMAP server enabled for that long. This server runs as root and has had security bugs in the past. For this reason, you shouldn't leave it enabled unless you wish to use it permanently. We will disable this server in step 4. In order to connect Outlook to this IMAP server, you will need to know the name or IP address of the Linux box. 2.2. Connect your Outlook client to the server In order to copy over all our email to the server, we need to tell your Outlook client about this new server. Select "Accounts..." from the "Tools" menu, and then "Add" a new account "Mail...". The important items are that the server uses IMAP to download email, that the incoming mail server is the name or IP address of your Linux box from step 1, and the username and password should be your username and password on the Linux box. (As usual, it's a bad idea to use the root account on Linux for this purpose.) Once you've hit "Finish", set this new account to be the default by highlighting it and clicking on "Set as Default". Outlook should connect to your IMAP server, and the name of your IMAP server should appear at the bottom of your folder list. Click on it; you should see an Inbox folder. (Note that if /var/mail/yourusername doesn't exist on your Linux box, you won't be able to drag-and-drop any messages into your INBOX... and the error message will be confusing. However, that's not what we're going to do.) 2.3. Copy over all your email At this point you can drag and drop entire folders of email from Outlook onto the IMAP server name. This will copy the email, including all attachments, to the Linux box. Unfortunately it also immediately deletes it from Outlook. In order to copy items without deleting them, right-click on the folder name and select the "Copy" option. For the destination, pick your Linux server at the bottom of the list. However, life isn't quite that simple. Outlook supports folders containing folders which also contain messages. The Linux IMAP server does not support that; a folder is either a regular file containing messages, or a directory containing subdirectories and files. So if you have folders in Outlook with both messages and subfolders, you can't copy the entire tree over to the Linux IMAP server. Another incompatibility of the Linux IMAP server is that you have to tell it in advance if a new folder will contain subfolders or messages. You do this by appending a slash (/) to the folder name when you create it. This slash will disappear when the folder is created. So, in order to copy a tree of folders to the Linux IMAP server, first you need to create a replica of the structure of your existing folders on the Linux IMAP server. While you're doing this, note which of the existing folders contain both subfolders and messages. You will need to move these messages elsewhere. Once you have the overall tree created, then you can copy or move groups of folders to the Linux IMAP server. One final incompatibility to note is that the Linux IMAP server doesn't allow folders with slashes (/) in their name. You'll need to rename such folders before copying or moving them. On the Linux box, folders appear as files and directories in your home directory. The format of these files is the usual Unix mail format, which most Unix/Linux mail tools either use directly or can convert to/from. Files with attachments will have MIME attachments; there is also one extra message per folder which is a (useless) header. (One piece of data which doesn't get preserved is the original "From " line, which contains the envelope address of the email. Fortunately you don't actually need that information.) 2.4. Deinstall IMAP from your Linux box Once you've transferred all of your email, you will want to deinstall the IMAP server from your Linux box, for the security reasons mentioned earlier. This involves the same 2 steps you took to install the server: 1. Remove the RPMs: rpm -e imap 2. Remove the line in /etc/inetd.conf or /etc/xinetd.d/imap 3. Restart inetd or xinetd, or reboot. Voila! You have taken another step towards a Microsoft-free lifestyle.