Thunderbird Import Extension (en)

This site is only kept for historical reasons. Please use Michal Kocarek's Bird Import extension!

Goal

I like to have an extension for Thunderbird which is able to import mails from The Bat! 1.x into Thunderbird. Preferably all existing information such as account information, passwords and address books will be migrated, too.

Obstacles

To my best knowledge there is no such plugin and that's for a reason: Writing such a plugin is a hard and complex task!

  1. The file format used by The Bat! is proprietary and not publicly documented anywhere (besides my own reverse engineering). I think, I solved this problem mostly so we can go ahead :-)
  2. Thunderbird (Mozilla) is one of the biggest open source software applications currently available Thunderbird 2.0.0.6 contains 2,754,533 physical source lines of code (generated using David A. Wheeler's 'SLOCCount'. Extending a complex software is not something the average PHP programmer can easily do. Of course, the Mozilla code base can be easily extended by external extensions using only Javascript and CSS but for an import extension, it is very advisable to use XPCOM together with C++ There are two reasons for using C++: First, while file system access is possible with Javascript, this is an area which is not known to many people so getting help may be quite difficult when fixing some obscure bugs. I expect this to be much easier when using well-known C++. And second, all existing import modules are written in C++ so using the same language enables you to transfer some infrastructure code easily into the new extension.
  3. There is no documentation how to write an import extension beside the source code. Getting a grasp where to start is really demanding.

Status

  1. July 2011: Michal Kocarek built an import extension using my documentation on the file formats! Even if this is kind of alpha software, there is no need for me to write my own importer anymore. This site is only kept for archival purposes. Please use Michal's importer
  1. August 2007: I produced a small basic "extension" containing a few hundred lines of code. There is now a new item in the Thunderbird 'Import' dialog when importing mails called "The Bat! 1.x" (I had really big difficulties getting to this point: It took me several weeks spread over about 2 1/2 years! Maybe I am just a bad programmer but I think this area is really complicated!). The mail import factory is returned and could begin its work. Next steps include adding some 'fake progress' and writing a C library (preliminary named 'libbatmail') which can be included in the extension at a later point to do some real work.

How to help

Help is welcome! This is an open source project ("will become one") so without some helping hands, this won't get anywhere soon.

  1. Programmers: If you know object orientated programming in a C-like language (C++, Java) and have a solid understanding of either C++ or C, algorithms and macros, you can help getting the whole thing to work. Unfortunately, this isn't something for newbies. While you may learn C++/C while doing this, you should really know how to develop complex applications.
  2. Others: Sorry, I don't think you can do anything right now (maybe besides doing some reverse engineering to get information about the missing pieces in the proprietary file formats and learning how to code).

How to learn

If you like to help with this project (or develop another Mozilla/Firefox/Thunderbird extension using XPCOM/C++) I have some advise what helped me learning about XPCOM. At the beginning I knew next to nothing about COM programming (let alone XPCOM).

  • Generally speaking, the Mozilla Developer Center is a great resource which you will visit frequently.
  • The book Creating XPCOM Components by Doug Turner and Ian Oeschger provides a really good introduction into XPCOM. You should read chapter 1: Am Overview of XPCOM thoroughly before you start hacking so you get familiar with the fundamental concepts and pieces of XPCOM! Unfortunately, this book never was published as a dead tree version but you can download it as PDF (The version found in Mozilla Developer center is slightly improved because it incorporates all errata found so far whereas the PDF is the original without errata.) which is more easy to print.
  • To get a functional extension skeleton, you can use Ted Mielczarek's Extension Wizard.

Documentation on Import Modules

tbd