Email:Sharing your Thunderbird profile

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

Many users dual boot between Linux and Windows. This article is a guide on how to share your Mozilla Thunderbird profile so you can access your mail from either OS. It also provides instructions for sharing the Enigmail extension, and your GnuPG home directory as well. Info has been compiled from several different documents on the Mozilla support website, and Enigmail's documentation.

If users are not concerned with current email privacy issues, they may safely ignore the sections on Enigmail and GnuPG. Anyone intrigued by this concept may read more in the Encryption:Files_and_email section.

Contents

[edit] Before Starting

A working installation of Thunderbird is assumed to already be in place in Linux. The article further assumes you have been using Thunderbird to read email only in Linux, so that your archive of emails is stored in your Linux home directory. If your situation is reversed, you are advised to first read through the article, and then adapt it as needed. Alternatively, you may first export your emails from Windows, install Thunderbird in Linux, import your mail, and then follow this wiki.

Note: You currently must have a shared Fat32 partition or have your NTFS drives mounted with a stable read-write driver, such as NTFS-3G on your machine in order for Linux and Windows to read and write the same files! Anyone using the Clemson dual boot image has everything needed to begin.

EDIT: Actually there is a stable ext2/3 driver for Windows that works very well. It doesn't support access rights or ext3 journaling but these are minor inconveniences in practice for a desktop machine (relative to using fat32 anyway). I have used it for several years on a dual-boot machine sharing an ext3 system mounted as ext2 and experienced no data loss.

For the sake of simplicity, the article assumes your fat32 partition is /mnt/Data/ in Linux, and D:\ in Windows.

[edit] Thunderbird in Linux

We start from within Linux. Ensure your fat32 partition is mounted and writable.

You will need to uninstall any Thunderbird extensions prior to moving your profile directory, else Thunderbird will not open properly after the move. In addition to using the Tools->Extensions menu to uninstall them, you must manually delete the chrome and extensions directories from your profile directory. Your Thunderbird profile should be contained within ~/.mozilla-thunderbird/Profiles/xxxxxx.default, where xxxxxx is a series of random numbers/letters.

Make a backup copy of your profile directory:

cp -r ~/.mozilla-thunderbird/Profiles/xxxxxx.default profile_bak

Make a new directory to store the profile on your fat32 partition:

mkdir /mnt/Data/thunderbird

and move your profile to it:

mv -r ~/.mozilla-thunderbird/Profiles/xxxxxx.default /mnt/Data/thunderbird

Perform these steps for each profile you want to share.

Next, we must modify the ~/.mozilla-thunderbird/profiles.ini file to reflect the change. Make a backup first. Open this file with any text editor. Change

  IsRelative=1 to IsRelative=0

and change

  Path=/xxxxxx.default to Path=/mnt/Data/thunderbird/xxxxxx.default

Run Thunderbird to make sure it opens properly, and all your mail is present. If it doesn't, or they aren't, restore your backups and return to the beginning, taking extra care to completely remove any installed extensions.

[edit] Enigmail in Linux

If you are using a distribution-specific version of Thunderbird, then you must use a distribution-specific version of Enigmail. Re-install Enigmail.

When setting your preferences, leave the "GnuPG executable path" field blank (this is possible with recent versions of Enigmail since gpg should be in your PATH). In the "Additional parameters for GnuPG" field, put --no-permission-warning.

Your other settings, like Per-Recipient rules, are stored in an xml file that was moved along with your Thunderbird profile to the fat32 partition.


[edit] GnuPG in Linux

Your keyrings should be stored in ~/.gnupg. Make a backup:

cp -r .gnupg .gnupg_bak

Make a new directory to store the files on your fat32 partition:

mkdir /mnt/Data/gnupg

Move your files to the new location:

mv .gnupg/* /mnt/Data/gnupg

Delete the old .gnupg Directory

rmdir .gnupg

Create a symlink in your home directory to point to the new location:

ln -s /mnt/Data/gnupg .gnupg

Test that gpg can find the files:

gpg --list-keys

You may get a warning at the beginning of the output relating to unsafe permissions. When using gpg on the command line, you may pass the --no-permission-warning option to avoid seeing this. You may also get an error from other gpg commands related to being unable to lock the keyrings. This is due to the files being on a fat32 partition. You must append the following line to the end of gpg.conf:

  lock-never

Note: Since Windows is not aware of ext3 or other Linux file systems, there is currently no way around these problems. You must take care to only have one instance of gpg running at a time.

[edit] Thunderbird in Windows

Obtain Thunderbird from the Mozilla website. Install Thunderbird, but uncheck the option to "Run Thunderbird now." You must run Thunderbird for the first time via Start->All Programs->Mozilla Thunderbird->Profile Manager.

Click the Create Profile button. Name the profile whatever you want, but browse to the location on the fat32 partition where you moved your xxxxxx.default folder. The path to your new profile should read, for example, d:\thunderbird\xxxxxx.default. Click through the rest of the wizard, and open Thunderbird with the new profile. You should have all of your account settings, folders and emails present.

[edit] GnuPG in Windows

Download the latest version of GnuPG binary for windows here. Run the installer, keeping the defaults (unless you want to modify the "gpgProgram" part of this section.)

Copy the following lines into a file named gnupg.reg, changing the <path_to_gnupg> as necessary:

REGEDIT4
[HKEY_CURRENT_USER\Software\GNU]
[HKEY_CURRENT_USER\Software\GNU\GNUPG]
"HomeDir"="D:\\gnupg"
"gpgProgram"="C:\\Program Files\\GNU\\GnuPG\\gpg.exe"
"OptFile"="D:\\gnupg\\gpg.conf"

Double click the file to add it to the registry.

[edit] Enigmail in Windows

Obtain the win32 version of Enigmail from their website. Enigmail must be installed globally, i.e. not via the Tools->Extensions menu within Thunderbird.

Open Command Prompt. Change to the Thunderbird installation directory (usually c:\Program Files\Mozilla Thunderbird\). Issue the following command:

c:\> thunderbird.exe -install-global-extension <full-path-to-enigmail.xpi>

Your preferences in Enigmail should not have been altered from those entered when you were in Linux, but you should verify them anyway. You may have to manually import your keyrings via the Key Manager.

[edit] External Links

Mozilla
The GNU Privacy Guard
The Enigmail Plugin for Mozilla Mail
A History of Pretty Good Privacy

Personal tools