Page MenuHome GnuPG

No OneTemporary

diff --git a/ui/content/enigmailCommon.js b/ui/content/enigmailCommon.js
index 051ebcc2..8737c2ff 100644
--- a/ui/content/enigmailCommon.js
+++ b/ui/content/enigmailCommon.js
@@ -1,1921 +1,1926 @@
/*
The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "MPL"); you may not use this file
except in compliance with the MPL. You may obtain a copy of
the MPL at http://www.mozilla.org/MPL/
Software distributed under the MPL is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the MPL for the specific language governing
rights and limitations under the MPL.
The Original Code is Enigmail.
The Initial Developer of the Original Code is Ramalingam Saravanan.
Portions created by Ramalingam Saravanan <svn@xmlterm.org> are
Copyright (C) 2001 Ramalingam Saravanan. All Rights Reserved.
Contributor(s):
Patrick Brunschwig <patrick.brunschwig@gmx.net>
Alternatively, the contents of this file may be used under the
terms of the GNU General Public License (the "GPL"), in which case
the provisions of the GPL are applicable instead of
those above. If you wish to allow use of your version of this
file only under the terms of the GPL and not to allow
others to use your version of this file under the MPL, indicate
your decision by deleting the provisions above and replace them
with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient
may use your version of this file under either the MPL or the
GPL.
*/
// enigmailCommon.js: shared JS functions for Enigmail
// This Enigmail version and compatible Enigmime version
var gEnigmailVersion = "0.96a";
var gEnigmimeVersion = "0.96a";
// Maximum size of message directly processed by Enigmail
const ENIG_MSG_BUFFER_SIZE = 96000;
const ENIG_MSG_HEADER_SIZE = 16000;
const ENIG_KEY_BUFFER_SIZE = 64000;
const ENIG_PROCESSINFO_CONTRACTID = "@mozilla.org/xpcom/process-info;1";
const ENIG_PIPECONSOLE_CONTRACTID = "@mozilla.org/process/pipe-console;1";
const ENIG_IPCBUFFER_CONTRACTID = "@mozilla.org/process/ipc-buffer;1";
const ENIG_PIPEFILTERLISTENER_CONTRACTID = "@mozilla.org/process/pipe-filter-listener;1";
const ENIG_ENIGMAIL_CONTRACTID = "@mozdev.org/enigmail/enigmail;1";
const ENIG_ENIGMIMELISTENER_CONTRACTID = "@mozilla.org/enigmail/mime-listener;1";
const ENIG_ENIGMIMESERVICE_CONTRACTID = "@mozdev.org/enigmail/enigmimeservice;1";
const ENIG_ENIGMIMEVERIFY_CONTRACTID = "@mozilla.org/enigmail/mime-verify;1";
const ENIG_STRINGBUNDLE_CONTRACTID = "@mozilla.org/intl/stringbundle;1";
const ENIG_LOCAL_FILE_CONTRACTID = "@mozilla.org/file/local;1";
const ENIG_DIRSERVICE_CONTRACTID = "@mozilla.org/file/directory_service;1";
const ENIG_MIME_CONTRACTID = "@mozilla.org/mime;1";
const ENIG_WMEDIATOR_CONTRACTID = "@mozilla.org/rdf/datasource;1?name=window-mediator";
const ENIG_APPSHELL_MEDIATOR_CONTRACTID = "@mozilla.org/appshell/window-mediator;1"
const ENIG_ASS_CONTRACTID = "@mozilla.org/appshell/appShellService;1";
const ENIG_CLIPBOARD_CONTRACTID = "@mozilla.org/widget/clipboard;1";
const ENIG_CLIPBOARD_HELPER_CONTRACTID = "@mozilla.org/widget/clipboardhelper;1"
const ENIG_TRANSFERABLE_CONTRACTID = "@mozilla.org/widget/transferable;1"
const ENIG_LOCALE_SVC_CONTRACTID = "@mozilla.org/intl/nslocaleservice;1";
const ENIG_DATE_FORMAT_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1"
const ENIG_ACCOUNT_MANAGER_CONTRACTID = "@mozilla.org/messenger/account-manager;1";
const ENIG_XPCOM_APPINFO = "@mozilla.org/xre/app-info;1";
const ENIG_LOCALFILEOUTPUTSTREAM_CONTRACTID =
"@mozilla.org/network/file-output-stream;1";
const ENIG_STANDARD_URL_CONTRACTID = "@mozilla.org/network/standard-url;1";
const ENIG_SCRIPTABLEINPUTSTREAM_CONTRACTID = "@mozilla.org/scriptableinputstream;1";
const ENIG_SAVEASCHARSET_CONTRACTID = "@mozilla.org/intl/saveascharset;1";
const ENIG_STREAMCONVERTERSERVICE_CID_STR =
"{892FFEB0-3F80-11d3-A16C-0050041CAF44}";
const ENIG_ISCRIPTABLEUNICODECONVERTER_CONTRACTID = "@mozilla.org/intl/scriptableunicodeconverter";
const ENIG_IOSERVICE_CONTRACTID = "@mozilla.org/network/io-service;1";
const ENIGMAIL_PREFS_ROOT = "extensions.enigmail.";
const ENIG_C = Components;
// Key algorithms
const ENIG_KEYTYPE_DSA = 1;
const ENIG_KEYTYPE_RSA = 2;
// Interfaces
const nsIEnigmail = ENIG_C.interfaces.nsIEnigmail;
const nsIEnigStrBundle = ENIG_C.interfaces.nsIStringBundleService;
// Encryption flags
if (nsIEnigmail) {
const ENIG_SIGN = nsIEnigmail.SEND_SIGNED;
const ENIG_ENCRYPT = nsIEnigmail.SEND_ENCRYPTED;
const ENIG_ENCRYPT_OR_SIGN = ENIG_ENCRYPT | ENIG_SIGN;
}
// UsePGPMimeOption values
const PGP_MIME_NEVER = 0;
const PGP_MIME_POSSIBLE = 1;
const PGP_MIME_ALWAYS = 2;
const ENIG_POSSIBLE_PGPMIME = -2081;
// property name for temporary directory service
const ENIG_TEMPDIR_PROP = "TmpD";
var gUsePGPMimeOptionList = ["usePGPMimeNever", "usePGPMimePossible",
"usePGPMimeAlways"];
var gEnigRecipientsSelection = ["-",
"perRecipientRules",
"perRecipientRulesAndEmail",
"perEmailAddress",
"askRecipientsAlways"];
const ENIG_BUTTON_POS_0 = 1;
const ENIG_BUTTON_POS_1 = 1 << 8;
const ENIG_BUTTON_POS_2 = 1 << 16;
const ENIG_BUTTON_TITLE_IS_STRING = 127;
const ENIG_HEADERMODE_KEYID = 0x01;
const ENIG_HEADERMODE_URL = 0x10;
const ENIG_THREE_BUTTON_STRINGS = (ENIG_BUTTON_TITLE_IS_STRING * ENIG_BUTTON_POS_0) +
(ENIG_BUTTON_TITLE_IS_STRING * ENIG_BUTTON_POS_1) +
(ENIG_BUTTON_TITLE_IS_STRING * ENIG_BUTTON_POS_2);
var gEnigLogLevel = 2; // Output only errors/warnings by default
var gEnigDebugLog;
var gEnigPrefSvc, gEnigPrefRoot, gPrefEnigmail;
try {
gEnigPrefSvc = enigGetService("@mozilla.org/preferences-service;1", "nsIPrefService");
gEnigPrefRoot = gEnigPrefSvc.getBranch(null);
gPrefEnigmail = gEnigPrefSvc.getBranch(ENIGMAIL_PREFS_ROOT);
if (EnigGetPref("logDirectory"))
gEnigLogLevel = 5;
} catch (ex) {
ERROR_LOG("enigmailCommon.js: Error in instantiating PrefService\n");
}
function EnigGetFrame(win, frameName) {
DEBUG_LOG("enigmailCommon.js: EnigGetFrame: name="+frameName+"\n");
for (var j=0; j<win.frames.length; j++) {
if (win.frames[j].name == frameName) {
return win.frames[j];
}
}
return null;
}
var gEnigPromptSvc;
var gEnigStrBundle;
// Initializes enigmailCommon
function EnigInitCommon(id) {
DEBUG_LOG("enigmailCommon.js: EnigInitCommon: id="+id+"\n");
gEnigPromptSvc = enigGetService("@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService");
// Do not instantiate ProcessInfo for Prefs
if (id && (id.indexOf("pref-") == 0))
return;
try {
var processInfo = enigGetService(ENIG_PROCESSINFO_CONTRACTID, "nsIProcessInfo");
var nspr_log_modules = processInfo.getEnv("NSPR_LOG_MODULES");
var matches = nspr_log_modules.match(/enigmailCommon:(\d+)/);
if (matches && (matches.length > 1)) {
gEnigLogLevel = matches[1];
WARNING_LOG("enigmailCommon.js: gEnigLogLevel="+gEnigLogLevel+"\n");
}
} catch (ex) {
dump("enigmailCommon.js: Error in instantiating ProcessInfo\n");
}
}
var gEnigmailSvc;
function GetEnigmailSvc() {
// Lazy initialization of enigmail JS component (for efficiency)
if (gEnigmailSvc) {
return gEnigmailSvc.initialized ? gEnigmailSvc : null;
}
try {
gEnigmailSvc = ENIG_C.classes[ENIG_ENIGMAIL_CONTRACTID].createInstance(ENIG_C.interfaces.nsIEnigmail);
} catch (ex) {
ERROR_LOG("enigmailCommon.js: Error in instantiating EnigmailService\n");
return null;
}
DEBUG_LOG("enigmailCommon.js: gEnigmailSvc = "+gEnigmailSvc+"\n");
if (!gEnigmailSvc.initialized) {
// Initialize enigmail
var firstInitialization = !gEnigmailSvc.initializationAttempted;
try {
// Initialize enigmail
gEnigmailSvc.initialize(window, gEnigmailVersion, gPrefEnigmail);
try {
// Reset alert count to default value
gPrefEnigmail.clearUserPref("initAlert");
} catch(ex) {
}
} catch (ex) {
if (firstInitialization) {
// Display initialization error alert
var errMsg = gEnigmailSvc.initializationError ? gEnigmailSvc.initializationError : "Error in initializing Enigmail service";
errMsg += "\n\n"+EnigGetString("avoidInitErr");
EnigAlertPref("Enigmail: "+errMsg, "initAlert");
if (EnigGetPref("initAlert")) {
gEnigmailSvc.initializationAttempted = false;
gEnigmailSvc = null;
}
}
return null;
}
var configuredVersion = EnigGetPref("configuredVersion");
DEBUG_LOG("enigmailCommon.js: GetEnigmailSvc: "+configuredVersion+"\n");
if (firstInitialization && gEnigmailSvc.initialized &&
gEnigmailSvc.agentType && gEnigmailSvc.agentType == "pgp") {
EnigAlert(EnigGetString("pgpNotSupported"));
}
if (gEnigmailSvc.initialized && (gEnigmailVersion != configuredVersion)) {
EnigConfigure();
}
}
if (gEnigmailSvc.logFileStream) {
gEnigDebugLog = true;
gEnigLogLevel = 5;
}
return gEnigmailSvc.initialized ? gEnigmailSvc : null;
}
function EnigUpgradeRecipientsSelection () {
// Upgrade perRecipientRules and recipientsSelectionOption to
// new recipientsSelection
var keySel = EnigGetPref("recipientsSelectionOption");
var perRecipientRules = EnigGetPref("perRecipientRules");
var setVal = 2;
/*
1: rules only
2: rules & email addresses (normal)
3: email address only (no rules)
4: manually (always prompt, no rules)
5: no rules, no key selection
*/
switch (perRecipientRules) {
case 0:
switch (keySel) {
case 0:
setVal = 5;
break;
case 1:
setVal = 3;
break;
case 2:
setVal = 4;
break;
default:
setVal = 2;
}
break;
case 1:
setVal = 2;
break;
case 2:
setVal = 1;
break;
default:
setVal = 2;
}
// set new pref
EnigSetPref("recipientsSelection", setVal);
// clear old prefs
gPrefEnigmail.clearUserPref("perRecipientRules");
gPrefEnigmail.clearUserPref("recipientsSelectionOption");
}
function EnigUpgradeHeadersView() {
// all headers hack removed -> make sure view is correct
var hdrMode = null;
try {
var hdrMode = EnigGetPref("show_headers");
}
catch (ex) {}
if (hdrMode == null) hdrMode = 1;
try {
gPrefEnigmail.clearUserPref("show_headers");
}
catch (ex) {}
gEnigPrefRoot.setIntPref("mail.show_headers", hdrMode);
try {
enigMessageReload(false);
}
catch (ex) {}
}
function EnigUpgradePgpMime() {
var pgpMimeMode = false;
try {
var pgpMimeMode = (EnigGetPref("usePGPMimeOption") == 2);
}
catch (ex) {
return;
}
try {
if (pgpMimeMode) {
var accountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
for (var i=0; i < accountManager.allIdentities.Count(); i++) {
var id = accountManager.allIdentities.QueryElementAt(i, Components.interfaces.nsIMsgIdentity);
if (id.getBoolAttribute("enablePgp")) {
id.setBoolAttribute("pgpMimeMode", true);
}
}
}
gPrefEnigmail.clearUserPref("usePGPMimeOption");
}
catch (ex) {}
}
function EnigConfigure() {
var oldVer=EnigGetPref("configuredVersion");
if (oldVer == "") {
EnigOpenSetupWizard();
}
else if (oldVer < "0.95") {
try {
EnigUpgradeHeadersView();
EnigUpgradePgpMime();
EnigUpgradeRecipientsSelection();
}
catch (ex) {}
}
EnigSetPref("configuredVersion", gEnigmailVersion);
EnigSavePrefs();
}
///////////////////////////////////////////////////////////////////////////////
// File read/write operations
const ENIG_RDONLY = 0x01;
const ENIG_WRONLY = 0x02;
const ENIG_CREATE_FILE = 0x08;
const ENIG_TRUNCATE = 0x20;
const ENIG_DEFAULT_FILE_PERMS = 0600;
function EnigCreateFileStream(filePath, permissions) {
//DEBUG_LOG("enigmailCommon.js: EnigCreateFileStream: file="+filePath+"\n");
try {
var localFile = ENIG_C.classes[ENIG_LOCAL_FILE_CONTRACTID].createInstance(ENIG_C.interfaces.nsILocalFile);
localFile.initWithPath(filePath);
if (localFile.exists()) {
if (localFile.isDirectory() || !localFile.isWritable())
throw ENIG_C.results.NS_ERROR_FAILURE;
if (!permissions)
permissions = localFile.permissions;
}
if (!permissions)
permissions = ENIG_DEFAULT_FILE_PERMS;
var flags = ENIG_WRONLY | ENIG_CREATE_FILE | ENIG_TRUNCATE;
var fileStream = ENIG_C.classes[ENIG_LOCALFILEOUTPUTSTREAM_CONTRACTID].createInstance(ENIG_C.interfaces.nsIFileOutputStream);
fileStream.init(localFile, flags, permissions, 0);
return fileStream;
} catch (ex) {
ERROR_LOG("enigmailCommon.js: EnigCreateFileStream: Failed to create "+filePath+"\n");
return null;
}
}
function EnigWriteFileContents(filePath, data, permissions) {
//DEBUG_LOG("enigmailCommon.js: EnigWriteFileContents: file="+filePath+"\n");
try {
var fileOutStream = EnigCreateFileStream(filePath, permissions);
if (data.length) {
if (fileOutStream.write(data, data.length) != data.length)
throw ENIG_C.results.NS_ERROR_FAILURE;
fileOutStream.flush();
}
fileOutStream.close();
} catch (ex) {
ERROR_LOG("enigmailCommon.js: EnigWriteFileContents: Failed to write to "+filePath+"\n");
return false;
}
return true;
}
// maxBytes == -1 => read everything
function EnigReadURLContents(url, maxBytes) {
DEBUG_LOG("enigmailCommon.js: EnigReadURLContents: url="+url+
", "+maxBytes+"\n");
var ioServ = enigGetService(ENIG_IOSERVICE_CONTRACTID, "nsIIOService");
if (!ioServ)
throw ENIG_C.results.NS_ERROR_FAILURE;
var fileChannel = ioServ.newChannel(url, null, null)
var rawInStream = fileChannel.open();
var scriptableInStream = ENIG_C.classes[ENIG_SCRIPTABLEINPUTSTREAM_CONTRACTID].createInstance(ENIG_C.interfaces.nsIScriptableInputStream);
scriptableInStream.init(rawInStream);
var available = scriptableInStream.available()
if ((maxBytes < 0) || (maxBytes > available))
maxBytes = available;
var urlContents = scriptableInStream.read(maxBytes);
scriptableInStream.close();
return urlContents;
}
// maxBytes == -1 => read whole file
function EnigReadFileContents(localFile, maxBytes) {
DEBUG_LOG("enigmailCommon.js: EnigReadFileContents: file="+localFile.leafName+
", "+maxBytes+"\n");
if (!localFile.exists() || !localFile.isReadable())
throw ENIG_C.results.NS_ERROR_FAILURE;
var ioServ = enigGetService(ENIG_IOSERVICE_CONTRACTID, "nsIIOService");
if (!ioServ)
throw ENIG_C.results.NS_ERROR_FAILURE;
var fileURI = ioServ.newFileURI(localFile);
return EnigReadURLContents(fileURI.asciiSpec, maxBytes);
}
///////////////////////////////////////////////////////////////////////////////
function WRITE_LOG(str) {
function f00(val, digits) {
return ("0000"+val.toString()).substr(-digits);
}
var d = new Date();
var datStr=d.getFullYear()+"-"+f00(d.getMonth()+1, 2)+"-"+f00(d.getDate(),2)+" "+f00(d.getHours(),2)+":"+f00(d.getMinutes(),2)+":"+f00(d.getSeconds(),2)+"."+f00(d.getMilliseconds(),3)+" ";
if (gEnigLogLevel >= 4)
dump(datStr+str);
if (gEnigDebugLog && gEnigmailSvc && gEnigmailSvc.logFileStream) {
gEnigmailSvc.logFileStream.write(datStr, datStr.length);
gEnigmailSvc.logFileStream.write(str, str.length);
}
}
function DEBUG_LOG(str) {
if (gEnigLogLevel >= 4)
WRITE_LOG(str);
}
function WARNING_LOG(str) {
if (gEnigLogLevel >= 3)
WRITE_LOG(str);
}
function ERROR_LOG(str) {
if (gEnigLogLevel >= 2)
WRITE_LOG(str);
}
function CONSOLE_LOG(str) {
if (gEnigLogLevel >= 3)
WRITE_LOG(str);
if (gEnigmailSvc && gEnigmailSvc.console)
gEnigmailSvc.console.write(str);
}
// write exception information
function EnigWriteException(referenceInfo, ex) {
ERROR_LOG(referenceInfo+": caught exception: "
+ex.name+"\n"
+"Message: '"+ex.message+"'\n"
+"File: "+ex.fileName+"\n"
+"Line: "+ex.lineNumber+"\n"
+"Stack: "+ex.stack+"\n");
}
///////////////////////////////////////////////////////////////////////////////
function EnigAlert(mesg) {
gEnigPromptSvc.alert(window, EnigGetString("enigAlert"), mesg);
}
function EnigLongAlert(mesg) {
window.openDialog("chrome://enigmail/content/enigmailAlertDlg.xul",
"", "chrome,modal,centerscreen", {msgtext: mesg});
}
function EnigAlertCount(countPrefName, mesg) {
var alertCount = EnigGetPref(countPrefName);
if (alertCount <= 0)
return;
alertCount--;
EnigSetPref(countPrefName, alertCount);
if (alertCount > 0) {
mesg += EnigGetString("repeatPrefix",alertCount) + " ";
mesg += (alertCount == 1) ? EnigGetString("repeatSuffixSingular") : EnigGetString("repeatSuffixPlural");
} else {
mesg += EnigGetString("noRepeat");
}
EnigAlert(mesg);
}
function EnigAlertPref(mesg, prefText) {
const display = true;
const dontDisplay = false;
var prefValue = EnigGetPref(prefText);
if (prefValue == display) {
var checkBoxObj = { value: false } ;
var buttonPressed = gEnigPromptSvc.confirmEx(window,
EnigGetString("enigAlert"),
mesg,
(gEnigPromptSvc.BUTTON_TITLE_OK * ENIG_BUTTON_POS_0),
null, null, null,
EnigGetString("dlgNoPrompt"), checkBoxObj);
if (checkBoxObj.value && buttonPressed==0) {
EnigSetPref(prefText, dontDisplay);
}
}
}
function EnigConfirm(mesg) {
var dummy=new Object();
var buttonPressed = gEnigPromptSvc.confirmEx(window,
EnigGetString("enigConfirm"),
mesg,
(gEnigPromptSvc.BUTTON_TITLE_YES * ENIG_BUTTON_POS_0) +
(gEnigPromptSvc.BUTTON_TITLE_NO * ENIG_BUTTON_POS_1),
null, null, null,
null, dummy);
return (buttonPressed == 0);
}
function EnigConfirmPref(mesg, prefText) {
const notSet = 0;
const yes = 1;
const no = 2;
var prefValue = EnigGetPref(prefText);
switch (prefValue) {
case notSet:
var checkBoxObj = { value: false} ;
var buttonPressed = gEnigPromptSvc.confirmEx(window,
EnigGetString("enigConfirm"),
mesg,
(gEnigPromptSvc.BUTTON_TITLE_YES * ENIG_BUTTON_POS_0) +
(gEnigPromptSvc.BUTTON_TITLE_NO * ENIG_BUTTON_POS_1),
null, null, null,
EnigGetString("dlgKeepSetting"), checkBoxObj);
if (checkBoxObj.value) {
EnigSetPref(prefText, (buttonPressed==0 ? yes : no));
}
return (buttonPressed==0 ? 1 : 0);
case yes:
return 1;
case no:
return 0;
default:
return -1;
}
}
function EnigError(mesg) {
return gEnigPromptSvc.alert(window, EnigGetString("enigError"), mesg);
}
function EnigPromptValue(mesg, valueObj) {
var checkObj = new Object();
return gEnigPromptSvc.prompt(window, EnigGetString("enigPrompt"),
mesg, valueObj, "", checkObj);
}
function EnigOverrideAttribute(elementIdList, attrName, prefix, suffix) {
for (var index = 0; index < elementIdList.length; index++) {
var elementId = elementIdList[index];
var element = document.getElementById(elementId);
if (element) {
try {
var oldValue = element.getAttribute(attrName);
var newValue = prefix+elementId+suffix;
//DEBUG_LOG("enigmailCommon.js: *** overriding id="+ elementId+" "+attrName+"="+oldValue+" with "+newValue+"\n");
element.setAttribute(attrName, newValue);
} catch (ex) {}
} else {
DEBUG_LOG("enigmailCommon.js: *** UNABLE to override id="+ elementId+"\n");
}
}
}
function EnigPrefWindow(showBasic, clientType, selectTab) {
DEBUG_LOG("enigmailCommon.js: EnigPrefWindow\n");
if (showBasic && clientType == "seamonkey" && selectTab==null) {
// Open the seamonkey pref window
goPreferences("securityItem",
"chrome://enigmail/content/pref-enigmail.xul",
"enigmail");
}
else {
// open the normal pref window
window.openDialog("chrome://enigmail/content/pref-enigmail.xul",
"_blank", "chrome,resizable=yes",
{'showBasic': showBasic,
'clientType': clientType,
'selectTab': selectTab});
}
}
function EnigAdvPrefWindow() {
EnigAlert("This function doesn't exist anymore!");
}
function EnigHelpWindow(source) {
EnigOpenWin("enigmail:help",
"chrome://enigmail/content/enigmailHelp.xul?src="+source,
"centerscreen,resizable");
}
function EnigUpgrade() {
var ioService = ENIG_C.classes[ENIG_IOSERVICE_CONTRACTID].getService(ENIG_C.interfaces.nsIIOService);
if (ioService && ioService.offline) {
EnigAlert(EnigGetString("needOnline"));
return;
}
window.openDialog("http://enigmail.mozdev.org/no_wrap/update.html?upgrade=yes&enigmail="+gEnigmailVersion+"&enigmime="+gEnigmimeVersion, "dialog");
}
function EnigDisplayRadioPref(prefName, prefValue, optionElementIds) {
DEBUG_LOG("enigmailCommon.js: EnigDisplayRadioPref: "+prefName+", "+prefValue+"\n");
if (prefValue >= optionElementIds.length)
return;
var groupElement = document.getElementById("enigmail_"+prefName);
var optionElement = document.getElementById(optionElementIds[prefValue]);
if (groupElement && optionElement) {
groupElement.selectedItem = optionElement;
groupElement.value = prefValue;
}
}
function EnigSetRadioPref(prefName, optionElementIds) {
DEBUG_LOG("enigmailCommon.js: EnigSetRadioPref: "+prefName+"\n");
try {
var groupElement = document.getElementById("enigmail_"+prefName);
if (groupElement) {
var optionElement = groupElement.selectedItem;
var prefValue = optionElement.value;
if (prefValue < optionElementIds.length) {
EnigSetPref(prefName, prefValue);
groupElement.value = prefValue;
}
}
}
catch (ex) {}
}
function EnigSetDefaultPrefs() {
DEBUG_LOG("enigmailCommon.js: EnigSetDefaultPrefs\n");
// has become obsolete
}
function EnigSavePrefs() {
DEBUG_LOG("enigmailCommon.js: EnigSavePrefs\n");
try {
gEnigPrefSvc.savePrefFile(null);
} catch (ex) {
}
}
function EnigGetPref(prefName) {
var prefValue = null;
try {
var prefType = gPrefEnigmail.getPrefType(prefName);
// Get pref value
switch (prefType) {
case gPrefEnigmail.PREF_BOOL:
prefValue = gPrefEnigmail.getBoolPref(prefName);
break;
case gPrefEnigmail.PREF_INT:
prefValue = gPrefEnigmail.getIntPref(prefName);
break;
case gPrefEnigmail.PREF_STRING:
prefValue = gPrefEnigmail.getCharPref(prefName);
break;
default:
prefValue = undefined;
break;
}
} catch (ex) {
// Failed to get pref value
ERROR_LOG("enigmailCommon.js: EnigGetPref: unknown prefName:"+prefName+" \n");
}
return prefValue;
}
function EnigGetDefaultPref(prefName) {
DEBUG_LOG("enigmailCommon.js: EnigGetDefaultPref: prefName="+prefName+"\n");
var prefValue=null;
try {
gPrefEnigmail.lockPref(prefName);
prefValue = EnigGetPref(prefName);
gPrefEnigmail.unlockPref(prefName);
}
catch (ex) {}
return prefValue;
}
function EnigSetPref(prefName, value) {
DEBUG_LOG("enigmailCommon.js: EnigSetPref: "+prefName+", "+value+"\n");
var prefType;
try {
prefType = gPrefEnigmail.getPrefType(prefName);
}
catch (ex) {
switch (typeof value) {
case "boolean":
prefType = gPrefEnigmail.PREF_BOOL;
break;
case "integer":
prefType = gPrefEnigmail.PREF_INT;
break;
case "string":
prefType = gPrefEnigmail.PREF_STRING;
break;
default:
prefType = 0;
break;
}
}
var retVal = false;
switch (prefType) {
case gPrefEnigmail.PREF_BOOL:
gPrefEnigmail.setBoolPref(prefName, value);
retVal = true;
break;
case gPrefEnigmail.PREF_INT:
gPrefEnigmail.setIntPref(prefName, value);
retVal = true;
break;
case gPrefEnigmail.PREF_STRING:
gPrefEnigmail.setCharPref(prefName, value);
retVal = true;
break;
default:
break;
}
return retVal;
}
function EnigGetSignMsg(identity) {
DEBUG_LOG("enigmailCommon.js: EnigGetSignMsg: identity.key="+identity.key+"\n");
var sign = null;
if (gEnigPrefRoot.getPrefType("mail.identity."+identity.key+".pgpSignPlain")==0) {
if (gEnigPrefRoot.getPrefType("mail.identity."+identity.key+".pgpSignMsg")==0) {
sign=identity.getBoolAttribute("pgpAlwaysSign");
identity.setBoolAttribute("pgpSignEncrypted", sign);
identity.setBoolAttribute("pgpSignPlain", sign);
}
else {
sign = identity.getIntAttribute("pgpSignMsg");
identity.setBoolAttribute("pgpSignEncrypted", sign==1);
identity.setBoolAttribute("pgpSignPlain", sign>0);
}
gEnigPrefRoot.deleteBranch("mail.identity."+identity.key+".pgpSignMsg");
gEnigPrefRoot.deleteBranch("mail.identity."+identity.key+".pgpAlwaysSign");
}
}
function EnigRequestObserver(terminateFunc, terminateArg)
{
this._terminateFunc = terminateFunc;
this._terminateArg = terminateArg;
}
EnigRequestObserver.prototype = {
_terminateFunc: null,
_terminateArg: null,
QueryInterface: function (iid) {
if (!iid.equals(ENIG_C.interfaces.nsIRequestObserver) &&
!iid.equals(ENIG_C.interfaces.nsISupports))
throw ENIG_C.results.NS_ERROR_NO_INTERFACE;
return this;
},
onStartRequest: function (channel, ctxt)
{
DEBUG_LOG("enigmailCommon.js: EnigRequestObserver.onStartRequest\n");
},
onStopRequest: function (channel, ctxt, status)
{
DEBUG_LOG("enigmailCommon.js: EnigRequestObserver.onStopRequest: "+ctxt+"\n");
this._terminateFunc(this._terminateArg, ctxt);
}
}
function EnigConvertFromUnicode(text, charset) {
DEBUG_LOG("enigmailCommon.js: EnigConvertFromUnicode: "+charset+"\n");
if (!text)
return "";
if (! charset) charset="utf-8";
// Encode plaintext
try {
var unicodeConv = ENIG_C.classes[ENIG_ISCRIPTABLEUNICODECONVERTER_CONTRACTID].getService(ENIG_C.interfaces.nsIScriptableUnicodeConverter);
unicodeConv.charset = charset;
return unicodeConv.ConvertFromUnicode(text);
} catch (ex) {
DEBUG_LOG("enigmailCommon.js: EnigConvertFromUnicode: caught an exception\n");
return text;
}
}
function EnigConvertToUnicode(text, charset) {
DEBUG_LOG("enigmailCommon.js: EnigConvertToUnicode: "+charset+"\n");
if (!text || !charset /*|| (charset.toLowerCase() == "iso-8859-1")*/)
return text;
// Encode plaintext
try {
var unicodeConv = ENIG_C.classes[ENIG_ISCRIPTABLEUNICODECONVERTER_CONTRACTID].getService(ENIG_C.interfaces.nsIScriptableUnicodeConverter);
unicodeConv.charset = charset;
return unicodeConv.ConvertToUnicode(text);
} catch (ex) {
DEBUG_LOG("enigmailCommon.js: EnigConvertToUnicode: caught an exception\n");
return text;
}
}
function EnigConvertGpgToUnicode(text) {
if (typeof(text)=="string") {
text = text.replace(/\\x3a/ig, "\\e3A");
a=text.search(/\\x[0-9a-fA-F]{2}/);
while (a>=0) {
ch=unescape('%'+text.substr(a+2,2));
r= new RegExp("\\"+text.substr(a,4));
text=text.replace(r, ch);
a=text.search(/\\x[0-9a-fA-F]{2}/);
}
text = EnigConvertToUnicode(text, "utf-8");
}
return text;
}
function EnigFormatFpr(fingerprint) {
// format key fingerprint
DEBUG_LOG("enigmailCommon.js: EnigFormatFpr: fingerprint="+fingerprint+"\n");
var r="";
var fpr = fingerprint.match(/(....)(....)(....)(....)(....)(....)(....)(....)(....)?(....)?/);
if (fpr && fpr.length > 2) {
fpr.shift();
r=fpr.join(" ");
}
return r;
}
function EnigGetDeepText(node, findStr) {
DEBUG_LOG("enigmailCommon.js: EnigDeepText: <" + node.tagName + ">, '"+findStr+"'\n");
if (findStr) {
if (node.innerHTML.replace(/&nbsp;/g, " ").indexOf(findStr) < 0) {
// exit immediately if findStr is not found at all
return "";
}
}
// EnigDumpHTML(node);
var plainText = EnigParseChildNodes(node);
// Replace non-breaking spaces with plain spaces
plainText = plainText.replace(/\xA0/g," ");
if (findStr) {
if (plainText.indexOf(findStr) < 0) {
return "";
}
}
return plainText;
}
// extract the plain text by iterating recursively through all nodes
function EnigParseChildNodes(node) {
var plainText="";
if (node.nodeType == Node.TEXT_NODE) {
// text node
plainText = plainText.concat(node.data);
}
else {
if (node.nodeType == Node.ELEMENT_NODE) {
if (node.tagName=="IMG" && node.className=="moz-txt-smily") {
// get the "alt" part of graphical smileys to ensure correct
// verification of signed messages
if (node.getAttribute("alt")) {
plainText = plainText.concat(node.getAttribute("alt"));
}
}
}
var child = node.firstChild;
// iterate over child nodes
while (child) {
if (! (child.nodeType == Node.ELEMENT_NODE &&
child.tagName == "BR" &&
! child.hasChildNodes())) {
// optimization: don't do an extra loop for the very frequent <BR> elements
plainText = plainText.concat(EnigParseChildNodes(child));
}
child = child.nextSibling;
}
}
return plainText;
}
// Dump HTML content as plain text
function EnigDumpHTML(node)
{
var type = node.nodeType;
if (type == Node.ELEMENT_NODE) {
// open tag
DEBUG_LOG("<" + node.tagName)
// dump the attributes if any
attributes = node.attributes;
if (null != attributes) {
var countAttrs = attributes.length;
var index = 0
while(index < countAttrs) {
att = attributes[index];
if (null != att) {
DEBUG_LOG(" "+att.name+"='"+att.value+"'")
}
index++
}
}
// close tag
DEBUG_LOG(">")
// recursively dump the children
if (node.hasChildNodes()) {
// get the children
var children = node.childNodes;
var length = children.length;
var count = 0;
while(count < length) {
var child = children[count]
EnigDumpHTML(child)
count++
}
DEBUG_LOG("</" + node.tagName + ">");
}
}
// if it's a piece of text just dump the text
else if (type == Node.TEXT_NODE) {
DEBUG_LOG(node.data)
}
}
/////////////////////////
// Console stuff
/////////////////////////
function EnigClearPassphrase() {
DEBUG_LOG("enigmailCommon.js: EnigClearPassphrase: \n");
var enigmailSvc = GetEnigmailSvc();
if (!enigmailSvc)
return;
- enigmailSvc.clearCachedPassphrase();
- EnigAlertPref(EnigGetString("passphraseCleared"), "warnClearPassphrase");
+ if (enigmailSvc.useGpgAgent()) {
+ EnigAlert(EnigGetString("passphraseCannotBeCleared"))
+ }
+ else {
+ enigmailSvc.clearCachedPassphrase();
+ EnigAlertPref(EnigGetString("passphraseCleared"), "warnClearPassphrase");
+ }
}
function EnigOpenWin (winName, spec, winOptions, optList) {
var windowManager = ENIG_C.classes[ENIG_APPSHELL_MEDIATOR_CONTRACTID].getService(ENIG_C.interfaces.nsIWindowMediator);
/* according to the docs, this doesn't seem to work ...
var recentWin = windowManager.getMostRecentWindow(winName);
*/
var winEnum=windowManager.getEnumerator(null);
var recentWin=null;
while (winEnum.hasMoreElements() && ! recentWin) {
var thisWin = winEnum.getNext();
if (thisWin.location.href==spec) {
recentWin = thisWin;
}
}
if (recentWin) {
recentWin.focus();
} else {
var appShellSvc = ENIG_C.classes[ENIG_ASS_CONTRACTID].getService(ENIG_C.interfaces.nsIAppShellService);
var domWin = appShellSvc.hiddenDOMWindow;
//nsIDOMJSWindow
domWin.open(spec, winName, "chrome,"+winOptions, optList);
}
}
// return the options passed to a window
function EnigGetWindowOptions() {
var winOptions=[];
if (window.location.search) {
var optList=window.location.search.substr(1).split(/\&/);
for (var i=0; i<optList.length; i++) {
var anOption=optList[i].split(/\=/);
winOptions[anOption[0]] = unescape(anOption[1]);
}
}
return winOptions;
}
function EnigViewAbout() {
DEBUG_LOG("enigmailCommon.js: EnigViewAbout\n");
EnigOpenWin ("about:enigmail",
"chrome://enigmail/content/enigmailAbout.xul",
"resizable,centerscreen");
}
function EnigViewConsole() {
DEBUG_LOG("enigmailCommon.js: EnigViewConsole\n");
EnigOpenWin("enigmail:console",
"chrome://enigmail/content/enigmailConsole.xul",
"resizable,centerscreen");
}
function EnigViewDebugLog() {
DEBUG_LOG("enigmailCommon.js: EnigViewDebugLog\n");
var logDirectory = EnigGetPref("logDirectory");
if (!logDirectory) {
EnigAlert(EnigGetString("noLogDir"));
return;
}
if (!gEnigmailSvc) {
EnigAlert(EnigGetString("noLogFile"));
return;
}
if (!gEnigmailSvc.logFileStream) {
EnigAlert(EnigGetString("restartForLog"));
return;
}
gEnigmailSvc.logFileStream.flush();
logDirectory = logDirectory.replace(/\\/g, "/");
var logFileURL = "file:///" + logDirectory + "/enigdbug.txt";
var opts="fileUrl="+escape(logFileURL)+"&title="+escape("Enigmail Debug Log");
EnigOpenWin("enigmail:logFile",
"chrome://enigmail/content/enigmailViewFile.xul?"+opts,
"resizable,centerscreen");
// window.open(logFileURL, 'Enigmail Debug Log');
}
function EnigKeygen() {
DEBUG_LOG("enigmailCommon.js: EnigKeygen\n");
window.openDialog('chrome://enigmail/content/enigmailKeygen.xul',
"enigmail:generateKey",
'chrome,dialog,modal,resizable=yes,width=600');
}
function EnigKeyManager() {
DEBUG_LOG("enigmailCommon.js: EnigKeygen\n");
EnigOpenWin("enigmail:KeyManager",
"chrome://enigmail/content/enigmailKeyManager.xul",
"resizable");
}
// retrieves the most recent navigator window (opens one if need be)
function EnigLoadURLInNavigatorWindow(url, aOpenFlag)
{
DEBUG_LOG("enigmailCommon.js: EnigLoadURLInNavigatorWindow: "+url+", "+aOpenFlag+"\n");
var navWindow;
// if this is a browser window, just use it
if ("document" in top) {
var possibleNavigator = top.document.getElementById("main-window");
if (possibleNavigator &&
possibleNavigator.getAttribute("windowtype") == "navigator:browser")
navWindow = top;
}
// if not, get the most recently used browser window
if (!navWindow) {
var wm;
wm = ENIG_C.classes[ENIG_APPSHELL_MEDIATOR_CONTRACTID].getService(ENIG_C.interfaces.nsIWindowMediator);
navWindow = wm.getMostRecentWindow("navigator:browser");
}
if (navWindow) {
if ("loadURI" in navWindow)
navWindow.loadURI(url);
else
navWindow._content.location.href = url;
} else if (aOpenFlag) {
// if no browser window available and it's ok to open a new one, do so
navWindow = window.open(url, "Enigmail");
}
DEBUG_LOG("enigmailCommon.js: EnigLoadURLInNavigatorWindow: navWindow="+navWindow+"\n");
return navWindow;
}
// retrieves a localized string from the enigmail.properties stringbundle
function EnigGetString(aStr) {
var restCount = arguments.length - 1;
if(!gEnigStrBundle) {
try {
var strBundleService = ENIG_C.classes[ENIG_STRINGBUNDLE_CONTRACTID].getService();
strBundleService = strBundleService.QueryInterface(nsIEnigStrBundle);
gEnigStrBundle = strBundleService.createBundle("chrome://enigmail/locale/enigmail.properties");
} catch (ex) {
ERROR_LOG("enigmailCommon.js: Error in instantiating stringBundleService\n");
}
}
if(gEnigStrBundle) {
try {
if(restCount > 0) {
var subPhrases = new Array();
for (var i = 1; i < arguments.length; i++) {
subPhrases.push(arguments[i]);
}
return gEnigStrBundle.formatStringFromName(aStr, subPhrases, subPhrases.length);
}
else {
return gEnigStrBundle.GetStringFromName(aStr);
}
} catch (ex) {
ERROR_LOG("enigmailCommon.js: Error in querying stringBundleService for string '"+aStr+"'\n");
}
}
return null;
}
// Remove all quoted strings (and angle brackets) from a list of email
// addresses, returning a list of pure email addresses
function EnigStripEmail(mailAddrs) {
var qStart, qEnd;
while ((qStart = mailAddrs.indexOf('"')) != -1) {
qEnd = mailAddrs.indexOf('"', qStart+1);
if (qEnd == -1) {
ERROR_LOG("enigmailMsgComposeOverlay.js: EnigStripEmail: Unmatched quote in mail address: "+mailAddrs+"\n");
throw ENIG_C.results.NS_ERROR_FAILURE;
}
mailAddrs = mailAddrs.substring(0,qStart) + mailAddrs.substring(qEnd+1);
}
// Eliminate all whitespace, just to be safe
mailAddrs = mailAddrs.replace(/\s+/g,"");
// Extract pure e-mail address list (stripping out angle brackets)
mailAddrs = mailAddrs.replace(/(^|,)[^,]*<([^>]+)>[^,]*/g,"$1$2");
return mailAddrs;
}
//get path for temporary directory (e.g. /tmp, C:\TEMP)
function EnigGetTempDir() {
var tmpDir;
try {
var ds = ENIG_C.classes[ENIG_DIRSERVICE_CONTRACTID].getService();
var dsprops = ds.QueryInterface(ENIG_C.interfaces.nsIProperties);
var tmpDirComp = dsprops.get(ENIG_TEMPDIR_PROP, ENIG_C.interfaces.nsILocalFile);
tmpDir=tmpDirComp.path;
}
catch (ex) {
// let's guess ...
if (EnigGetOS() == "WINNT") {
tmpDir="C:\\TEMP";
} else {
tmpDir="/tmp";
}
}
return tmpDir;
}
// get the OS platform
function EnigGetOS () {
var xulAppinfo = ENIG_C.classes[ENIG_XPCOM_APPINFO].getService(ENIG_C.interfaces.nsIXULRuntime);
return xulAppinfo.OS;
}
function EnigDisplayPrefs(showDefault, showPrefs, setPrefs) {
DEBUG_LOG("enigmailCommon.js: EnigDisplayPrefs\n");
var obj = new Object;
var prefList = gPrefEnigmail.getChildList("",obj);
for (var prefItem in prefList) {
var prefName=prefList[prefItem];
var prefElement = document.getElementById("enigmail_"+prefName);
if (prefElement) {
var prefType = gPrefEnigmail.getPrefType(prefName);
var prefValue;
if (showDefault) {
prefValue = EnigGetDefaultPref(prefName);
}
else {
prefValue = EnigGetPref(prefName);
}
DEBUG_LOG("enigmailCommon.js: EnigDisplayPrefs: "+prefName+"="+prefValue+"\n");
switch (prefType) {
case gPrefEnigmail.PREF_BOOL:
if (showPrefs) {
if (prefElement.getAttribute("invert") == "true") {
prefValue = ! prefValue;
}
if (prefValue) {
prefElement.setAttribute("checked", "true");
} else {
prefElement.removeAttribute("checked");
}
}
if (setPrefs) {
if (prefElement.getAttribute("invert") == "true") {
if (prefElement.checked) {
EnigSetPref(prefName, false);
} else {
EnigSetPref(prefName, true);
}
}
else {
if (prefElement.checked) {
EnigSetPref(prefName, true);
} else {
EnigSetPref(prefName, false);
}
}
}
break;
case gPrefEnigmail.PREF_INT:
if (showPrefs)
prefElement.value = prefValue;
if (setPrefs) {
try {
EnigSetPref(prefName, 0+prefElement.value);
} catch (ex) {}
}
break;
case gPrefEnigmail.PREF_STRING:
if (showPrefs)
prefElement.value = prefValue;
if (setPrefs)
EnigSetPref(prefName, prefElement.value);
break;
default:
DEBUG_LOG("enigmailCommon.js: EnigDisplayPrefs: "+prefName+" does not have a type?!\n");
}
}
}
}
function EnigFilePicker(title, displayDir, save, defaultExtension, defaultName, filterPairs) {
DEBUG_LOG("enigmailCommon.js: EnigFilePicker: "+save+"\n");
const nsIFilePicker = ENIG_C.interfaces.nsIFilePicker;
var filePicker = ENIG_C.classes["@mozilla.org/filepicker;1"].createInstance();
filePicker = filePicker.QueryInterface(nsIFilePicker);
var mode = save ? nsIFilePicker.modeSave : nsIFilePicker.modeOpen;
filePicker.init(window, title, mode);
if (displayDir) {
var localFile = ENIG_C.classes[ENIG_LOCAL_FILE_CONTRACTID].createInstance(ENIG_C.interfaces.nsILocalFile);
try {
localFile.initWithPath(displayDir);
filePicker.displayDirectory = localFile;
} catch (ex) {
}
}
if (defaultExtension)
filePicker.defaultExtension = defaultExtension;
if (defaultName)
filePicker.defaultString=defaultName;
var nfilters = 0;
if (filterPairs && filterPairs.length)
nfilters = filterPairs.length / 2;
for (var index=0; index < nfilters; index++) {
filePicker.appendFilter(filterPairs[2*index], filterPairs[2*index+1]);
}
filePicker.appendFilters(nsIFilePicker.filterAll);
if (filePicker.show() == nsIFilePicker.returnCancel)
return null;
var file = filePicker.file.QueryInterface(ENIG_C.interfaces.nsILocalFile);
return file;
}
function EnigRulesEditor() {
EnigOpenWin("enigmail:rulesEditor",
"chrome://enigmail/content/enigmailRulesEditor.xul",
"dialog,centerscreen,resizable");
}
function EnigOpenSetupWizard() {
window.open("chrome://enigmail/content/enigmailSetupWizard.xul",
"", "chrome,modal,centerscreen");
}
// get keys from keyserver
function EnigDownloadKeys(inputObj, resultObj) {
DEBUG_LOG("enigmailCommon.js: EnigSearchKeys: searchList="+inputObj.searchList+"\n");
resultObj.importedKeys=0;
var ioService = Components.classes[ENIG_IOSERVICE_CONTRACTID].getService(Components.interfaces.nsIIOService);
if (ioService && ioService.offline) {
EnigAlert(EnigGetString("needOnline"));
return;
}
var valueObj = {};
if (inputObj.searchList) {
valueObj = { keyId: "<"+inputObj.searchList.join("> <")+">" };
}
var keysrvObj = new Object();
window.openDialog("chrome://enigmail/content/enigmailKeyserverDlg.xul",
"", "dialog,modal,centerscreen", valueObj, keysrvObj);
if (! keysrvObj.value) {
return;
}
inputObj.keyserver = keysrvObj.value;
if (! inputObj.searchList) {
inputObj.searchList = keysrvObj.email.split(/[,; ]+/);
}
window.openDialog("chrome://enigmail/content/enigmailSearchKey.xul",
"", "dialog,modal,centerscreen", inputObj, resultObj);
}
// create new PGP Rule
function EnigNewRule(emailAddress) {
// make sure the rules database is loaded
var enigmailSvc = GetEnigmailSvc();
if (!enigmailSvc)
return false;
var rulesListObj= new Object;
// open rule dialog
enigmailSvc.getRulesData(rulesListObj);
var inputObj=new Object;
var resultObj=new Object;
inputObj.toAddress="{"+emailAddress+"}";
inputObj.options="";
inputObj.command = "add";
window.openDialog("chrome://enigmail/content/enigmailSingleRcptSettings.xul","",
"dialog,modal,centerscreen,resizable", inputObj, resultObj);
return true;
}
// Obtain kay list from GnuPG
function EnigObtainKeyList(secretOnly, refresh) {
DEBUG_LOG("enigmailCommon.js: EnigObtainKeyList\n");
try {
var exitCodeObj = new Object();
var statusFlagsObj = new Object();
var errorMsgObj = new Object();
var enigmailSvc = GetEnigmailSvc();
if (! enigmailSvc)
return null;
var userList = enigmailSvc.getUserIdList(secretOnly,
refresh,
exitCodeObj,
statusFlagsObj,
errorMsgObj);
if (exitCodeObj.value != 0) {
EnigAlert(errorMsgObj.value);
return null;
}
} catch (ex) {
ERROR_LOG("ERROR in enigmailCommon: EnigObtainKeyList\n");
}
if (typeof(userList) == "string") {
return userList.split(/\n/);
}
else {
return [];
}
}
// Load the key list into memory
function EnigLoadKeyList(refresh, keyListObj) {
DEBUG_LOG("enigmailCommon.js: EnigLoadKeyList\n");
var sortUsers = function (a, b) {
if (a.userId.toLowerCase()<b.userId.toLowerCase()) { return -1;} else {return 1; }
}
var aGpgUserList = EnigObtainKeyList(false, refresh);
if (!aGpgUserList) return;
var aGpgSecretsList = EnigObtainKeyList(true, refresh);
if (!aGpgSecretsList && !refresh) {
if (EnigConfirm(EnigGetString("noSecretKeys"))) {
EnigKeygen();
EnigLoadKeyList(true, keyListObj);
}
}
keyListObj.keyList = [];
keyListObj.keySortList = [];
var keyObj = new Object();
var i;
var uatNum=0; // counter for photos (counts per key)
for (i=0; i<aGpgUserList.length; i++) {
var listRow=aGpgUserList[i].split(/:/);
if (listRow.length>=0) {
switch (listRow[0]) {
case "pub":
keyObj = new Object();
uatNum = 0;
keyObj.expiry=EnigGetDateTime(listRow[EXPIRY], true, false);
keyObj.created=EnigGetDateTime(listRow[CREATED], true, false);
keyObj.keyId=listRow[KEY_ID];
keyObj.keyTrust=listRow[KEY_TRUST];
keyObj.keyUseFor=listRow[KEY_USE_FOR];
keyObj.ownerTrust=listRow[OWNERTRUST];
keyObj.SubUserIds=new Array();
keyObj.fpr="";
keyObj.photoAvailable=false;
keyObj.secretAvailable=false;
keyListObj.keyList[listRow[KEY_ID]] = keyObj;
break;
case "fpr":
keyObj.fpr=listRow[USER_ID];
break;
case "uid":
if (listRow[USER_ID].length == 0) {
listRow[USER_ID] = "-";
}
if (typeof(keyObj.userId) != "string") {
keyObj.userId=EnigConvertGpgToUnicode(listRow[USER_ID]).replace(/\\e3A/g, ":");
keyListObj.keySortList.push({userId: keyObj.userId, keyId: keyObj.keyId});
}
else {
var subUserId = {
userId: EnigConvertGpgToUnicode(listRow[USER_ID]).replace(/\\e3A/g, ":"),
keyTrust: listRow[KEY_TRUST],
type: "uid"
}
keyObj.SubUserIds.push(subUserId);
}
break;
case "uat":
if (listRow[USER_ID].indexOf("1 ")==0) {
var userId=EnigGetString("userAtt.photo");
keyObj.SubUserIds.push({userId: userId,
keyTrust:listRow[KEY_TRUST],
type: "uat",
uatNum: uatNum});
keyObj.photoAvailable=true;
++uatNum;
}
}
}
}
// search and mark keys that have secret keys
for (i=0; i<aGpgSecretsList.length; i++) {
listRow=aGpgSecretsList[i].split(/:/);
if (listRow.length>=0) {
if (listRow[0] == "sec") {
if (typeof(keyListObj.keyList[listRow[KEY_ID]]) == "object") {
keyListObj.keyList[listRow[KEY_ID]].secretAvailable=true;
}
}
}
}
keyListObj.keySortList.sort(sortUsers);
}
function EnigEditKeyTrust(userIdArr, keyIdArr) {
var inputObj = {
keyId: keyIdArr,
userId: userIdArr
}
var resultObj = { refresh: false };
window.openDialog("chrome://enigmail/content/enigmailEditKeyTrustDlg.xul","", "dialog,modal,centerscreen,resizable", inputObj, resultObj);
return resultObj.refresh;
}
function EnigSignKey(userId, keyId, signingKeyHint) {
var inputObj = {
keyId: keyId,
userId: userId,
signingKeyHint: signingKeyHint
}
var resultObj = { refresh: false };
window.openDialog("chrome://enigmail/content/enigmailSignKeyDlg.xul","", "dialog,modal,centerscreen,resizable", inputObj, resultObj);
return resultObj.refresh;
}
function EnigChangeKeyPwd(keyId, userId) {
var inputObj = {
keyId: keyId,
userId: userId
};
var enigmailSvc = GetEnigmailSvc();
if (!enigmailSvc)
return;
if (! enigmailSvc.useGpgAgent()) {
window.openDialog("chrome://enigmail/content/enigmailChangePasswd.xul",
"", "dialog,modal,centerscreen", inputObj);
}
else {
// gpg-agent will handle everything
var errorMsgObj = new Object();
var r = enigmailSvc.simpleChangePassphrase(window, "0x"+keyId, errorMsgObj);
if (r != 0) {
EnigAlert(EnigGetString("changePassFailed")+"\n\n"+errorMsgObj.value);
}
}
}
function EnigRevokeKey(keyId, userId) {
var enigmailSvc = GetEnigmailSvc();
if (!enigmailSvc)
return false;
var userDesc="0x"+keyId.substr(-8,8)+" - "+userId;
if (!EnigConfirm(EnigGetString("revokeKeyAsk", userDesc))) return;
var tmpDir=EnigGetTempDir();
try {
var revFile = Components.classes[ENIG_LOCAL_FILE_CONTRACTID].createInstance(Components.interfaces.nsILocalFile);
revFile.initWithPath(tmpDir);
if (!(revFile.isDirectory() && revFile.isWritable())) {
EnigAlert(EnigGetString("noTempDir"));
return false;
}
}
catch (ex) {}
revFile.append("revkey.asc");
revFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0600);
var errorMsgObj = {};
var r=enigmailSvc.genRevokeCert(window, "0x"+keyId, revFile.path, "0", "", errorMsgObj);
if (r != 0) {
revFile.remove(false);
EnigAlert(EnigGetString("revokeKeyFailed")+"\n\n"+errorMsgObj.value);
return false;
}
r = enigmailSvc.importKeyFromFile(window, revFile.path, errorMsgObj);
revFile.remove(false);
if (r != 0) {
EnigAlert(EnigGetString("revokeKeyFailed")+"\n\n"+EnigConvertGpgToUnicode(errorMsgObj.value).replace(/\\e3A/g, ":"));
}
else {
EnigAlert(EnigGetString("revokeKeyOk"));
}
return (r == 0);
}
function EnigShowPhoto(keyId, userId, photoNumber) {
var enigmailSvc = GetEnigmailSvc();
if (enigmailSvc) {
if (photoNumber==null) photoNumber=0;
var exitCodeObj = new Object();
var errorMsgObj = new Object();
var photoPath = enigmailSvc.showKeyPhoto("0x"+keyId, photoNumber, exitCodeObj, errorMsgObj);
if (photoPath && exitCodeObj.value==0) {
var photoFile = Components.classes[ENIG_LOCAL_FILE_CONTRACTID].createInstance(Components.interfaces.nsILocalFile);
photoFile.initWithPath(photoPath);
if (! (photoFile.isFile() && photoFile.isReadable())) {
EnigAlert("Photo path '"+photoPath+"' is not readable");
}
else {
var ioServ = Components.classes[ENIG_IOSERVICE_CONTRACTID].getService(Components.interfaces.nsIIOService);
var photoUri = ioServ.newFileURI(photoFile).spec;
var argsObj = {
photoUri: photoUri,
userId: userId,
keyId: keyId
};
window.openDialog("chrome://enigmail/content/enigmailDispPhoto.xul",photoUri, "chrome,modal=1,resizable=1,dialog=1,centerscreen", argsObj);
try {
// delete the photo file
photoFile.remove(false);
}
catch (ex) {}
}
}
else {
EnigAlert(EnigGetString("noPhotoAvailable"));
}
}
}
function EnigCreateRevokeCert(keyId, userId) {
var defaultFileName = userId.replace(/[\<\>]/g, "");
defaultFileName += " (0x"+keyId.substr(-8,8)+") rev.asc"
var outFile = EnigFilePicker(EnigGetString("saveRevokeCertAs"),
"", true, "*.asc",
defaultFileName,
[EnigGetString("asciiArmorFile"), "*.asc"]);
if (! outFile) return -1;
var enigmailSvc = GetEnigmailSvc();
if (!enigmailSvc)
return -1;
var errorMsgObj = {};
var r=enigmailSvc.genRevokeCert(window, "0x"+keyId, outFile.persistentDescriptor, "1", "", errorMsgObj);
if (r != 0) {
EnigAlert(EnigGetString("revokeCertFailed")+"\n\n"+errorMsgObj.value);
}
else {
EnigAlert(EnigGetString("revokeCertOK"));
}
return r;
}
function EngmailCardDetails() {
EnigOpenWin("enigmail:cardDetails",
"chrome://enigmail/content/enigmailCardDetails.xul",
"centerscreen");
}
// return the label of trust for a given trust code
function EnigGetTrustLabel(trustCode) {
var keyTrust;
switch (trustCode) {
case 'q':
keyTrust=EnigGetString("keyValid.unknown");
break;
case 'i':
keyTrust=EnigGetString("keyValid.invalid");
break;
case 'd':
keyTrust=EnigGetString("keyValid.disabled");
break;
case 'r':
keyTrust=EnigGetString("keyValid.revoked");
break;
case 'e':
keyTrust=EnigGetString("keyValid.expired");
break;
case 'n':
keyTrust=EnigGetString("keyTrust.untrusted");
break;
case 'm':
keyTrust=EnigGetString("keyTrust.marginal");
break;
case 'f':
keyTrust=EnigGetString("keyTrust.full");
break;
case 'u':
keyTrust=EnigGetString("keyTrust.ultimate");
break;
case '-':
keyTrust="-";
break;
default:
keyTrust="";
}
return keyTrust;
}
function EnigGetDateTime(dateNum, withDate, withTime) {
if (dateNum != 0) {
var dat=new Date(dateNum * 1000);
var appLocale = Components.classes[ENIG_LOCALE_SVC_CONTRACTID].getService(Components.interfaces.nsILocaleService).getApplicationLocale();
var dateTimeFormat = Components.classes[ENIG_DATE_FORMAT_CONTRACTID].getService(Components.interfaces.nsIScriptableDateFormat);
var dateFormat = (withDate ? dateTimeFormat.dateFormatShort : dateTimeFormat.dateFormatNone);
var timeFormat = (withTime ? dateTimeFormat.timeFormatNoSeconds : dateTimeFormat.timeFormatNone);
return dateTimeFormat.FormatDateTime(appLocale.getCategory("NSILOCALE_TIME"),
dateFormat,
timeFormat,
dat.getFullYear(), dat.getMonth()+1, dat.getDate(),
dat.getHours(), dat.getMinutes(), 0);
}
else {
return "";
}
}
function enigCreateInstance (aURL, aInterface)
{
return ENIG_C.classes[aURL].createInstance(ENIG_C.interfaces[aInterface]);
}
function enigGetInterface (aInterface) {
return rv = ENIG_C.interfaces[aInterface];
}
function enigGetService (aURL, aInterface)
{
// determine how 'aInterface' is passed and handle accordingly
switch (typeof(aInterface))
{
case "object":
return ENIG_C.classes[aURL].getService(aInterface);
break;
case "string":
return ENIG_C.classes[aURL].getService(ENIG_C.interfaces[aInterface]);
break;
default:
return ENIG_C.classes[aURL].getService();
}
return null;
}
function EnigCollapseAdvanced(obj, attribute, dummy) {
DEBUG_LOG("enigmailCommon.js: EnigCollapseAdvanced: test\n");
var advancedUser = EnigGetPref("advancedUser");
var obj = obj.firstChild;
while (obj) {
if (obj.getAttribute("advanced") == "true") {
if (advancedUser) {
obj.removeAttribute(attribute);
}
else {
obj.setAttribute(attribute, "true");
}
}
else if (obj.getAttribute("advanced") == "reverse") {
if (advancedUser) {
obj.setAttribute(attribute, "true");
}
else {
obj.removeAttribute(attribute);
}
}
obj = obj.nextSibling;
}
-}
\ No newline at end of file
+}
diff --git a/ui/locale/en-US/enigmail.properties b/ui/locale/en-US/enigmail.properties
index b5d4c546..4cf15480 100644
--- a/ui/locale/en-US/enigmail.properties
+++ b/ui/locale/en-US/enigmail.properties
@@ -1,449 +1,450 @@
Enigmail=Enigmail
# Strings used within enigmailCommon.js
enigAlert=OpenPGP Alert
enigConfirm=OpenPGP Confirm
enigError=OpenPGP Error
enigPrompt=OpenPGP Prompt
dlgYes=Yes
dlgNo=No
dlgNever=Do not ask me again
dlgKeepSetting=Remember my answer and do not ask me again
dlgNoPrompt=Do not show me this dialog again
configNow=Do you wish to configure Enigmail for version %S now?
configEnigmail=Configure Enigmail?
repeatPrefix=\n\nThis alert will repeat %S
repeatSuffixSingular=more time.
repeatSuffixPlural=more times.
noRepeat=\n\nThis alert will not repeat until you upgrade Enigmail.
noLogDir=Please set debug preference 'Log directory' to create a log file
noLogFile=Log file has not been created yet!
restartForLog=Please restart the application to create log file
pgpNotSupported=You seem to be using OpenPGP together with PGP 6.x\n\nUnfortunately, PGP 6.x has a number of issues that prevent Enigmail from working correctly. Therefore, Enigmail does not support PGP 6.x anymore; please switch to GnuPG (GPG) instead.\n\nIf you need help on switching to GnuPG, check the Help section of the Enigmail homepage.
avoidInitErr=To permanently avoid this alert, either fix the problem or uninstall Enigmail using the OpenPGP->Preferences menu
passphraseCleared=The passphrase has been cleared.
+passphraseCannotBeCleared=You are using gpg-agent for passphrase handling. Clearing the passphrase is therefore not possible from within Enigmail.
keyGeneration=OpenPGP Key Generation
noPhotoAvailable=No Photo available
# Strings in enigmailAbout.js
usingVersion=Running Enigmail version %S
versionWarning=Warning: Incompatible Enigmime version %S
enigmimeWarning=Warning: Enigmime module not available
usingAgent=Using %S executable %S to encrypt and decrypt
agentError=ERROR: Failed to access Enigmime service!
# Strings in enigmailKeygen.js
accessError=Error in accessing Enigmail service
onlyGPG=Key generation only works with GnuPG (not with PGP)!
keygenComplete=Key generation completed! Identity <%S> will be used for signing.
revokeCertRecommended=We highly recommend to create a revocation certificate for your key. This certificate can be used to invalidate your key, e.g. in case your secret key gets lost or compromised. Do you want to create such a revocation certificate now?
genCompleteNoSign=Key generation completed!
genGoing=Key generation already in progress!
passNoMatch=Passphrase entries do not match; please re-enter
passCheckBox=Please check box if specifying no passphrase for key
passUserName=Please specify user name for this identity
passCharProblem=You are using special characters in your passphrase. Unfortunately, this can cause troubles for other applications. Please choose a passphrase consisting of any of these characters:\na-z A-Z 0-9 /.;:-,!?(){}[]%*
changePassFailed=Changing the passphrase failed.
removePassphrase=Do you want to delete the current passphrase without creating a new one?
keyConfirm=Generate public and private keys for '%S'?
keyAbort=Abort key generation?
expiryTooLong=You cannot create a key that expires in more than 100 years.
expiryTooShort=Your key must be valid for at least one day.
keyGenFailed=The key generation failed. Please check the OpenPGP console (Menu OpenPGP > Debugging OpenPGP) for details.
keyGenNoPassphrase=no password
# Strings in enigmailMessengerOverlay.js
pubKeyNeeded=You need the public key in order to verify the signature.
keyImport=\n\nDo you want to import the public key %S from a keyserver?
keyImportError=Unable to receive public key\n\n
securityInfo=OpenPGP Security Info\n\n
enigHeader=Enigmail:
enigNote=Note from OpenPGP: Attachments to this message have not been signed or encrypted.
enigContentNote=OpenPGP: *Attachments to this message have not been signed or encrypted*\r\n\r\n
possiblyPgpMime=Possibly PGP/MIME encrypted or signed message; click Decrypt button to verify
noDecrypted=No decrypted message to save!\nUse Save command from File menu
noMessage=No message to save!
useButton=Please click Decrypt button to decrypt message
saveHeader=OpenPGP: Save decrypted message
saveAttachmentHeader=OpenPGP: Save decrypted attachment
noTempDir=Could not find a temporary directory to write to\nPlease set the TEMP environment variable
attachmentPgpKey=The attachment '%S' you are opening appears to be an OpenPGP key file.\n\nClick Yes to import the keys contained or No to view the file contents in a browser window
beginPgpPart=********* *BEGIN ENCRYPTED or SIGNED PART* *********
endPgpPart=********** *END ENCRYPTED or SIGNED PART* **********
notePartEncrypted=OpenPGP: *Parts of the message have NOT been signed or encrypted*
noteCutMessage=OpenPGP: *Multiple message blocks found -- decryption/verification aborted*
decryptOkNoSig=Warning\n\nDecryption was successful, but the signature could not be verified correctly
contAnyway=Do you want to continue anyway?
noPgpMessage=Message not OpenPGP signed or encrypted
# Strings in enigmailMsgComposeOverlay.js
keysToExport=Select OpenPGP Keys to Insert
keysToUse=Select OpenPGP Key(s) to use for %S
pubKey=Public key for %S\n
windowLocked=Compose window is locked; send cancelled
sendUnencrypted=Failed to initialize Enigmail.\nSend unencrypted message?
composeSpecifyEmail=Please specify your primary email address, which will be used to choose the signing key for outgoing messages.\n If you leave it blank, the FROM address of the message will be used to choose the signing key.
sendingBCC=This message has BCC (blind copy) recipients. If this message is encrypted, all recipients will be able to determine the identity of the BCC recipients by examining the encryption key list, leading to loss of confidentiality. \n\nClick Yes to proceed with encryption anyway, or No to abort the send operation.
sendingNews=Encrypted send operation aborted.\n\nThis message cannot be encrypted because there are newsgroup recipients. Please re-send the message without encryption.
noPGPMIME=PGP/MIME not available!\nUse inline PGP for signing/encryption?
hasHTML=HTML mail warning:\nThis message may contain HTML, which could cause signing/encryption to fail. To avoid this in the future, you should press the SHIFT key when clicking on the Compose/Reply button to send signed mail.\nIf you sign mail by default, you should uncheck the 'Compose Messages in HTML' preference box to permanently disable HTML mail for this mail account.
strippingHTML=Message contains HTML formatting information that will be lost when converting to plain text for signing/encryption. Do you wish to proceed?
attachWarning=Attachments to this message are not local, they cannot be encrypted. In order to encrypt the attachments, store them as local files first and attach these files. Do you wish to proceed anyway?
savingMessage=Do you want to encrypt the message before saving?
quotedPrintableWarn=You have enabled 'quoted-printable' encoding for sending messages. This may result in incorrect decryption and/or verification of your message.\n Do you wish to turn off sending 'quoted-printable' messages now?
minimalLineWrapping=You have set line wrapping to %S characters. For correct encryption and/or signing, this value needs to be at least 68.\nDo you wish to change line wrapping to 68 characters now?
warning=Warning
signIconClicked=You have manually modified signing. Therefore, while you are composing this message, (de)activating signing does not depend anymore on (de)activating encryption.
pgpMime.sMime.incomaptible=You have enabled PGP/MIME and S/MIME together. Unfortunately it is not possible to support both protocols at the same time. Please disable S/MIME or PGP/MIME, or use inline-PGP instead of PGP/MIME.
warnIso2022jp=Your message is encoded with the Japanese character set ISO-2022-JP. Unfortunately, due to technical reasons comaptibility to the OpenPGP standards cannot be ensured with this character set. Do you want to convert the message to UTF-8 instead?
sendAborted=Send operation aborted.\n\n
statPGPMIME=PGP/MIME
statSigned=SIGNED
statEncrypted=ENCRYPTED
statPlain=UNSIGNED and UNENCRYPTED
offlineSave=Save %S message to %S in Unsent Messages folder?
onlineSend=Send %S message to %S?
offlineNote=You are currently offline. Do you wish to save the message in the Unsent Messages folder?
encryptKeysNote=Note: the message is encrypted with the following User ID's / Keys: %S
signFailed=Error in OpenPGP; Encryption/signing failed; send unencrypted email?
acctNotConfigured=You did not configure this identity for using OpenPGP security.\nSend unencrypted message?
recipientsSelectionHdr=Select Recipients for Encryption
configureNow=You did not yet configure OpenPGP security for the selected identity. Do you want to do this now?
signYes=Message will be signed
signNo=Message will not be signed
encryptYes=Message will be encrypted
encryptNo=Message will not be encrypted
rulesConflict=Conflicting per-recipient rules detected\n%S\n\nSend message with these settings?
# Strings in enigmailMsgHdrViewOverlay.js
keyNeeded=Public key %S needed to verify signature
clickDecrypt=; click Decrypt button
clickDecryptRetry=; click Decrypt button to retry
clickPen=; click Pen icon
clickPenDetails=; click Pen icon for details
clickQueryPenDetails=; click Pen icon for details
clickKey=; click Key icon
clickQueryKeyDetails=; click Key icon for details
clickKeyDetails=; click Key icon for details
clickPenKeyDetails=; click Pen or Key icon for details
msgPart=Part of the message %S
msgSigned=signed
msgEncrypted=encrypted
msgSignedAndEnc=signed and encrypted
reloadImapMessage=Reload complete IMAP message to decrypt/verify?
reloadImapError=Error - IMAP message too large to decrypt/verify
unverifiedSig=Unverified signature
incompleteDecrypt=Decryption incomplete
failedSig=Error - signature verification failed
needKey=Error - secret key needed to decrypt message
failedDecrypt=Error - decryption failed
badPhrase=Error - bad passphrase
failedDecryptVerify=Error - decryption/verification failed
viewInfo=; View > Message security info for details
decryptedMsg=Decrypted message
# Strings in enigmailNavigatorOverlay.js
navEncryptError=Error in encrypting and/or signing message.\n
navDecryptError=Error in decrypting message.\n
# Strings in pref-enigmail.js
uninstallConfirm=Do you wish to delete all OpenPGP-related files in the Mozilla component and chrome directories?
uninstallFailOverlay=Failed to uninstall OpenPGP communicator overlay RDF; not deleting chrome jar file
uninstallFailDelete=Error in deleting file
uninstallFail=Failed to uninstall Enigmail
uninstallSuccess=Enigmail Uninstalled
testNoSvc=EnigTest: Failed to access Enigmail service
testNoEmail=EnigTest: Please specify mail address for testing
testSucceeded=OpenPGP is working properly. For details, check the Console available from the OpenPGP menu
oldGpgVersion=OpenPGP initialization failed.\n\nYou are using GnuPG version %S, which is not up to date anymore. Enigmail requires GnuPG version 1.2.5 or newer; please upgrade your GnuPG installation, or OpenPGP will not work.
locateGpg=Locate GnuPG program
invalidGpgPath=GnuPG cannot be executed with the path provided. OpenPGP is therefore deactivated until you change the path to GnuPG again or until you restart the application.
warningsAreReset=All warnings have been reset.
prefs.gpgFound=GnuPG was found in %S
prefs.gpgNotFound=Could not find GnuPG
prefs.warnAskNever=Warning: activating this option will result in unencrypted emails without any further information if there is no key for one of the recipients -- OpenPGP will not inform you if this happens!
# Strings used in components/enigmail.js
# (said file also re-uses some strings from above)
enterPass=Please type in your OpenPGP passphrase
enterPassOrPin=Please type in your OpenPGP passphrase or your SmartCard PIN
repeatPass=Please repeat your OpenPGP passphrase
rememberPass=Remember for %S idle minutes
enterAdminPin=Please type in the ADMIN PIN of your SmartCard
enterCardPin=Please type your SmartCard PIN
notInit=Error - Enigmail service not yet initialized
badCommand=Error - encryption command failed
cmdLine=command line and output:
notRequired=Error - no encryption required
notComplete=Error - key generation not yet completed
invalidEmail=Error - invalid email address(es)
noPassphrase=Error - no passphrase supplied
noPGPblock=Error - No valid armored OpenPGP data block found
unverifiedReply=Indented message part (reply) was probably modified
decryptToImport=Click Decrypt button to import public key block in message
sigMismatch=Error - Signature mismatch
cantImport=Error in importing public key\n\n
messageSizeError=Message too large to be verified
sc.noCardAvailable=No SmartCard could not be found in your reader\nPlease insert your SmartCard and repeat the operation
sc.noReaderAvailable=Your SmartCard reader could not be accessed\nPlease attach your SmartCard reader, insert your card, and repeat the operation
gpgNotFound=Unable to locate GnuPG program '%S'.\nMake sure you have set the GnuPG executable path correctly in the OpenPGP Preferences
gpgNotInPath=Unable to locate GnuPG executable in the PATH.\nMake sure you have set the GnuPG executable path correctly in the OpenPGP Preferences
enigmimeNotAvail=Enigmime Service not available
gpgAgentNotStarted=Could not start the gpg-agent program which is needed for your GnuPG version %S.
prefUntrusted=UNTRUSTED
prefRevoked=REVOKED KEY
prefExpiredKey=EXPIRED KEY
prefExpired=EXPIRED
prefGood=Good signature from %S
prefBad=BAD signature from %S
failFingerprint=Error - fingerprint extraction command failed
failMultiple=Error - Multiple keys found for %S
failNoKey=Error - No key found for %S
failCancel=Error - Key receive cancelled by user
failNoServer=Error - No keyserver specified to receive key from
failNoID=Error - No key ID specified to receive key for
failKeyExtract=Error - key extraction command failed
notFirstBlock=Error - First OpenPGP block not public key block
importKeyConfirm=Import public key(s) embedded in message?
failKeyImport=Error - key importing failed
fileWriteFailed=Failed to write to file %S
successKeyImport=The key(s) were successfully imported
importKey=Import public key %S from keyserver:
uploadKey=Send public key %S to keyserver:
keyId=Key ID
keyAndSigDate=Key ID: 0x%S / Signed on: %S
keyFpr=Key fingerprint: %S
photoFor=OpenPGP Photo ID for %S
noEmailProvided=You did not provide an email address!
invalidRecp=Invalid recipients: %S
# Strings used in enigmailUserSelection.js
selKeyExpired=expired %S
createdHeader=Created
keyInvalid=INVALID KEY
keyDisabled=DISABLED KEY
atLeastOneKey=No key selected! You have to select at least one key for accepting this dialog
# Strings used in enigmailAttachmentDialog.js
pgpMimeNote=NOTE: PGP/MIME is only supported by a limited number of mail clients! On Windows only Mozilla/Thunderbird, Sylpheed, Pegasus and Mulberry are known to support this standard; on Linux/UNIX and Mac OS X most popular mail clients support it. If you are unsure, select the %S option.
first=first
second=second
# Strings used in am-enigprefs.js
encryptKeyHeader=Select OpenPGP Key for Encryption
identityName=Identity: %S
# Strings used in enigmailSingleRcptSettings.js
noEncryption=You have activated encryption, but you did not select a key. In order to encrypt mails sent to %S, you need to specify one or several valid key(s) from your key list. Do you want to disable encryption for %S?
noKeyToUse=(none - no encryption)
noEmptyRule=The Rule may not be empty! Please set an email address in the Rule field.
invalidAddress=The email address(es) you have entered are not valid. You should not set the names of the recipients, just the email addresses. E.g.:\nInvalid: Some Name <some.name@address.net>\nValid: some.name@address.net
noCurlyBrackets=The curly brackets {} have a special meaning and should not be used in the email addresses. If you want to modify the matching behavior for this rule, use the 'Apply rule if recipient ...' option.\nMore information is available from the Help button.
# Strings used in enigmailRulesEditor.js
never=Never
always=Always
possible=Possible
deleteRule=Really delete the selected rule?
nextRcpt=(Next recipient)
negateRule=Not
# Strings used in enigmailSearchKey.js
needOnline=The function you have selected is not available in offline mode. Please go online and try again.
protocolNotSupported=The protocol '%S://' that you have selected is not supported for downloading OpenPGP keys.
gpgkeysDisabled=It might help to enable the option 'extensions.enigmail.useGpgKeysTool'.
noKeyserverConn=Could not connect to keyserver at %S.
keyDownloadFailed=Failed to download key from keyserver. Status message is:\n%S
internalError=An internal error occurred. The keys could not be downloaded or imported.
noKeyFound=I am sorry, could not find any key that would match the specified search criteria.\nPlease note that key ID's should be prefixed with "0x" (e.g. 0xABCDEF12).
# gpgkeys_%S is one of the gpg command line tools gpgkeys_hkp, gpgkeys_ldap, etc.
gpgKeysFailed=Failed to search or download key from keyserver: gpgkeys_%S could not be executed.
# Strings in enigmailEditKeyTrustDlg.xul
setKeyTrustFailed=Setting owner trust failed
setKeyTrustOK=Owner trust successfully set
# Strings in enigmailSignKeyDlg.xul
signKeyFailed=Key signing failed
signKeyOK=Key successfully signed
undefinedError=An undefined error occurred.
keyAlreadySigned=The key is already signed, you cannot sign it twice.
noSignKeyExpired=The key is expired. You can only sign keys that are still valid.
# Strings in enigmailKeyManager.js
keyMan.loadingKeys=Loading keys, please wait ...
keyValid.unknown=unknown
keyValid.invalid=invalid
keyValid.disabled=disabled
keyValid.revoked=revoked
keyValid.expired=expired
keyValid.noSubkey=no valid subkey
keyValid.valid=valid
keyTrust.untrusted=untrusted
keyTrust.marginal=marginal
keyTrust.full=trusted
keyTrust.ultimate=ultimate
keyType.public=pub
keyType.publicAndSec=pub/sec
keyMan.enableKey=Enable Key
keyMan.disableKey=Disable Key
userAtt.photo=User attribute (JPEG image)
asciiArmorFile=ASCII Armored Files (*.asc)
gnupgFile=GnuPG Files
saveRevokeCertAs=Create & Save Revocation Certificate
revokeCertOK=The revocation certificate has been successfully created. You can use it to invalidate your public key, e.g. in case you would lose your secret key.\n\nPlease transfer it to a medium which can be stored away safely such as a CD or Floppy Disk. If somebody gains access to this certificate they can use it to render your key unusable.
revokeCertFailed=The revocation certificate could not be created.
addUidOK=User ID added successfully
addUidFailed=Adding the User ID failed
noKeySelected=You should select at least on key in order to perform the selected operation
exportToFile=Export Public Key To File
exportSecretKey=Do you want to include the secret key in the saved OpenPGP key file?
saveKeysOK=The keys were successfully saved
saveKeysFailed=Saving the keys failed
importKeysFailed=Importing the keys failed
enableKeyFailed=Enabling/disabling the keys failed
specificPubKeyFilename=%S (0x%S) pub
specificPubSecKeyFilename=%S (0x%S) pub-sec
defaultPubKeyFilename=Exported-public-keys
defaultPubSecKeyFilename=Exported-public-and-secret-keys
noSecretKeys=No secret keys found.\n\nDo you want to generate your own key now?
sendKeysOk=Key(s) sent successfully
sendKeysFailed=Sending of keys failed
receiveKeysOk=Key(s) updated successfully
receiveKeysFailed=Downloading of keys failed
importFromClip=Do you want to import some key(s) from clipboard?
copyToClipbrdFailed=Could not copy the selected key(s) to the clipboard.
copyToClipbrdOK=Key(s) copied to clipboard
deleteSecretKey=WARNING: You are about to delete a secret key!\nIf you delete your secret key, you will no longer be able to decrypt any messages encrypted for that key, and you cannot revoke your key anymore.\n\nDo you really want to delete BOTH, the secret key and the public key\n'%S'?
deleteMix=WARNING: You are about to delete secret keys!\nIf you delete your secret key, you will no longer be able to decrypt any messages encrypted for that key.\n\nDo you really want to delete BOTH, the selected secret and public keys?
deletePubKey=Do you want to delete the public key\n'%S'?
deleteSelectedPubKey=Do you want to delete the public keys?
deleteKeyOk=Key successfully deleted
deleteKeyFailed=The key could not be deleted.
revokeKeyAsk=This function creates and imports a revocation certificate. Do you really want to revoke the key %S?
revokeKeyOk=The key has been revoked. If your key is available on a key server, it is recommended to re-upload it, so that others can see the revocation.
revokeKeyFailed=The key could not be revoked.
uploadingKey=Uploading key(s)...
downloadingKey=Downloading key(s)...
keyserverAccessAborted=aborted
refreshAllQuestion=You did not select any key. Would you like to refresh ALL keys?
refreshKey.warn=Warning: depending on the number of keys and the connection speed, refreshing all keys could be quite a lengthy process!\n\nContinue?
keylist.noOtherUids=Has no other identities
keylist.hasOtherUids=Also known as
keylist.noPhotos=No photograph available
keylist.hasPhotos=Photographs
# Strings in enigmailViewKeySigDlg.xul
keySignatureLocal=Local
keySignatureExportable=Exportable
keySignatureNoKey=No key
userIdNotFound=(User ID not found)
retrieveKeyConfirm=The key is not available - do you want to download it from a key server?
# Strings in enigmailManageUidDlg.xul
changePrimUidFailed=Changing the primary User ID failed
changePrimUidOK=The primary user ID was changed successfully
deleteUidFailed=Deleting the user ID %S failed
deleteUidOK=User ID %S was deleted successfully
revokeUidFailed=Revoking the user ID %S failed
revokeUidOK=User ID %S was revoked successfully. If your key is available on a key server, it is recommended to re-upload it, so that others can see the revocation.
revokeUidQuestion=Do you really want to revoke the user ID %S?
deleteUidQuestion=Do you really want to delete the user ID %S?\n\nPlease note: if you have submitted your public key to a key server, deleting a user ID will not change anything. In this case you should use 'Revoke user ID'.
# Strings in enigmailKeyDetailsDlg.xul
keyTypePublic=public key
keyTypeSubkey=subkey
keyTypePair=key pair
keyExpiryNever=never
keyAlgorithm_1=RSA
keyAlgorithm_2=RSA
keyAlgorithm_3=RSA
keyAlgorithm_16=ELG
keyAlgorithm_17=DSA
keyAlgorithm_20=ELG
# Strings in enigmailGenCardKey.xul
keygen.started=Please wait while the key is being generated ....
keygen.completed=Key Generated. The new Key ID is: 0x%S
keygen.keyBackup=The key is backed up as %S
keygen.passRequired=Please specify a passphrase if you want to create a backup copy of your key outside your SmartCard.
# Strings in enigmailSetCardPin.xul
cardPin.dontMatch=The PIN you have entered do not match; please re-enter
cardPin.minLength=The PIN must have at least %S characters or numbers
cardPin.processFailed=Failed to change PIN
# Strings in enigRetrieveProgres.xul
keyserverProgress.refreshing=Refreshing keys, please wait ...
keyserverProgress.uploading=Uploading keys, please wait ...
keyserverTitle.refreshing=Refresh Keys
keyserverTitle.uploading=Key Upload
# Strings in enigmailSetupWizard
setupWizard.gpgNotFound=Could not find GnuPG, please specify path
passphrase.min8keys=Your passphrase should contain at least 8 characters!
setupWizard.applyAllId=Activate OpenPGP for all identities
setupWizard.applySomeId=Activate OpenPGP for the identities: %S
setupWizard.applySingleId=Activate OpenPGP for your email account
setupWizard.setAllPrefs=Adjust all recommended application settings
setupWizard.setSomePrefs=Adjust the recommended application settings you have selected
setupWizard.setNoPrefs=Do not adjust any application settings
setupWizard.createKey=Create a new 2048-bit OpenPGP key, valid for 5 years
setupWizard.useKey=Use the existing OpenPGP key ID %S for signing
setupWizard.encryptAll=Encrypt all emails by default
setupWizard.encryptNone=Do not encrypt emails by default
setupWizard.signAll=Sign all emails by default
setupWizard.signNone=Do not sign emails by default
setupWizard.reallyCancel=Do you really want to cancel the OpenPGP Setup Wizard?
setupWizard.locateGpg=The Wizard could not find the GnuPG executable, please locate it manually in the following dialog. If you did not install GnuPG yet, we recommend you visit http://www.gnupg.org.
# Strings in enigmailAddUidDlg.xul
addUidDlg.nameOrEmailError=You have to fill in a name and an email address
addUidDlg.nameMinLengthError=The name must at least have 5 characters
addUidDlg.invalidEmailError=You must specify a valid email address
addUidDlg.commentError=Brackets are not allowed in comments
# strings in pref-enigmail.js
-prefEnigmail.oneKeyserverOnly=Error - you can only specify one keyserver for automatic downloading of missing OpenPGP keys.
\ No newline at end of file
+prefEnigmail.oneKeyserverOnly=Error - you can only specify one keyserver for automatic downloading of missing OpenPGP keys.

File Metadata

Mime Type
text/x-diff
Expires
Sun, Apr 5, 11:41 AM (1 d, 14 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
85/53/022760204ed8c42752ea8e0771f0

Event Timeline