Enigmail Service Not Available (libenigmime.so missing)
I am using Seamonkey under FreeBSD for the amd64 platform. I've had problems installing the Enigmail extension from FreeBSD ports (mail/enigmail-seamonkey).
The port generates the Mozilla extension (xpi) file. The extension installs globally when the browser is run as root. The OpenPGP menus and preferences are present. However, as you try to invoke any operation, the re is a message in the terminal saying:
Enigmail Service Not Available
I have had a look at the /usr/local/lib/seamonkey directory, where my Seamonkey lives and noticed that there is no libenigmine.so file, containing crucial. platform-specific code for the extension. So what, went wrong?
I have unpacked the XPI file generated by the port (enigmail-0.95.6-freebsd-amd64.xpi), and examined its contents:
chrome/enigmail-skin-tbird.jar
chrome/enigmail-locale.jar
chrome/enigmail-skin.jar
chrome.manifest
components/ipc.xpt
components/enigmail.xpt
components/enigmail.js
components/enigprefs-service.js
components/enigmime.xpt
defaults/pref/enigmail.js
defaults/preferences/enigmail.js
install.js
install.rdf
platform/FreeBSD/components/libenigmime.so
Well, the file is there. If you copy it by hand to /usr/local/lib/seamonkey/components, the extension runs fine. This means that some installation process is not working fine. I have digged few articles on the Mozilla Developer Connection about XPI packaging, and I've had a closer look at the install.js file.
This code decides which platform-dependent directory will be used:
// which platform?
function getPlatform() {
var platformStr;
var platformNode = "";
if('platform' in Install) {
platformStr = new String(Install.platform);
if (!platformStr.search(/^Macintosh/))
platformNode = APP_PLATFORM_MAC;
else if (!platformStr.search(/^Win/))
platformNode = APP_PLATFORM_WIN;
else if (!platformStr.search(/Linux/))
platformNode = APP_PLATFORM_LINUX;
else if (!platformStr.search(/^OS\/2/))
platformNode = APP_PLATFORM_OS2;
else
platformNode = APP_PLATFORM_OTHER;
}
return platformNode;
}
If you will have a look at the search method documentation, you will see that search returns the position of the specified value in the string. If no match was found it returns -1. This check, however if (!platformStr.search(/Linux/) will be true if and only if the word "Linux" will be found at the very beginning of the platformStr. In my case, and I guess also in case of Linux, the platform string starts with X11; FreeBSD 7.... That's why my platform will by qualified as APP_PLATFORM_OTHER.
Looks like this code originates from example code listed on the mozilla.org site (please note, that all regular expressions used begin with "^" - that is why the example code works).
What happens next?
case APP_PLATFORM_LINUX:
addDirectory("", "platform/"+ABI_PLATFORM_LINUX+"/components", fComponents, "");
break;
case APP_PLATFORM_WIN:
addDirectory("", "platform/"+ABI_PLATFORM_WIN+"/components", fComponents, "");
break;
case APP_PLATFORM_MAC:
addDirectory("", "platform/"+ABI_PLATFORM_DARWIN_PPC+"/components", fComponents, "");
addDirectory("", "platform/"+ABI_PLATFORM_DARWIN_X86+"/components", fComponents, "");
break;
case APP_PLATFORM_OS2:
addDirectory("", "platform/"+ABI_PLATFORM_OS2+"/components", fComponents, "");
break;
}
err = getLastError();
if (err == DOES_NOT_EXIST) {
// error code: file does not exist
logComment("platform dependent directory does not exist: " + err);
resetError();
}
The above code means that in my case no platform directory will be added and no error will be reported, either (getLastError() will succeeds since no addDirectory() has been called).
I have started fixing this by changing the if's in the getPlaform() function to properly check for the result and to check for the special case of the FreeBSD.
Then I've had a look at the <a href="http://www.mozdev.org/source/browse/enigmail/src/genxpi?annotate=1.9.2.2">genxpi</a> script that generates the XPI file during the compilation process. This file generates a install.js piece to be included in the XPI archive.
One possible fix just simply removes any runtime checks and loads the directory that was added the archive when the archive was built:
+++ mailnews/extensions/enigmail/genxpi.new 2008-07-20 22:28:22.610449405 +0200
@@ -68,20 +68,6 @@
var err;
const APP_VERSION="${xpiVersion}.0";
-
-const ABI_PLATFORM_LINUX="Linux_x86-gcc3";
-const ABI_PLATFORM_WIN="WINNT_x86-msvc";
-const ABI_PLATFORM_DARWIN_PPC="Darwin_ppc-gcc3";
-const ABI_PLATFORM_DARWIN_X86="Darwin_x86-gcc3";
-const ABI_PLATFORM_OS2="OS2_x86-gcc3";
-
-const APP_PLATFORM_LINUX="linux";
-const APP_PLATFORM_WIN="win";
-const APP_PLATFORM_MAC="mac";
-const APP_PLATFORM_OS2="os2";
-const APP_PLATFORM_OTHER="other";
-
-
// this function verifies disk space in kilobytes
function verifyDiskSpace(dirPath, spaceRequired) {
var spaceAvailable;
@@ -103,30 +89,6 @@
return true;
}
-// OS type detection
-// which platform?
-function getPlatform() {
- var platformStr;
- var platformNode = "";
-
- if('platform' in Install) {
- platformStr = new String(Install.platform);
-
- if (!platformStr.search(/^Macintosh/))
- platformNode = APP_PLATFORM_MAC;
- else if (!platformStr.search(/^Win/))
- platformNode = APP_PLATFORM_WIN;
- else if (!platformStr.search(/Linux/))
- platformNode = APP_PLATFORM_LINUX;
- else if (!platformStr.search(/^OS\/2/))
- platformNode = APP_PLATFORM_OS2;
- else
- platformNode = APP_PLATFORM_OTHER;
- }
-
- return platformNode;
-}
-
err = initInstall("Enigmail v"+APP_VERSION, // name for install UI
"/enigmail", // registered name
APP_VERSION); // package version
@@ -157,22 +119,7 @@
File.remove(delFile);
}
- switch (getPlatform()) {
- case APP_PLATFORM_LINUX:
- addDirectory("", "platform/"+ABI_PLATFORM_LINUX+"/components", fComponents, "");
- break;
- case APP_PLATFORM_WIN:
- addDirectory("", "platform/"+ABI_PLATFORM_WIN+"/components", fComponents, "");
- break;
- case APP_PLATFORM_MAC:
- addDirectory("", "platform/"+ABI_PLATFORM_DARWIN_PPC+"/components", fComponents, "");
- addDirectory("", "platform/"+ABI_PLATFORM_DARWIN_X86+"/components", fComponents, "");
- break;
- case APP_PLATFORM_OS2:
- addDirectory("", "platform/"+ABI_PLATFORM_OS2+"/components", fComponents, "");
- break;
- }
-
+ addDirectory("", "platform/${platform}/components", fComponents, "");
err = getLastError();
if (err == DOES_NOT_EXIST) {
// error code: file does not exist
But the downside of this is that if your XPI file will be installed on the wrong platform (for example you will try to install a Linux XPI on a Mac) the installation may succeed but the browser will crash.
Another fix:
+++ mailnews/extensions/enigmail/genxpi 2008-07-21 03:15:51.970437845 +0200
@@ -70,12 +70,14 @@
const ABI_PLATFORM_LINUX="Linux_x86-gcc3";
+const ABI_PLATFORM_FREEBSD="FreeBSD";
const ABI_PLATFORM_WIN="WINNT_x86-msvc";
const ABI_PLATFORM_DARWIN_PPC="Darwin_ppc-gcc3";
const ABI_PLATFORM_DARWIN_X86="Darwin_x86-gcc3";
const ABI_PLATFORM_OS2="OS2_x86-gcc3";
const APP_PLATFORM_LINUX="linux";
+const APP_PLATFORM_FREEBSD="FreeBSD";
const APP_PLATFORM_WIN="win";
const APP_PLATFORM_MAC="mac";
const APP_PLATFORM_OS2="os2";
@@ -107,21 +109,21 @@
// which platform?
function getPlatform() {
var platformStr;
- var platformNode = "";
+ var platformNode = APP_PLATFORM_OTHER;
if('platform' in Install) {
platformStr = new String(Install.platform);
- if (!platformStr.search(/^Macintosh/))
+ if (platformStr.search(/^Macintosh/) >= 0)
platformNode = APP_PLATFORM_MAC;
- else if (!platformStr.search(/^Win/))
+ else if (platformStr.search(/^Win/) >= 0)
platformNode = APP_PLATFORM_WIN;
- else if (!platformStr.search(/Linux/))
+ else if (platformStr.search(/Linux/) >= 0)
platformNode = APP_PLATFORM_LINUX;
- else if (!platformStr.search(/^OS\/2/))
+ else if (platformStr.search(/FreeBSD/) >= 0)
+ platformNode = APP_PLATFORM_FREEBSD;
+ else if (platformStr.search(/^OS\/2/) >= 0)
platformNode = APP_PLATFORM_OS2;
- else
- platformNode = APP_PLATFORM_OTHER;
}
return platformNode;
@@ -161,6 +163,9 @@
case APP_PLATFORM_LINUX:
addDirectory("", "platform/"+ABI_PLATFORM_LINUX+"/components", fComponents, "");
break;
+ case APP_PLATFORM_FREEBSD:
+ addDirectory("", "platform/"+ABI_PLATFORM_FREEBSD+"/components", fComponents, "");
+ break;
case APP_PLATFORM_WIN:
addDirectory("", "platform/"+ABI_PLATFORM_WIN+"/components", fComponents, "");
break;
@@ -171,6 +176,9 @@
case APP_PLATFORM_OS2:
addDirectory("", "platform/"+ABI_PLATFORM_OS2+"/components", fComponents, "");
break;
+ case APP_PLATFORM_OTHER:
+ alert("Unsupported platform, no Enigmail support currently available.");
+ cancelInstall(ACCESS_DENIED);
}
err = getLastError();
This version just explicitly adds FreeBSD support plus it bails out installation on the unsupported platform. If this fix is going to be complete, a decent recognition of various platform variants should be available (like 32- and 64-bit Linux).
This is out of scope of this short note, however.
If you suffer from symptoms mentioned in this note and you have the XPI file ready for your platform already, you may try replacing install.js file with the one attached below. XPI files are plain ZIP files, so any zip utility will do. Or just extract the enigmime library (.dll file for Windows, .so file for Unix) from the XPI file and put it in your browser's components directory.
- FreeBSD problem report ports/125832
- Enigmail bug 19592
| Attachment | Size |
|---|---|
| install.js.txt | 7.7 KB |
Comments
Post new comment