diff --git a/mail/base/content/mailWindowOverlay.js b/mail/base/content/mailWindowOverlay.js
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -70,16 +70,19 @@ const kMailLayoutCommandMap =
const kNoRemoteContentPolicy = 0;
const kBlockRemoteContent = 1;
const kAllowRemoteContent = 2;
const kMsgNotificationPhishingBar = 1;
const kMsgNotificationJunkBar = 2;
const kMsgNotificationRemoteImages = 3;
const kMsgNotificationMDN = 4;
+const kMsgNotificationSMIMEReceiptRequest = 5;
+const kMsgNotificationSMIMEReceiptVerified = 6;
+const kMsgNotificationSMIMEReceiptNotVerified = 7;
Components.utils.import("resource:///modules/MailUtils.js");
Components.utils.import("resource:///modules/MailConsts.js");
var gMessengerBundle;
var gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService)
.getBranch(null);
@@ -2539,17 +2542,20 @@ var gMessageNotificationBar =
{
mBarStatus: 0,
// flag bit values for mBarStatus, indexed by kMsgNotificationXXX
mBarFlagValues: [
0, // for no msgNotificationBar
1, // 1 << (kMsgNotificationPhishingBar - 1)
2, // 1 << (kMsgNotificationJunkBar - 1)
4, // 1 << (kMsgNotificationRemoteImages - 1)
- 8 // 1 << (kMsgNotificationMSN - 1)
+ 8, // 1 << (kMsgNotificationMDN - 1)
+ 16, // 1 << (kMsgNotificationSMIMEReceiptRequest - 1)
+ 32, // 1 << (kMsgNotificationSMIMEReceiptVerified - 1)
+ 64 // 1 << (kMsgNotificationSMIMEReceiptNotVerified - 1)
],
mMsgNotificationBar: document.getElementById('msgNotificationBar'),
setJunkMsg: function(aMsgHdr)
{
var isJunk = false;
@@ -2582,17 +2588,33 @@ var gMessageNotificationBar =
},
setMDNMsg: function(aMdnGenerator, aMsgHeader)
{
this.mdnGenerator = aMdnGenerator;
this.msgHeader = aMsgHeader;
this.updateMsgNotificationBar(kMsgNotificationMDN, true);
},
-
+
+ setSMIMEReceiptRequestMsg: function(aSMIMEReceiptGenerator, recipient)
+ {
+ document.getElementById('SMIMEReceiptRequestBarRecipient').value = "(" + recipient + ")";
+ this.SMIMEReceiptGenerator = aSMIMEReceiptGenerator;
+ this.updateMsgNotificationBar(kMsgNotificationSMIMEReceiptRequest, true);
+ },
+
+ setSMIMEReceiptMsg: function(aRequestMsgHdr)
+ {
+ this.SMIMEReceiptRequestMsgHdr = aRequestMsgHdr;
+ if (aRequestMsgHdr)
+ this.updateMsgNotificationBar(kMsgNotificationSMIMEReceiptVerified, true);
+ else
+ this.updateMsgNotificationBar(kMsgNotificationSMIMEReceiptNotVerified, true);
+ },
+
clearMsgNotifications: function()
{
this.mBarStatus = 0;
this.mMsgNotificationBar.selectedIndex = 0;
this.mMsgNotificationBar.collapsed = true;
},
updateMsgNotificationBar: function(aIndex, aSet)
@@ -2913,16 +2935,33 @@ function SendMDNResponse()
}
function IgnoreMDNResponse()
{
gMessageNotificationBar.mdnGenerator.userDeclined();
gMessageNotificationBar.updateMsgNotificationBar(kMsgNotificationMDN, false);
}
+function SendSMIMEReceipt()
+{
+ gMessageNotificationBar.SMIMEReceiptGenerator.userAgreed();
+ gMessageNotificationBar.updateMsgNotificationBar(kMsgNotificationSMIMEReceiptRequest, false);
+}
+
+function IgnoreSMIMEReceipt()
+{
+ gMessageNotificationBar.SMIMEReceiptGenerator.userDeclined();
+ gMessageNotificationBar.updateMsgNotificationBar(kMsgNotificationSMIMEReceiptRequest, false);
+}
+
+function OpenSMIMEReceiptRequestMessage()
+{
+ MailUtils.displayMessage(gMessageNotificationBar.SMIMEReceiptRequestMsgHdr, null, document.getElementById("tabmail"));
+}
+
function QuickSearchFocus()
{
var quickSearchTextBox = document.getElementById('searchInput');
if (quickSearchTextBox)
quickSearchTextBox.select();
}
/**
diff --git a/mail/base/content/mailWindowOverlay.xul b/mail/base/content/mailWindowOverlay.xul
--- a/mail/base/content/mailWindowOverlay.xul
+++ b/mail/base/content/mailWindowOverlay.xul
@@ -1888,16 +1888,39 @@
&mdnBarMessage.label;
+
+
+
+
+ &SMIMEReceiptRequestBarMessage.label;
+
+
+
+
+
+
+
+
+
+ &SMIMEReceiptVerifiedBarMessage.label;
+
+
+
+
+
+ &SMIMEReceiptNotVerifiedBarMessage.label;
+
+
diff --git a/mail/extensions/smime/content/msgCompSMIMEOverlay.js b/mail/extensions/smime/content/msgCompSMIMEOverlay.js
--- a/mail/extensions/smime/content/msgCompSMIMEOverlay.js
+++ b/mail/extensions/smime/content/msgCompSMIMEOverlay.js
@@ -96,16 +96,19 @@ function onComposerReOpen()
else
setNoEncryptionUI();
gSMFields.signMessage = gCurrentIdentity.getBoolAttribute("sign_mail");
if (gSMFields.signMessage)
setSignatureUI();
else
setNoSignatureUI();
+
+ if (gSMFields.signMessage)
+ gSMFields.SMIMEReceiptRequest = gCurrentIdentity.getBoolAttribute("smime_receipt_request");
}
addEventListener("load", smimeComposeOnLoad, false);
// this function gets called multiple times,
// but only on first open, not on composer recycling
function smimeComposeOnLoad()
{
@@ -205,35 +208,66 @@ function toggleSignMessage()
{
if (!gCurrentIdentity.getUnicharAttribute("signing_cert_name"))
{
gSMFields.signMessage = false;
showNeedSetupInfo();
return;
}
+ gSMFields.SMIMEReceiptRequest = gCurrentIdentity.getBoolAttribute("smime_receipt_request");
+
setSignatureUI();
}
else
{
+ gSMFields.SMIMEReceiptRequest = false;
+
setNoSignatureUI();
}
gSignOptionChanged = true;
}
+function toggleSMIMEReceiptRequest()
+{
+ if (!gSMFields)
+ return;
+
+ gSMFields.SMIMEReceiptRequest = !gSMFields.SMIMEReceiptRequest;
+
+ if (gSMFields.SMIMEReceiptRequest)
+ {
+ var signingCertName = gCurrentIdentity.getUnicharAttribute("signing_cert_name");
+
+ if (!signingCertName)
+ {
+ gSMFields.SMIMEReceiptRequest = false;
+ showNeedSetupInfo();
+ return;
+ }
+
+ // Force signing
+ gSMFields.signMessage = true;
+
+ setSignatureUI();
+ }
+}
+
function setSecuritySettings(menu_id)
{
if (!gSMFields)
return;
document.getElementById("menu_securityEncryptRequire" + menu_id)
.setAttribute("checked", gSMFields.requireEncryptMessage);
document.getElementById("menu_securitySign" + menu_id)
.setAttribute("checked", gSMFields.signMessage);
+ document.getElementById("menu_securitySMIMEReceiptRequest" + menu_id)
+ .setAttribute("checked", gSMFields.SMIMEReceiptRequest);
}
function setNextCommand(what)
{
gNextSecurityButtonCommand = what;
}
function doSecurityButton()
@@ -246,16 +280,20 @@ function doSecurityButton()
case "encryptMessage":
toggleEncryptMessage();
break;
case "signMessage":
toggleSignMessage();
break;
+ case "SMIMEReceiptRequest":
+ toggleSMIMEReceiptRequest();
+ break;
+
case "show":
default:
showMessageComposeSecurityStatus();
}
}
function setNoSignatureUI()
{
@@ -433,12 +471,18 @@ function onComposerFromChanged()
{
// Make sure we have a cert for signing.
var signingCertName = gCurrentIdentity.getUnicharAttribute("signing_cert_name");
useSigning = signingCertName;
}
}
gSMFields.signMessage = useSigning;
if (useSigning)
+ {
+ gSMFields.SMIMEReceiptRequest = gCurrentIdentity.getBoolAttribute("smime_receipt_request");
setSignatureUI();
+ }
else
+ {
+ gSMFields.SMIMEReceiptRequest = false;
setNoSignatureUI();
+ }
}
diff --git a/mail/extensions/smime/content/msgCompSMIMEOverlay.xul b/mail/extensions/smime/content/msgCompSMIMEOverlay.xul
--- a/mail/extensions/smime/content/msgCompSMIMEOverlay.xul
+++ b/mail/extensions/smime/content/msgCompSMIMEOverlay.xul
@@ -65,16 +65,21 @@
label="&menu_securityEncryptRequire.label;"
accesskey="&menu_securityEncryptRequire.accesskey;"
oncommand="toggleEncryptMessage();"/>
+
+
diff --git a/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js b/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js
--- a/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js
+++ b/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js
@@ -16,16 +16,17 @@
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Scott MacGregor
+# ESS Signed Receipts: Raphael Fairise / BT Global Services / Etat francais - Ministere de la Defense
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
@@ -145,24 +146,216 @@ var smimeHeaderSink =
"\n"+
title+"
\n"+
body+"\n"+
"