Intro
This page will present a method to share ones email messages between Linux and Windows, using Mozilla Thunderbird. The procedure will be executed mainly form the Linux box (booting into Windows will be done for checking the results only).
Thunderbird has to be installed both under Linux and Windows. Each installation will use its own profile, but will share the actual mail data.
Before trying to apply this method, a fully configured and functional installation of Thunderbird must exist under Linux. The mail data that will finally be "shared" are the ones existing under Linux. Furthermore, the accounts and email filters configured in Linux will eventually be transferred to Windows.
Thunderbird should be executed at least once in Windows, so that the default profile is created.
When the procedure is over, the mail data will be installed in a Windows disk or partition (common folder), and both Thunderbird installations' profiles will be customised in order to use this "shared" folder.
For the following example I have assumed:
- Windows Operation System is installed in disk/partition C:\ and is mounted under Linux in /c.
- A Windows data partition/disk exists in disk/partition D:\ and is mounted under Linux in /d. This is where the "shared" mail data will finally reside.
Note:
Text in Red denotes Windows data that depend on the installation.
Text in Green denotes Linux that depend on the installation.
The user has to replace this text with the corresponding data.
Gathering data
-
Windows Thunderbird folder:
C:\Documents and Settings\User\Application Data\Thunderbird or
/c/Documents and Settings/User/Application Data/Thunderbird
where User is our Windows user name.
In file profiles.ini (field Path) we find the profile folder, in this case Profiles\44jh8bih.default. A folder by the same name will also exist.
-
Linux Thunderbird folder:
/home/user/.thunderbird
where user is our Linux user name.
In file profiles.ini (field Path) we find the profile folder, in this case 0c6pw3ib.default. A folder by the same name will also exist.
Each profile folder contains a folder called Mail. This is where the actual mail data is stored.
At this point the common folder for both Linux and Windows must be created. We can use any FAT32 (vfat) partition or disk. Most howtos do not recommend to use a NTFS partition or disk for this purpose; I have actually used one and I had no problem (so far). No matter what we choose, we must have write access to it from Linux.
-
Common folder:
D:\thunderbird-profile or
/d/thunderbird-profile
You can use any folder name here; just remember to replace it in the following commands.
Copying Windows Profile
We start by copying our Windows profile folder to the common folder.
mkdir /d/thunderbird-profile
cp -r '/c/Documents and Settings/User/Application Data/Thunderbird/Profiles/44jh8bih.default' \
/d/thunderbird-profile
Editing profiles.ini
Next step is to edit our Windows profiles.ini file, after keeping a backup, and change the default profile to point to the common folder. I will use vi here but you can use any text editor we like
cd '/c/Documents and Settings/User/Application Data/Thunderbird'
cp profiles.ini profiles.ini.old
vi profiles.ini
The original file should be something like
[General]
StartWithLastProfile=1
[Profile0]
Name=default
IsRelative=1
Path=Profiles\44jh8bih.default
Default=1
The final file should be (changes are in red)
[General]
StartWithLastProfile=1
[Profile0]
Name=default
IsRelative=0
Path=D:\thunderbird-profile
Default=1
At this point we are ready to check the Windows Thunderbird installation. We reboot the system, load Windows and execute Thunderbird. We should be able to see our email folders, send and receive messages etc.
I have to say that Thunderbird was a little less responsive when loading messages (I had a delay of about 10-15 seconds) but as I kept on using it, the delay went away. Maybe it had to read the new message files or something, or just because some of my email files are really large (up to 500MB).
When we are done, we reboot the PC and boot into Linux.
Copying mail messages
Now we will copy our Linux email messages to the common folder, so that we start using them. But first we will keep a backup of our Windows email messages, just in case.
mv /d/thunderbird-profile/Mail /d/thunderbird-profile/Mail.old
cd /home/user/.thunderbird/0c6pw3ib.default
cp -r Mail /d/thunderbird-profile
Linking to new Mail folder
In order to start using our new Mail folder from Linux, we have to make a link to it. But first we will keep a backup of our old Linux email messages, just in case.
cd /home/user/.thunderbird/0c6pw3ib.default
mv Mail Mail.old
ln -s /d/thunderbird-profile/Mail /home/user/.thunderbird/0c6pw3ib.default/Mail
Now we can start Thunderbird and check that all our email folders are there, and that we can send and receive messages. This concludes our Linux customisation.
Editing prefs.js
The last thing to do is edit our Windows prefs.js file, in order to insert our accounts. I found out (the hard way) that copying the file from Linux and editing it will not do the trick, cause we will loose our extension data, theme data etc.
cp /home/user/.thunderbird/prefs.js /d/thunderbird-profile/prefs.js.linux
cd /d/thunderbird-profile
mv prefs.js prefs.js.old
grep -v identity prefs.js.old | grep -v server > prefs.js
grep identity prefs.js.linux >> prefs.js
grep server prefs.js.linux >> prefs.js
Finally open the file in a text editor and replace
/home/user/.thunderbird/0c6pw3ib.default/Mail/
with
D:\\thunderbird-profile\\Mail\\
All we have to do now is boot into Windows and test Thunderbird installation once again.
Problems that might occur
In this section I will present problems that might occur during the procedure. If you do have a problem and need help, contact me, and I will try to help you. If you have had a problem and found a workaround, please report it so that others may benefit from your knowledge.
-
Some of my account folders don't show up in Windows
When I executed Thunderbird in Windows, I "lost" two of my account folders. These were two yahoo accounts that I have. Looking in my Mail folder, I saw that mail.pop.yahoo.com and mail.pop.yahoo-1.com were still there. So, for some strange reason, Thunderbird did not import my account data.
All I had to do was to create these two accounts and point them to the right folders. From "Account Settings... / Add Account..." I filled in my account data, and the changed "Server Settings / Local directory:" to "D:\thunderbird-profile\Mail\mail.pop.yahoo.com" and "D:\thunderbird-profile\Mail\mail.pop.yahoo-1.com" respectively. The final thing I did was to check "Inbox for this server's account" in "Server Settings / Advanced..." for each one of them. After pressing "OK", they both appeared in the folder's tree.
-
Mail deleted in Windows/Linux reappear in Linux/Windows
This may happen if you don't compact your folders regularly. A workaround I found was checking "Compact folders when it will save over x KB" in "Preferences / Advanced / Network & Disk Space" and set x=1.
The first time you delete a message you will be asked to compact your folders. Check the "Don't ask me again" option and answer yes. It may take a while, but next time it will happen it will be done very fast.
Relevant links
How To Share Mail Between Windows and Linux
Roaming profiles
How To Manage Profiles
Howto Thunderbird/Firefox profile share XP & Dapper
Sharing a profile between Windows and Linux
Sharing Thunderbird/Firefox profiles between Linux/Windows
How to Move Your Mozilla Thunderbird Profile
|