From: www.itworld.com
March 19, 2001 —
I get lots of mail, perhaps because I'm on a number of mailing lists. While I no longer put up with the dual-boot blues on my laptop but simply run Linux as my primary operating system, I do run Windows under VMware to read my mail with Eudora. That situation came about as a quick solution to a simple problem I had over a year ago.
Like many people, I started out reading my mail on Unix systems using mail clients such as mh and xmh, and then shifted to Windows-based clients such as Eudora or Netscape Messenger. When I got a new laptop about a year ago and decided to run Linux on it, I found that I could not abandon the large amount of mail I had built up under Eudora. So I installed Windows under VMware, copied my Eudora files over, and still had access to my accumulated mail. I also have a tape somewhere that contains all the mail I had accumulated under Unix from years before.
However, the time has come to move to a Linux-based mail client. This month's article will explore ways to read your mail under Linux and still access all the mail you have accumulated under Eudora, Netscape Messenger, or even some of the Outlook variants.
The problem
I have accumulated over 60 MB of mail in the last few years, all locked up in Eudora's mailbox files. Those files have .mbx extensions and sit in my Eudora directory, one for every mailbox I have created under Eudora. If you created mailboxes in folders, then you will also have some .mbx files in subdirectories in your Eudora directory. You might also have noticed that Eudora creates a .toc file for every .mbx file. Those .toc files help Eudora maintain various flags associated with each message in the mailbox file.
Netscape Messenger, on the other hand, keeps your mail in files without an extension, one for each mailbox. It also keeps an .snm file for each mailbox. It uses those files to keep flags and other information associated with each message. Messenger keeps .snm files in the directory \Program Files\Netscape\Users\default\Mail if you have only one user on your PC and have chosen the default. Depending on how you set up Netscape, you may have names other than default in the path above.
Outlook express keeps its mailboxes in the directory \Program Files\Outlook Express\Default User\Mail and also keeps two files for each mailbox, one with an .mbx extension and the other with an .idx extension.
The question then is to get all the mail from each of those mail clients into Linux so we can use them from a Linux mail client.
Fortunately for us, both Eudora and NetScape Messenger keep their mailbox files in standard Unix mailbox format, and while Outlook Express uses a nonstandard format, both Eudora and Netscape Messenger can import Outlook Express mailboxes.
Mail Clients
A number of mail clients are available for Linux, and many of them have come a long way recently. I looked at Balsa and kmail. Both of them are GUI-based mail clients that provide the features that most people require.
I downloaded the Balsa 1.0 RPM from the Balsa Website (see Resources for a link) and installed it easily under Red Hat 7.0. A few simple tests showed that it could send and receive attachments and handle the creation of folders as well as import mail. In short, it seemed to have the facilities I needed. I could not install Balsa 1.0 under Red Hat 6.2, as it required a number of libraries that were not available, and I did not fancy trying to install gnome-libs 1.2.0 or better.
kmail is part of KDE 2.0. You can install kmail under Red Hat 6.2 by downloading the required RPMs from the KDE download site (see Resources for a link). kmail comes as part of kdenetwork 2.0, and you must install a number of additional RPMs, including flex 2.5.4a, kdelibs 2.0.7, kdesupport 2.0.5, libmng 0.9.2, and qt 2.2.1, which you can download as an RPM and install under Red Hat 6.2. kmail comes with Red Hat 7.0, but you may need to install it if you did not select KDE during installation. A quick spin with kmail showed that it had all the features I needed, including the ability to handle attachments, create folders, and import mail.
I had hoped to look at Evolution as well, but I had problems building Evolution 0.6 on both my Red Hat 6.2 and 7.0 systems. In addition, there are many more mail clients for Linux than the ones mentioned above; more information on Linux mail clients can be found at the DaveCentral Linux software archive (see Resources for a link).
Also, it is worth pointing out that some versions of Eudora run well under Wine, although they take some time to start up. I managed to get Eudora 3.0.6 to run under Wine and, once it was running, it was the same old Eudora I was used to, but its fonts sure looked different from the Windows version.
Switching mailboxes
The process of getting your mailboxes from Windows to Linux is relatively easy, but a number of steps are involved, and the details differ for each mail client.
The first thing I would do is to empty the trash under Eudora or Netscape Messenger, and then compact your mailboxes. Those steps ensure that old, deleted mail will not turn up when you read the mailbox under Linux.
Next, copy all the mailbox files from Windows to Linux. For Eudora, I simply used Samba and copied all the files ending in .mbx to a network drive:
mkdir h:\eudora copy \Eudora\*.mbx h:\eudora\
A similar approach applies for Netscape Messenger, but remember that mailbox files under Messenger do not have a suffix.
After you have copied your mailbox files to Linux, how you get them into your mail client depends on which one you're using.
The only way I found to get old mailbox files into Balsa was to create a new mailbox by clicking File, New, Mailbox, select Local mailbox, and then clicking Next to bring up the second part of the Mailbox Configurator window. The figure shows how to fill out the fields on this window with AIX in the Mailbox Name field and eudora/aix.mbx in the Mailbox Path field.
Once you click on Add at the bottom of the window shown in the figure, you can simply click on the new mailbox shown in the Mailbox pane, and you will be able to read the messages in that mailbox.
For kmail, just copy your mailbox files to the Mail directory in your home directory and restart kmail. It will then find the new mailbox files and allow you to read your mail.
However, if you were using Outlook Express under Windows, you must use a program like Eudora or Netscape Messenger to first convert your mail, and then follow the steps outlined here. I found that the latest version of Eudora (5.0.1) did a better job of extracting mail from Outlook Express than earlier versions. Simply select File, Import, and follow the wizard that pops up. Once you have converted all your mail, note that Eudora places it in a subdirectory called Outlook Express.
Unfortunately, there are always problems. For example, Eudora keeps attachments in a separate directory, while kmail keeps attachments with the mail messages themselves. Thus, there seems to be no way to recover your attachments. In addition, I have found that both kmail and Balsa occasionally miss a few messages when reading in a large or complex mailbox. For example, in a mailbox that Eudora claimed contained 2,808 messages, Balsa only found 2,800 while kmail found 2,804.
Finally, if your mail client is not one of those discussed here, but can handle standard Unix mbox format, then you can likely retrieve your Eudora, Netscape Messenger, and Outlook Express mail by using the techniques discussed here.
Conclusion
Now that I know how relatively easy it is to retrieve all that mail I have lying around under Eudora, I am much closer to freeing myself from a dependence on Windows. I still want to have a look at using IMAP to keep all my mail in, but Balsa and kmail look like the sort of client I want to use.
I would like to thank those of you who sent me mail encouraging me to write this article. Special thanks go to David Raeker-Jordan, who provided some useful information on Eudora's mailbox format; Brian Astill, who pointed out that kmail supports reading Eudora mailbox format; and Stefan Goethals, who mentioned a neat dual-boot setup with Netscape Messenger.
While I would like to get back to the topic of mail in a future article, next month's article is likely to be about backup in a mixed Linux and Windows environment, and I will look at Amanda as well as commercial alternatives.
LinuxWorld.com