Devout

Introduction

Devout is a utility that exports email from Microsoft Outlook 2000 to Evolution mbox format. It is written in Visual Basic for Applications, which Microsoft kindly embedded inside Outlook 2000.

Devout will currently export all mail items in the Outlook folder list (including mail stored on an Exchange server, or in PST files) with the following restrictions:

These restrictions are documented in greater detail in the Notes section.

The latest version of Devout can be obtained from http://www.wirejunkie.com/freestuff/devout/

If you find Devout particularly useful and want to show your apprectiation, a small donation is most welcome, either in Bitcoins to 19QpWDmZPmTqawcr8VsXcbdc4Znq1ecrza, or via PayPal.

Installation

  1. Download the Devout source (ZIP file, 40.5KB)
  2. Extract the file, making sure you keep the directory structure in the ZIP file intact. This will create a directory named "devout-20010714-001", with a subdirectory named "vbmenc".
  3. From the "devout-20010714-001\vbmenc" directory, copy the file "vbmenc.dll" to your Windows System or System32 directory.
  4. Start Outlook. From the main menu bar, select Tools -> Macro -> Visual Basic Editor. If a warning about macro viruses appears, select "Enable Macros".
  5. In the Project Explorer, right click on "project1 (VbaProject.OTM)" and select Import File.
  6. Go to the "devout-20010714-001" directory and select the CustomExport.bas file.
  7. Repeat the above two steps for the files EvolutionMboxFolder.cls, frmCustomExport.frm, MIMEMessage.cls, MimeTypeMap.cls and Utility.bas
  8. Close the Visual Basic Editor.

Note that Devout uses some objects (treeview controls, Office objects etc.) located in external OCX or DLL files. If you have any difficulties installing or running Devout, go to Tools -> References in the Visual Basic Editor and make sure the following references are selected:

If these references do not appear in the list, you can use the browse button to find the actual files themselves as listed above. Note that the paths to these files may vary from system to system.

By default Outlook is probably set to disable macros that have not been digitally signed. The Devout package falls into this category, so for it to work you may need to go to Tools -> Macros -> Security and select Medium level. After changing this setting you may need to restart Outlook.

The next time you close Outlook, you will be asked if you want to save the VBA project 'VbaProject.OTM'. Select "Yes".

Usage

  1. Start Outlook
  2. From the main menu bar, select Tools -> Macro -> Macros. If a warning about macro viruses appears, select "Enable Macros".
  3. Select the "ExportMailToEvolution" macro and click "Run". The Devout window will appear.
  4. The Devout window contains a treeview listing all the Outlook folders with a checkbox next to each folder. Select the folders you wish to export. Selecting or deselecting a folder will automatically select or deselect its children.
  5. The default destination for the exported mail is the TEMP directory. This can be changed using the "Browse" button which will bring up a folder selection dialog.
  6. Click the "Export" button to start exporting. The export can be cancelled at any time by pressing the "Cancel" button.

Depending on whether or not Outlook's security patches have been installed you may be presented with a dialog that says the following:

A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose "No".

This should be answered with "Allow access for 10 minutes". Depending on how much email is being exported this message may appear several times.

I have successfully exported about 20,000 mail messages (spread over about 240 folders) in 109 minutes - about 260MB of data. This was on a Pentium III 450Mhz running Windows NT 4. I exported to a local directory then copied the resultant directory structure to my Evolution mail directory which was shared via Samba on another computer.

Notes

Devout not perfect... Sometimes it will give you messages with illegal email addresses in the headers, and multipart/alternative and multipart/mixed messages still need a little work to be completely sane, but it did do an acceptable job of exporting most of my mail correctly, complete with attachments, so I expect it will do the same for you.

Attachments and HTML message bodies are encoded using the Base64 and Quoted-Printable encoding functions in the vbmenc.dll file. The source for this file is included in the Devout package, in the vbmenc directory. The algorithms are based on public domain code included with the VM mail reader, which can be found at http://www.wonderworks.com/vm. Thanks to Christopher Kline for pointing me at this code. You need Minimalist GNU For Windows if you want to build vbmenc.dll yourself.

The headers exported for each message are as follows:

The Date is always set to the time zone of the computer on which the export is run, because Outlook does not appear to provide access to time zone data.

Outlook also does not provide access to the Sender's email address, so we create a reply to the current message then extract the recipient's email address from it (thanks to Ben van der Merwe for that one).

No allowances other than Base64 or QP encoding are made for non-ASCII characters in messages at the moment, but Evolution tends to deal fairly well with this.

Release History:

License

Copyright © 2000, 2001 Tim Serong

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.