Commit aa9d2f65 authored by Nico Josuttis's avatar Nico Josuttis

more conditions for confirmation before sending the final email

 replaces confirmBeforeSend by confirmBeforeSending
 migration from confirmBeforeSend to confirmBeforeSending MISSING
parent 31916750
......@@ -3111,7 +3111,9 @@ function ConfigureEnigmail() {
}
catch (ex) {}
}
else if (vc.compare(oldVer, "1.0") < 0) upgradeCustomHeaders();
else if (vc.compare(oldVer, "1.0") < 0) {
upgradeCustomHeaders();
}
}
catch(ex) {};
EnigmailCommon.setPref("configuredVersion", EnigmailCommon.getVersion());
......
......@@ -152,6 +152,14 @@ pref("extensions.enigmail.respectHttpProxy",true);
// 3: with unknown trust
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)
......
......@@ -2033,7 +2033,26 @@ Enigmail.msg = {
// update the list of attachments
Attachments2CompFields(msgCompFields);
if ((!(sendFlags & nsIEnigmail.SAVE_MESSAGE)) && EnigmailCommon.getPref("confirmBeforeSend")) {
var confirm = false;
var conf = EnigmailCommon.getPref("confirmBeforeSending");
switch (conf) {
case 0: // never
confirm = false;
break;
case 1: // always
confirm = true;
break;
case 2: // if send encrypted
confirm = ((sendFlags&ENCRYPT) == ENCRYPT);
break;
case 3: // if send unencrypted
confirm = ((sendFlags&ENCRYPT) == 0);
break;
case 4: // if encryption changed due to rules
confirm = ((sendFlags&ENCRYPT) != (this.sendMode&ENCRYPT));
break;
}
if ((!(sendFlags & nsIEnigmail.SAVE_MESSAGE)) && confirm) {
if (!this.confirmBeforeSend(toAddrList.join(", "), toAddr+", "+bccAddr, sendFlags, isOffline)) {
if (this.processed) {
this.undoEncryption(0);
......
......@@ -178,9 +178,10 @@ function prefOnLoad() {
EnigDisplayRadioPref("autoSendEncrypted", EnigGetPref("autoSendEncrypted"),
gEnigAutoSendEncrypted);
EnigDisplayRadioPref("recipientsSelection", EnigGetPref("recipientsSelection"),
gEnigRecipientsSelection);
EnigDisplayRadioPref("confirmBeforeSending", EnigGetPref("confirmBeforeSending"),
gEnigConfirmBeforeSending);
gMimePartsElement = document.getElementById("mime_parts_on_demand");
......@@ -264,10 +265,12 @@ function resetPrefs() {
EnigSetPref("configuredVersion", EnigGetVersion());
EnigDisplayRadioPref("autoSendEncrypted", EnigGetPref("autoSendEncrypted"),
gEnigAutoSendEncrypted);
EnigDisplayRadioPref("recipientsSelection", EnigGetPref("recipientsSelection"),
gEnigRecipientsSelection);
EnigDisplayRadioPref("autoSetEncrypted", EnigGetPref("autoSetEncrypted"),
gEnigAutoSetEncrypted);
EnigDisplayRadioPref("confirmBeforeSending", EnigGetPref("confirmBeforeSending"),
gEnigconfirmBeforeSending);
}
......
......@@ -89,6 +89,7 @@
<tooltip id="confirmBeforeSend.tooltip">
<description>&enigmail.confirmBeforeSend.tooltip;</description>
</tooltip>
<tooltip id="autoSendEncryptedNever.tooltip">
<description>&enigmail.autoSendEncryptedNever.tooltip;</description>
</tooltip>
......@@ -101,6 +102,23 @@
<tooltip id="autoSendEncryptedWithUnknownTrust.tooltip">
<description>&enigmail.autoSendEncryptedWithUnknownTrust.tooltip;</description>
</tooltip>
<tooltip id="confirmBeforeSendingNever.tooltip">
<description>&enigmail.confirmBeforeSendingNever.tooltip;</description>
</tooltip>
<tooltip id="confirmBeforeSendingAlways.tooltip">
<description>&enigmail.confirmBeforeSendingAlways.tooltip;</description>
</tooltip>
<tooltip id="confirmBeforeSendingIfEncrypted.tooltip">
<description>&enigmail.confirmBeforeSendingIfEncrypted.tooltip;</description>
</tooltip>
<tooltip id="confirmBeforeSendingIfNotEncrypted.tooltip">
<description>&enigmail.confirmBeforeSendingIfNotEncrypted.tooltip;</description>
</tooltip>
<tooltip id="confirmBeforeSendingIfRules.tooltip">
<description>&enigmail.confirmBeforeSendingIfRules.tooltip;</description>
</tooltip>
<tooltip id="perRecipientRules.tooltip">
<description>&enigmail.perRecipientRules.tooltip;</description>
</tooltip>
......@@ -257,14 +275,15 @@
<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;"/>
<radiogroup id="enigmail_autoSendEncrypted"
oncommand="activateRulesButton(this, 'openRulesEditor')"
pref="true"
preftype="int"
prefstring="extensions.enigmail.autoSendEncrypted">
......@@ -289,13 +308,40 @@
label="&enigmail.autoSendEncryptedWithUnknownTrust.label;"
tooltip="autoSendEncryptedWithUnknownTrust.tooltip"/>
</radiogroup>
<separator/>
<vbox autostretch="always" align="end">
<button id="openKeysEditor"
label="open key editor" qqq="&enigmail.defineRules.label;"
tooltip="defineRules.tooltip"
oncommand="EnigKeysEditor();"/>
</vbox>
</groupbox>
<!-- options to automatically send encrypted -->
<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"/>
</radiogroup>
</groupbox>
</vbox>
......
......@@ -207,15 +207,29 @@
<!ENTITY enigmail.defaultEncryptionNone.label "No default encryption">
<!ENTITY enigmail.defaultNotSignedsend.label "Do not sign messages by default">
<!ENTITY enigmail.autoSendEncryptedOption.label "Automatically send encrypted when all keys are known and valid">
<!ENTITY enigmail.autoSendEncryptedOption.label "Automatically send encrypted">
<!ENTITY enigmail.autoSendEncryptedNever.label "Never">
<!ENTITY enigmail.autoSendEncryptedNever.tooltip "Automatically send encrypted disabled (rules might still be defined to have this effect)">
<!ENTITY enigmail.autoSendEncryptedWithFullTrust.label "When all keys have full trust">
<!ENTITY enigmail.autoSendEncryptedWithFullTrust.tooltip "Automatically send encrypted when all keys are known with full trust">
<!ENTITY enigmail.autoSendEncryptedWithMarginalTrust.label "When all keys have at least marginal trust">
<!ENTITY enigmail.autoSendEncryptedWithMarginalTrust.tooltip "Automatically send encrypted when all keys are known with at least marginal trust">
<!ENTITY enigmail.autoSendEncryptedWithUnknownTrust.label "When no key has explicit mistrust">
<!ENTITY enigmail.autoSendEncryptedWithUnknownTrust.tooltip "Automatically send encrypted when all keys are known without explicit mistrust">
<!ENTITY enigmail.autoSendEncryptedNever.tooltip "No automatically encrypted sending except explicitly triggered by rules">
<!ENTITY enigmail.autoSendEncryptedWithFullTrust.label "With full trust">
<!ENTITY enigmail.autoSendEncryptedWithFullTrust.tooltip "Automatically send encrypted when all keys are known and valid and have full trust">
<!ENTITY enigmail.autoSendEncryptedWithMarginalTrust.label "With marginal trust">
<!ENTITY enigmail.autoSendEncryptedWithMarginalTrust.tooltip "Automatically send encrypted when all keys are known and valid and have at least marginal trust">
<!ENTITY enigmail.autoSendEncryptedWithUnknownTrust.label "With unknown trust">
<!ENTITY enigmail.autoSendEncryptedWithUnknownTrust.tooltip "Automatically send encrypted when all keys are known and valid and have no explicit mistrust">
<!ENTITY enigmail.confirmBeforeSending.label "Confirm before sending">
<!ENTITY enigmail.confirmBeforeSending.tooltip "Activate to display information dialog about signing/encryption before sending a message">
<!ENTITY enigmail.confirmBeforeSendingOption.label "Confirm before sending">
<!ENTITY enigmail.confirmBeforeSendingNever.label "Never">
<!ENTITY enigmail.confirmBeforeSendingNever.tooltip "Dont't display information dialog about signing/encryption before sending a message">
<!ENTITY enigmail.confirmBeforeSendingAlways.label "Always">
<!ENTITY enigmail.confirmBeforeSendingAlways.tooltip "Always display information dialog about signing/encryption before sending a message">
<!ENTITY enigmail.confirmBeforeSendingIfEncrypted.label "If encrypted">
<!ENTITY enigmail.confirmBeforeSendingIfEncrypted.tooltip "Display information dialog about signing/encryption before sending an ENCRYPTED message">
<!ENTITY enigmail.confirmBeforeSendingIfNotEncrypted.label "If unencrypted">
<!ENTITY enigmail.confirmBeforeSendingIfNotEncrypted.tooltip "Display information dialog about signing/encryption before sending an UNENCRYPTED message">
<!ENTITY enigmail.confirmBeforeSendingIfRules.label "If rules changed encryption">
<!ENTITY enigmail.confirmBeforeSendingIfRules.tooltip "Display information dialog about signing/encryption before sending if encryption was changed by a rule or auto-encryption">
<!ENTITY enigmail.recipientsSelectionOption.label "How should we choose the keys?">
<!ENTITY enigmail.perRecipientRules.label "By pre-set rules only">
......
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