Prerequisites
In order to compile Enigmail, you first need to compile Thunderbird or Seamonkey on your platform. We recommend that you install the necessary components and set up your environment according to the Mozilla build instructions and then follow the steps below.
-
Download the latest Thunderbird tarball and extract it to a convenient location.
This will create a mozilla folder, which is the root of the build tree. -
Open a command prompt/shell and navigate to the parent of the mozilla folder
(e.g. if your mozilla folders real path is C:/temp/mozilla, you need to be in C:/temp). -
Create a .mozconfig file in the mozilla folder.
The minimum recommended options to be added to the .mozconfig file are:mk_add_options MOZ_OBJDIR=/path/to/some/directory ac_add_options --disable-tests ac_add_options --disable-debug ac_add_options --enable-crypto ac_add_options --enable-optimize ac_add_options --enable-application=mail mk_add_options MOZ_CO_PROJECT=mail
-
Since Thunderbird 24.0 / SeaMonkey 2.21 it is no longer required to create a full build of Thunderbird. Compile the required parts of Thunderbird by typing:
make -f client.mk configure cd <MOZ_OBJDIR> # Mozilla <= 26: make -C mozilla tier_base tier_nspr tier_js # Mozilla > 27: make -C mozilla export make export
Compiling Enigmail
-
After compiling Mozilla Thunderbird or Seamonkey, obtain the source code for the Enigmail module as described earlier.
-
If you downloaded the source tarballs, untar them in the mailnews/extensions directory in the pre-compiled Mozilla source tree to create the enigmail subdirectory.
-
If you used GIT checkout, rename/move the enigmail directory to the name mozilla/mailnews/extensions/enigmail in the pre-compiled Mozilla source tree.
You can use the following commands on Unix (or equivalent on Windows) to do the above:
mv enigmail <dir>/mozilla/mailnews/extensions/enigmail
-
-
Compile the Enigmail module:
cd mailnews/extensions/enigmail ./makemake -r cd OBJDIR/mailnews/extensions/enigmail make
OBJDIR is mandatory since Thunderbird 5 for building Enigmail. Please read the information about using OBJDIR below.
-
Run your version of Seamonkey or Mozilla Thunderbird and check if Enigmail works fine.
Using OBJDIR when building Enigmail
The makemake reads the .mozconfig file to get the OBJDIR parameter. However, @CONFIG-GUESS@ is not supported by makemake.
Alternatively OBJDIR can be specified with "makemake -o DIR".
Important: makemake has to be executed from mozilla/mailnews/extensions/enigmail, the build itself (i.e. make) has to executed from OBJDIR/mailnews/extensions/enigmail.
Please note if 'makemake' should use OBJDIR from the .mozconfig file then the toplevel directory must be called "mozilla". Otherwise, makemake needs to be called with makemake -o /full/path/to/OBJDIR. Furthermore, makemake cannot handle symbolic links to the toplevel directory.
Packaging the Enigmail XPI
To allow others to use your compiled version of Enigmail, you need to create the XPI file containing the Enigmail libraries. To build the Enigmail XPI run:
make xpi
from the same directory where you compiled Enigmail.
This will create enigmail-<version>-<platform>.xpi in the mozilla/dist/bin (or OBJDIR/dist/bin) folder.
Pitfalls
Make sure when building your own Thunderbird or SeaMonkey that you follow this rule, or Enigmail will not work properly:
- Do not set --disable-crypto: crypto support is mandatory for Enigmail.
- Do not set --enable-chrome-format to anything else than omni.