Commit 91d1db2f authored by Nico Josuttis's avatar Nico Josuttis

try different options for accepted keys

parent 2cda0978
......@@ -70,6 +70,14 @@ pref("extensions.enigmail.composeHtmlAlertCount",3);
// enable confirm dialog before sending message
pref("extensions.enigmail.confirmBeforeSend",false);
// ask to confirm before sending
// 0: never
// 1: always
// 2: if send encrypted
// 3: if send unencrypted
// 4: if send (un)encrypted due to rules
pref("extensions.enigmail.confirmBeforeSending",0);
// prefer S/MIME or PGP/MIME (0: PGP/MIME, 1: ask, 2: S/MIME)
pref("extensions.enigmail.mimePreferPgp",1);
......@@ -145,21 +153,16 @@ pref("extensions.enigmail.quotedPrintableWarn",0);
// use http proxy settings as set in Mozilla/Thunderbird
pref("extensions.enigmail.respectHttpProxy",true);
// selection for which keys to accept (trust-model always)
// 0: accept valid/authenticated keys
// 1: accept all keys (except disabled, ...)
pref("extensions.enigmail.acceptedKeys",0);
// selection for automatic send encrypted if all keys valid
// 0: never
// 1: with full trust
// 2: with marginal trust
// 3: with unknown trust
// 1: if all keys found and valid
pref("extensions.enigmail.autoSendEncrypted",0);
// ask to confirm before sending
// 0: never
// 1: always
// 2: if send encrypted
// 3: if send unencrypted
// 4: if send (un)encrypted due to rules
pref("extensions.enigmail.confirmBeforeSending",0);
// selection of keys for unkown recipients
// 1: rules only
// 2: rules & email addresses (normal)
......
......@@ -143,11 +143,8 @@ var gUsePGPMimeOptionList = ["usePGPMimeNever",
"usePGPMimePossible",
"usePGPMimeAlways"];
var gEnigRecipientsSelection = ["-",
"perRecipientRules",
"perRecipientRulesAndEmail",
"perEmailAddress",
"askRecipientsAlways"];
var gEnigAcceptedKeys = ["acceptedKeysValid",
"acceptedKeysAll"];
var gEnigAutoSendEncrypted = ["autoSendEncryptedNever",
"autoSendEncryptedIfValid"];
......@@ -158,6 +155,12 @@ var gEnigConfirmBeforeSending = ["confirmBeforeSendingNever",
"confirmBeforeSendingIfNotEncrypted",
"confirmBeforeSendingIfRules"];
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;
......
......@@ -284,16 +284,28 @@ Enigmail.hlp = {
if (!autoSendEncrypted) {
return null;
}
var alwaysTrustSend = EnigmailCommon.getPref("alwaysTrustSend");
var acceptedKeys = EnigmailCommon.getPref("acceptedKeys");
var minTrustLevel;
switch (autoSendEncrypted) {
case 0: // EncNever
return null;
break;
case 1: // EncIfValid
minTrustLevel = alwaysTrustSend ? "-" : "f";
switch (acceptedKeys) {
case 0: // accept valid/authenticated keys only
minTrustLevel = "f";
break;
case 1: // accept all but revoked/disabled/expired keys
minTrustLevel = "-";
break;
default:
EnigmailCommon.DEBUG_LOG("enigmailMsgComposeOverlay.js: validKeysForAllRecipients(): INVALID VALUE for acceptedKeys: \""+acceptedKeys+"\"\n");
return null;
break;
}
break;
default:
EnigmailCommon.DEBUG_LOG("enigmailMsgComposeOverlay.js: validKeysForAllRecipients(): INVALID VALUE for autoSendEncrypted: \""+autoSendEncrypted+"\"\n");
return null;
break;
}
......
......@@ -298,6 +298,7 @@ Enigmail.msg = {
toobarElem.setAttribute("platform", "macos");
}
// check rules for status bar icons with every excipients modification
var adrCol = document.getElementById("addressCol2#1");
if (adrCol) {
var attr = adrCol.getAttribute("oninput");
......@@ -305,6 +306,13 @@ Enigmail.msg = {
attr = adrCol.getAttribute("onchange");
adrCol.setAttribute("onchange", attr+"; Enigmail.msg.addressOnChange().bind(Enigmail.msg);");
}
adrCol = document.getElementById("addressCol1#1");
if (adrCol) {
var attr = adrCol.getAttribute("oncommand");
adrCol.setAttribute("oncommand", attr+"; Enigmail.msg.addressOnChange().bind(Enigmail.msg);");
//attr = adrCol.getAttribute("onchange");
//adrCol.setAttribute("onchange", attr+"; Enigmail.msg.addressOnChange().bind(Enigmail.msg);");
}
if (EnigmailCommon.getPref("keepSettingsForReply") && (!(this.sendMode & ENCRYPT))) {
var draftId = gMsgCompose.compFields.draftId;
......@@ -1676,9 +1684,23 @@ Enigmail.msg = {
var optSendFlags = 0;
var inlineEncAttach=false;
if (EnigmailCommon.getPref("alwaysTrustSend") || this.trustAllKeys) {
// request or preference to always accept (even non-authenticated) keys?
if (this.trustAllKeys) {
optSendFlags |= nsIEnigmail.SEND_ALWAYS_TRUST;
}
else {
var acceptedKeys = EnigmailCommon.getPref("acceptedKeys");
switch (acceptedKeys) {
case 0: // accept valid/authenticated keys only
break;
case 1: // accept all but revoked/disabled/expired keys
optSendFlags |= nsIEnigmail.SEND_ALWAYS_TRUST;
break;
default:
EnigmailCommon.DEBUG_LOG("enigmailMsgComposeOverlay.js: validKeysForAllRecipients(): INVALID VALUE for acceptedKeys: \""+acceptedKeys+"\"\n");
break;
}
}
if (EnigmailCommon.getPref("encryptToSelf") || (sendFlags & nsIEnigmail.SAVE_MESSAGE)) {
optSendFlags |= nsIEnigmail.SEND_ENCRYPT_TO_SELF;
......
......@@ -176,12 +176,14 @@ function prefOnLoad() {
}
EnigDisplayRadioPref("acceptedKeys", EnigGetPref("acceptedKeys"),
gEnigAcceptedKeys);
EnigDisplayRadioPref("autoSendEncrypted", EnigGetPref("autoSendEncrypted"),
gEnigAutoSendEncrypted);
EnigDisplayRadioPref("recipientsSelection", EnigGetPref("recipientsSelection"),
gEnigRecipientsSelection);
EnigDisplayRadioPref("confirmBeforeSending", EnigGetPref("confirmBeforeSending"),
gEnigConfirmBeforeSending);
EnigDisplayRadioPref("recipientsSelection", EnigGetPref("recipientsSelection"),
gEnigRecipientsSelection);
gMimePartsElement = document.getElementById("mime_parts_on_demand");
......
......@@ -90,6 +90,15 @@
<description>&enigmail.confirmBeforeSend.tooltip;</description>
</tooltip>
<!-- basic: accepted keys (trust-model always) -->
<tooltip id="acceptedKeysValid.tooltip">
<description>&enigmail.acceptedKeysValid.tooltip;</description>
</tooltip>
<tooltip id="acceptedKeysAll.tooltip">
<description>&enigmail.acceptedKeysAll.tooltip;</description>
</tooltip>
<!-- basic: auto send encrypted -->
<tooltip id="autoSendEncryptedNever.tooltip">
<description>&enigmail.autoSendEncryptedNever.tooltip;</description>
</tooltip>
......@@ -97,9 +106,6 @@
<description>&enigmail.autoSendEncryptedIfValid.tooltip;</description>
</tooltip>
<tooltip id="confirmBeforeSendingNever.tooltip">
<description>&enigmail.confirmBeforeSendingNever.tooltip;</description>
</tooltip>
<tooltip id="confirmBeforeSendingAlways.tooltip">
<description>&enigmail.confirmBeforeSendingAlways.tooltip;</description>
</tooltip>
......@@ -112,6 +118,9 @@
<tooltip id="confirmBeforeSendingIfRules.tooltip">
<description>&enigmail.confirmBeforeSendingIfRules.tooltip;</description>
</tooltip>
<tooltip id="confirmBeforeSendingNever.tooltip">
<description>&enigmail.confirmBeforeSendingNever.tooltip;</description>
</tooltip>
<tooltip id="perRecipientRules.tooltip">
<description>&enigmail.perRecipientRules.tooltip;</description>
......@@ -164,7 +173,7 @@
<tabbox flex="1" style="margin:5px" id="prefTabs">
<tabs id="prefTabBox">
<tab id="basicTab" label="&enigmail.basic.label;"/>
<tab id="sendTab" label="&enigmail.sending.label;" advanced="true"/>
<tab id="sendTab" label="&enigmail.sending.label;"/>
<tab id="keySelTab" label="&enigmail.keySel.label;" advanced="true"/>
<tab id="advancedTab" label="&enigmail.advancedPrefsButton.label;" advanced="true"/>
<tab id="keyserverTab" label="&enigmail.keyserver.label;" advanced="true"/>
......@@ -254,26 +263,39 @@
</vbox>
<!-- "Sending" Tab -->
<vbox id="sending" flex="1"
advanced="true">
<vbox id="sending" flex="1">
<description class="enigmailPrefsTitle">&enigmail.whenSending.label; ...</description>
<checkbox id="enigmail_wrapHtmlBeforeSend"
label="&enigmail.wrapHtmlBeforeSend.label;"
tooltip="wrapHtmlBeforeSend.tooltip"/>
<checkbox id="enigmail_keepSettingsForReply"
tooltip="keepCryptoSettingsForReply.tooltip"
label="&enigmail.keepCryptoSettingsForReply.label;" />
<!-- basic: accepted keys (trust-model always) -->
<!--
<checkbox id="enigmail_alwaysTrustSend"
label="&enigmail.alwaysTrustSend.label;"
tooltip="alwaysTrustSend.tooltip"/>
-->
<groupbox>
<caption label="&enigmail.acceptedKeysOption.label;"/>
<radiogroup id="enigmail_acceptedKeys"
pref="true"
preftype="int"
prefstring="extensions.enigmail.acceptedKeys">
<radio id="acceptedKeysValid"
value="0"
label="&enigmail.acceptedKeysValid.label;"
tooltip="acceptedKeysValid.tooltip"/>
<radio id="acceptedKeysAll"
value="1"
label="&enigmail.acceptedKeysAll.label;"
tooltip="acceptedKeysAll.tooltip"/>
</radiogroup>
</groupbox>
<checkbox id="enigmail_allowEmptySubject"
hidden="true"/>
<!--
<checkbox id="enigmail_confirmBeforeSend"
label="&enigmail.confirmBeforeSend.label;"
tooltip="confirmBeforeSend.tooltip"/>
-->
<!-- options to automatically send encrypted -->
<groupbox>
<caption label="&enigmail.autoSendEncryptedOption.label;"/>
......@@ -281,50 +303,49 @@
pref="true"
preftype="int"
prefstring="extensions.enigmail.autoSendEncrypted">
<radio id="autoSendEncryptedNever"
value="0"
label="&enigmail.autoSendEncryptedNever.label;"
tooltip="autoSendEncryptedNever.tooltip"/>
<radio id="autoSendEncryptedIfValid"
value="1"
label="&enigmail.autoSendEncryptedIfValid.label;"
tooltip="autoSendEncryptedIfValid.tooltip"/>
</radiogroup>
</groupbox>
<!-- options to automatically send encrypted -->
<!--
<checkbox id="enigmail_confirmBeforeSend"
label="&enigmail.confirmBeforeSend.label;"
tooltip="confirmBeforeSend.tooltip"/>
-->
<!-- options to confirm Before Sending -->
<groupbox>
<caption label="&enigmail.confirmBeforeSending.label;"/>
<radiogroup id="enigmail_confirmBeforeSending"
pref="true"
preftype="int"
prefstring="extensions.enigmail.confirmBeforeSending">
<radio id="confirmBeforeSendingNever"
value="0"
label="&enigmail.confirmBeforeSendingNever.label;"
tooltip="confirmBeforeSendingNever.tooltip"/>
<radio id="confirmBeforeSendingAlways"
value="1"
label="&enigmail.confirmBeforeSendingAlways.label;"
tooltip="confirmBeforeSendingAlways.tooltip"/>
<radio id="confirmBeforeSendingIfEncrypted"
value="2"
label="&enigmail.confirmBeforeSendingIfEncrypted.label;"
tooltip="confirmBeforeSendingIfEncrypted.tooltip"/>
<radio id="confirmBeforeSendingIfNotEncrypted"
value="3"
label="&enigmail.confirmBeforeSendingIfNotEncrypted.label;"
tooltip="confirmBeforeSendingIfNotEncrypted.tooltip"/>
<radio id="confirmBeforeSendingIfRules"
value="4"
label="&enigmail.confirmBeforeSendingIfRules.label;"
tooltip="confirmBeforeSendingIfRules.tooltip"/>
<radio id="confirmBeforeSendingNever"
value="0"
label="&enigmail.confirmBeforeSendingNever.label;"
tooltip="confirmBeforeSendingNever.tooltip"/>
</radiogroup>
</groupbox>
</vbox>
......@@ -385,9 +406,9 @@
<description class="enigmailPrefsTitle">&enigmail.moreOptions.label;</description>
<spacer flex="0"/>
<checkbox id="enigmail_keepSettingsForReply"
tooltip="keepCryptoSettingsForReply.tooltip"
label="&enigmail.keepCryptoSettingsForReply.label;" />
<checkbox id="enigmail_wrapHtmlBeforeSend"
label="&enigmail.wrapHtmlBeforeSend.label;"
tooltip="wrapHtmlBeforeSend.tooltip"/>
<checkbox id="enigmail_useDefaultComment"
invert="true"
......
......@@ -207,10 +207,16 @@
<!ENTITY enigmail.defaultEncryptionNone.label "No default encryption">
<!ENTITY enigmail.defaultNotSignedsend.label "Do not sign messages by default">
<!ENTITY enigmail.acceptedKeysOption.label "Accept the following keys to send encrypted">
<!ENTITY enigmail.acceptedKeysValid.label "Authenticated keys">
<!ENTITY enigmail.acceptedKeysValid.tooltip "Keys for email recipients are only accepted if they are valid for encryption according to the Web of Trust">
<!ENTITY enigmail.acceptedKeysAll.label "All valid keys (even if not authenticated)">
<!ENTITY enigmail.acceptedKeysAll.tooltip "Keys for email recipients are accepted if not disabled/revoked/expired">
<!ENTITY enigmail.autoSendEncryptedOption.label "Automatically send encrypted">
<!ENTITY enigmail.autoSendEncryptedNever.label "Never (except according to recipient rules)">
<!ENTITY enigmail.autoSendEncryptedNever.tooltip "Don't automatically send encrypted except explicitly triggered by rules">
<!ENTITY enigmail.autoSendEncryptedIfValid.label "If we have trusted keys for all e-mail addresses">
<!ENTITY enigmail.autoSendEncryptedIfValid.label "If we have accepted keys for all email addresses and no rule forcing not to encrypt">
<!ENTITY enigmail.autoSendEncryptedIfValid.tooltip "Automatically send encrypted when all keys are known and valid or enabled the option to always trust all keys">
<!ENTITY enigmail.confirmBeforeSending.label "Confirm before sending">
......@@ -243,7 +249,7 @@
<!ENTITY enigmail.usePGPMimeAlways.label "Use PGP/MIME by default">
<!ENTITY enigmail.autoEncryptDrafts.label "Encrypt draft messages on saving">
<!ENTITY enigmail.keepCryptoSettingsForReply.label "Encrypt/sign replies to encrypted/signed message">
<!ENTITY enigmail.keepCryptoSettingsForReply.label "Encrypt/sign replies to encrypted/signed messages">
<!ENTITY enigmail.confirmBeforeSend.label "Always confirm before sending">
<!ENTITY enigmail.confirmBeforeSend.tooltip "Activate to display information dialog about signing/encryption before sending a message">
<!ENTITY enigmail.wrapHtmlBeforeSend.label "Re-wrap signed HTML text before sending">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment