add support for DSN return receipts, patch by eballetbaz@gmail.com, r=bienvenu, sr=mscott

This commit is contained in:
bienvenu%nventure.com 2007-09-18 22:37:04 +00:00
Родитель bcbe9149c3
Коммит 9112b1ff49
20 изменённых файлов: 205 добавлений и 49 удалений

Просмотреть файл

@ -22,6 +22,7 @@
#
# Contributor(s):
# David Bienvenu <bienvenu@nventure.com>
# Olivier Parniere 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
@ -117,6 +118,7 @@ var gCharsetConvertManager;
var gLastWindowToHaveFocus;
var gReceiptOptionChanged;
var gDSNOptionChanged;
var gAttachVCardOptionChanged;
var gMailSession;
@ -161,6 +163,7 @@ function InitializeGlobalVariables()
gLastWindowToHaveFocus = null;
gReceiptOptionChanged = false;
gDSNOptionChanged = false;
gAttachVCardOptionChanged = false;
}
InitializeGlobalVariables();
@ -1306,6 +1309,7 @@ function ComposeStartup(recycled, aParams)
document.getElementById("returnReceiptMenu").setAttribute('checked',
gMsgCompose.compFields.returnReceipt);
document.getElementById("dsnMenu").setAttribute('checked', gMsgCompose.compFields.DSN);
document.getElementById("cmd_attachVCard").setAttribute('checked',
gMsgCompose.compFields.attachVCard);
document.getElementById("menu_inlineSpellCheck").setAttribute('checked', sPrefs.getBoolPref("mail.spellcheck.inline"));
@ -2293,6 +2297,17 @@ function ToggleReturnReceipt(target)
}
}
function ToggleDSN(target)
{
var msgCompFields = gMsgCompose.compFields;
if (msgCompFields)
{
msgCompFields.DSN = ! msgCompFields.DSN;
target.setAttribute('checked', msgCompFields.DSN);
gDSNOptionChanged = true;
}
}
function ToggleAttachVCard(target)
{
var msgCompFields = gMsgCompose.compFields;
@ -3015,6 +3030,7 @@ function LoadIdentity(startup)
var prevReplyTo = prevIdentity.replyTo;
var prevBcc = "";
var prevReceipt = prevIdentity.requestReturnReceipt;
var prevDSN = prevIdentity.DSN;
var prevAttachVCard = prevIdentity.attachVCard;
if (prevIdentity.doBcc)
@ -3023,6 +3039,7 @@ function LoadIdentity(startup)
var newReplyTo = gCurrentIdentity.replyTo;
var newBcc = "";
var newReceipt = gCurrentIdentity.requestReturnReceipt;
var newDSN = gCurrentIdentity.DSN;
var newAttachVCard = gCurrentIdentity.attachVCard;
if (gCurrentIdentity.doBcc)
@ -3039,6 +3056,14 @@ function LoadIdentity(startup)
document.getElementById("returnReceiptMenu").setAttribute('checked',msgCompFields.returnReceipt);
}
if (!gDSNOptionChanged &&
prevDSN == msgCompFields.DSN &&
prevDSN != newDSN)
{
msgCompFields.DSN = newDSN;
document.getElementById("dsnMenu").setAttribute('checked',msgCompFields.DSN);
}
if (!gAttachVCardOptionChanged &&
prevAttachVCard == msgCompFields.attachVCard &&
prevAttachVCard != newAttachVCard)

Просмотреть файл

@ -24,6 +24,7 @@
# Ben Goodger <ben@netscape.com> (ass'td polish fixes)
# Hkan Waara <hwaara@chello.se>
# Neil Rashbrook <neil@parkwaycc.co.uk> (ass'td polish fix)
# Olivier Parniere 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
@ -430,6 +431,7 @@
<menuitem label="&quoteCmd.label;" accesskey="&quoteCmd.accesskey;" command="cmd_quoteMessage"/>
<menuseparator/>
<menuitem id="returnReceiptMenu" type="checkbox" label="&returnReceiptMenu.label;" accesskey="&returnReceiptMenu.accesskey;" checked="false" oncommand="ToggleReturnReceipt(event.target)"/>
<menuitem id="dsnMenu" type="checkbox" label="&dsnMenu.label;" accesskey="&dsnMenu.accesskey;" oncommand="ToggleDSN(event.target)"/>
<menuseparator/>
<menu id="maileditCharsetMenu" label="&charsetMenu.label;" accesskey="&charsetMenu.accesskey;" datasources="rdf:charset-menu" ref="NC:MaileditCharsetMenuRoot" oncommand="SetDocumentCharacterSet(event.target.getAttribute('id'));" onpopupshowing="CreateMenu('mailedit');InitCharsetMenuCheckMark();" onpopupshown="CreateMenu('more-menu');">
<template>

Просмотреть файл

@ -130,6 +130,8 @@
<!ENTITY returnReceiptMenu.label "Return Receipt">
<!ENTITY returnReceiptMenu.accesskey "t">
<!ENTITY dsnMenu.label "Delivery Status Notification">
<!ENTITY dsnMenu.accesskey "N">
<!ENTITY outputFormatMenu.label "Format">
<!ENTITY outputFormatMenu.accesskey "f">
<!ENTITY autoFormatCmd.label "Auto-Detect">

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Eric Ballet Baz BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -48,7 +49,7 @@
*/
[scriptable, uuid(21959CED-8C60-4e22-8D90-4FB100AF4189)]
[scriptable, uuid(3038bec6-2a5f-4eba-977d-4e037ae5aba3)]
interface nsIMsgIdentity : nsISupports {
/* internal preferences ID */
attribute ACString key;
@ -151,6 +152,13 @@ interface nsIMsgIdentity : nsISupports {
readonly attribute boolean requestReturnReceipt;
readonly attribute long receiptHeaderType;
/**
* default request for DSN option for this identity
* if this is set, the DSN menu item on the compose
* window will be checked
*/
readonly attribute boolean requestDSN;
/* copy the attributes of the identity we pass in */
void copy(in nsIMsgIdentity identity);

Просмотреть файл

@ -22,6 +22,7 @@
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
* Seth Spitzer <sspitzer@netscape.com>
* Eric Ballet Baz BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -550,3 +551,19 @@ nsMsgIdentity::GetReceiptHeaderType(PRInt32 *aType)
NS_ENSURE_SUCCESS(rv, rv);
return prefs->GetIntPref("mail.receipt.request_header_type", aType);
}
NS_IMETHODIMP
nsMsgIdentity::GetRequestDSN(PRBool *aVal)
{
NS_ENSURE_ARG_POINTER(aVal);
PRBool useCustomPrefs = PR_FALSE;
nsresult rv = GetBoolAttribute("dsn_use_custom_prefs", &useCustomPrefs);
NS_ENSURE_SUCCESS(rv, rv);
if (useCustomPrefs)
return GetBoolAttribute("dsn_always_request_on", aVal);
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
return prefs->GetBoolPref("mail.dsn.always_request_on", aVal);
}

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Olivier Parniere BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -40,7 +41,7 @@
#include "nsIMsgAttachment.idl"
#include "nsISupportsArray.idl"
[scriptable, uuid(f5a85828-e9ef-4821-a045-6dc7a09351d6)]
[scriptable, uuid(afe5fedc-7ef9-44dd-8f19-b59286357675)]
interface nsIMsgCompFields : nsISupports {
attribute AString from;
@ -78,6 +79,7 @@ interface nsIMsgCompFields : nsISupports {
attribute boolean returnReceipt;
attribute long receiptHeaderType;
attribute boolean DSN;
attribute boolean attachVCard;
attribute boolean forcePlainText;
attribute boolean useMultipartAlternative;

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Olivier Parniere BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -47,7 +48,7 @@ interface nsIFile;
interface nsIMsgStatusFeedback;
interface nsIRequest;
[scriptable, uuid(b9e6e1ea-8f9a-42d4-a426-084d71694c36)]
[scriptable, uuid(2B7FA4A1-A73E-4B7A-A789-7D0CFBE5AC97)]
interface nsISmtpService : nsISupports {
///////////////////////////////////////////////////////////////////////////
@ -76,6 +77,7 @@ interface nsISmtpService : nsISupports {
in nsIUrlListener aUrlListener,
in nsIMsgStatusFeedback aStatusListener,
in nsIInterfaceRequestor aNotificationCallbacks,
in boolean requestDSN,
out nsIURI aURL,
out nsIRequest aRequest);

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Eric Ballet Baz BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -45,7 +46,7 @@ interface nsISmtpServer;
interface nsIInterfaceRequestor;
interface nsIFile;
[scriptable, uuid(6973003a-bb42-4348-bbde-9c2b842de797)]
[scriptable, uuid(0777575b-1460-4629-ba3b-e3cd4b29685b)]
interface nsISmtpUrl : nsISupports {
///////////////////////////////////////////////////////////////////////////////
// SMTP Parse specific getters --> retrieves portions from the url spec...
@ -61,6 +62,8 @@ interface nsISmtpUrl : nsISupports {
// the file name to post...
attribute nsIFile postMessageFile;
attribute boolean requestDSN;
///////////////////////////////////////////////////////////////////////////////
// SMTP Url instance specific getters and setters --> info the protocol needs
// to know in order to run the url...these are NOT event sinks which are things

Просмотреть файл

@ -21,6 +21,7 @@
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
* Olivier Parniere BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -66,6 +67,7 @@ nsMsgCompFields::nsMsgCompFields()
m_uuEncodeAttachments = PR_FALSE;
m_returnReceipt = PR_FALSE;
m_receiptHeaderType = nsIMsgMdnGenerator::eDntType;
m_DSN = PR_FALSE;
m_bodyIsAsciiOnly = PR_FALSE;
m_forceMsgEncoding = PR_FALSE;
m_needToCheckCharset = PR_TRUE;
@ -391,6 +393,19 @@ NS_IMETHODIMP nsMsgCompFields::GetReceiptHeaderType(PRInt32 *_retval)
return NS_OK;
}
NS_IMETHODIMP nsMsgCompFields::SetDSN(PRBool value)
{
m_DSN = value;
return NS_OK;
}
NS_IMETHODIMP nsMsgCompFields::GetDSN(PRBool *_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
*_retval = m_DSN;
return NS_OK;
}
NS_IMETHODIMP nsMsgCompFields::SetAttachVCard(PRBool value)
{
m_attachVCard = value;

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Olivier Parniere BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -157,6 +158,7 @@ public:
const char* GetDraftId() {return GetAsciiHeader(MSG_DRAFT_ID_HEADER_ID);}
PRBool GetReturnReceipt() {return m_returnReceipt;}
PRBool GetDSN() {return m_DSN;}
PRBool GetAttachVCard() {return m_attachVCard;}
PRBool GetForcePlainText() {return m_forcePlainText;}
PRBool GetUseMultipartAlternative() {return m_useMultipartAlternative;}
@ -178,6 +180,7 @@ protected:
PRBool m_useMultipartAlternative;
PRBool m_uuEncodeAttachments;
PRBool m_returnReceipt;
PRBool m_DSN;
PRBool m_bodyIsAsciiOnly;
PRBool m_forceMsgEncoding;
PRInt32 m_receiptHeaderType; /* receipt header type */

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Eric Ballet Baz BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -468,6 +469,11 @@ mime_generate_headers (nsMsgCompFields *fields,
else
PUSH_STRING("receipt=0");
PUSH_STRING("; ");
if (fields->GetDSN())
PUSH_STRING("DSN=1");
else
PUSH_STRING("DSN=0");
PUSH_STRING("; ");
if (fields->GetUuEncodeAttachments())
PUSH_STRING("uuencode=1");
else

Просмотреть файл

@ -25,6 +25,7 @@
* Håkan Waara <hwaara@chello.se>
* Pierre Phaneuf <pp@ludusdesign.com>
* Masayuki Nakano <masayuki@d-toybox.com>
* Olivier Parniere BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -826,6 +827,12 @@ nsMsgCompose::Initialize(nsIDOMWindowInternal *aWindow, nsIMsgComposeParams *par
rv = composeFields->SetReceiptHeaderType(receiptType);
NS_ENSURE_SUCCESS(rv, rv);
PRBool requestDSN = PR_FALSE;
rv = m_identity->GetRequestDSN(&requestDSN);
NS_ENSURE_SUCCESS(rv, rv);
rv = composeFields->SetDSN(requestDSN);
NS_ENSURE_SUCCESS(rv, rv);
PRBool attachVCard;
rv = m_identity->GetAttachVCard(&attachVCard);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -22,6 +22,7 @@
* Contributor(s):
* Jean-Francois Ducarroz <ducarroz@netscape.com>
* Pierre Phaneuf <pp@ludusdesign.com>
* Olivier Parniere BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -3132,6 +3133,8 @@ nsMsgComposeAndSend::InitCompositionFields(nsMsgCompFields *fields,
mCompFields->SetReturnReceipt(fields->GetReturnReceipt());
mCompFields->SetReceiptHeaderType(receiptType);
mCompFields->SetDSN(fields->GetDSN());
mCompFields->SetUuEncodeAttachments(fields->GetUuEncodeAttachments());
mCompFields->SetBodyIsAsciiOnly(fields->GetBodyIsAsciiOnly());
@ -3674,7 +3677,7 @@ nsMsgComposeAndSend::DeliverFileAsMail()
rv = smtpService->SendMailMessage(mTempFile, buf, mUserIdentity,
mSmtpPassword.get(), deliveryListener, msgStatus,
callbacks, nsnull, getter_AddRefs(mRunningRequest));
callbacks, mCompFields->GetDSN(), nsnull, getter_AddRefs(mRunningRequest));
}
PR_FREEIF(buf); // free the buf because we are done with it....

Просмотреть файл

@ -21,6 +21,8 @@
*
* Contributor(s):
* Christian Eyrich <ch.ey@gmx.net>
* Olivier Parniere BT Global Services / Etat francais Ministere de la Defense
* Eric Ballet Baz BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -76,6 +78,7 @@
#include "nsISSLSocketControl.h"
#include "nsComposeStrings.h"
#include "nsIStringBundle.h"
#include "nsMsgCompUtils.h"
#ifndef XP_UNIX
@ -622,44 +625,45 @@ PRInt32 nsSmtpProtocol::SendHeloResponse(nsIInputStream * inputStream, PRUint32
// when that's the out parameter
parser->MakeFullAddress(nsnull, nsnull /* name */, emailAddress.get() /* address */, &fullAddress);
}
#ifdef UNREADY_CODE
if (CE_URL_S->msg_pane)
buffer = "MAIL FROM:<";
buffer += fullAddress;
buffer += ">";
if (TestFlag(SMTP_EHLO_DSN_ENABLED))
{
if (MSG_RequestForReturnReceipt(CE_URL_S->msg_pane))
PRBool requestDSN = PR_FALSE;
rv = m_runningURL->GetRequestDSN(&requestDSN);
if (requestDSN)
{
if (TestFlag(SMTP_EHLO_DSN_ENABLED))
{
PR_snprintf(buffer, sizeof(buffer),
"MAIL FROM:<%.256s> RET=FULL ENVID=NS40112696JT" CRLF, fullAddress);
}
else
{
FE_Alert (CE_WINDOW_ID, XP_GetString(XP_RETURN_RECEIPT_NOT_SUPPORT));
PR_snprintf(buffer, sizeof(buffer), "MAIL FROM:<%.256s>" CRLF, fullAddress);
}
}
else if (MSG_SendingMDNInProgress(CE_URL_S->msg_pane))
{
PR_snprintf(buffer, sizeof(buffer), "MAIL FROM:<%.256s>" CRLF, "");
}
else
{
PR_snprintf(buffer, sizeof(buffer), "MAIL FROM:<%.256s>" CRLF, fullAddress);
nsCOMPtr <nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
nsCOMPtr<nsIPrefBranch> prefBranch;
rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
NS_ENSURE_SUCCESS(rv,rv);
PRBool requestRetFull = PR_FALSE;
rv = prefBranch->GetBoolPref("mail.dsn.ret_full_on", &requestRetFull);
buffer += requestRetFull ? " RET=FULL" : " RET=HDRS";
char* msgID = msg_generate_message_id(senderIdentity);
buffer += " ENVID=";
buffer += msgID;
PR_Free(msgID);
}
}
else
#endif
if(TestFlag(SMTP_EHLO_SIZE_ENABLED))
{
buffer = "MAIL FROM:<";
buffer += fullAddress;
buffer += ">";
if(TestFlag(SMTP_EHLO_SIZE_ENABLED))
{
buffer.Append(" SIZE=");
buffer.AppendInt(m_totalMessageSize);
}
buffer += CRLF;
buffer.Append(" SIZE=");
buffer.AppendInt(m_totalMessageSize);
}
buffer += CRLF;
PR_Free (fullAddress);
}
@ -1354,21 +1358,55 @@ PRInt32 nsSmtpProtocol::SendMailResponse()
}
/* Send the RCPT TO: command */
#ifdef UNREADY_CODE
if (TestFlag(SMTP_EHLO_DSN_ENABLED) &&
(CE_URL_S->msg_pane &&
MSG_RequestForReturnReceipt(CE_URL_S->msg_pane)))
#else
if (TestFlag(SMTP_EHLO_DSN_ENABLED) && PR_FALSE)
#endif
PRBool requestDSN = PR_FALSE;
rv = m_runningURL->GetRequestDSN(&requestDSN);
nsCOMPtr <nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
nsCOMPtr<nsIPrefBranch> prefBranch;
rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
NS_ENSURE_SUCCESS(rv,rv);
PRBool requestOnSuccess = PR_FALSE;
rv = prefBranch->GetBoolPref("mail.dsn.request_on_success_on", &requestOnSuccess);
PRBool requestOnFailure = PR_FALSE;
rv = prefBranch->GetBoolPref("mail.dsn.request_on_failure_on", &requestOnFailure);
PRBool requestOnDelay = PR_FALSE;
rv = prefBranch->GetBoolPref("mail.dsn.request_on_delay_on", &requestOnDelay);
PRBool requestOnNever = PR_FALSE;
rv = prefBranch->GetBoolPref("mail.dsn.request_never_on", &requestOnNever);
if (TestFlag(SMTP_EHLO_DSN_ENABLED) && requestDSN && (requestOnSuccess || requestOnFailure || requestOnDelay || requestOnNever))
{
char *encodedAddress = esmtp_value_encode(m_addresses);
nsCAutoString dsnBuffer;
if (encodedAddress)
{
buffer = "RCPT TO:<";
buffer += m_addresses;
buffer += "> NOTIFY=SUCCESS,FAILURE ORCPT=rfc822;";
buffer += "> NOTIFY=";
if (requestOnNever)
dsnBuffer += "NEVER";
else
{
if (requestOnSuccess)
dsnBuffer += "SUCCESS";
if (requestOnFailure)
dsnBuffer += dsnBuffer.IsEmpty() ? "FAILURE" : ",FAILURE";
if (requestOnDelay)
dsnBuffer += dsnBuffer.IsEmpty() ? "DELAY" : ",DELAY";
}
buffer += dsnBuffer;
buffer += " ORCPT=rfc822;";
buffer += encodedAddress;
buffer += CRLF;
PR_FREEIF(encodedAddress);

Просмотреть файл

@ -21,6 +21,7 @@
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
* Olivier Parniere BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -95,7 +96,8 @@ NS_MsgBuildSmtpUrl(nsIFile * aFilePath,
nsIUrlListener * aUrlListener,
nsIMsgStatusFeedback *aStatusFeedback,
nsIInterfaceRequestor* aNotificationCallbacks,
nsIURI ** aUrl);
nsIURI ** aUrl,
PRBool aRequestDSN);
nsresult NS_MsgLoadSmtpUrl(nsIURI * aUrl, nsISupports * aConsumer, nsIRequest ** aRequest);
@ -121,6 +123,7 @@ nsresult nsSmtpService::SendMailMessage(nsIFile * aFilePath,
nsIUrlListener * aUrlListener,
nsIMsgStatusFeedback *aStatusFeedback,
nsIInterfaceRequestor* aNotificationCallbacks,
PRBool aRequestDSN,
nsIURI ** aURL,
nsIRequest ** aRequest)
{
@ -157,7 +160,7 @@ nsresult nsSmtpService::SendMailMessage(nsIFile * aFilePath,
{
rv = NS_MsgBuildSmtpUrl(aFilePath, smtpHostName.get(), smtpPort, smtpUserName.get(),
aRecipients, aSenderIdentity, aUrlListener, aStatusFeedback,
aNotificationCallbacks, &urlToRun); // this ref counts urlToRun
aNotificationCallbacks, &urlToRun, aRequestDSN); // this ref counts urlToRun
if (NS_SUCCEEDED(rv) && urlToRun)
{
nsCOMPtr<nsISmtpUrl> smtpUrl = do_QueryInterface(urlToRun, &rv);
@ -191,7 +194,8 @@ nsresult NS_MsgBuildSmtpUrl(nsIFile * aFilePath,
nsIUrlListener * aUrlListener,
nsIMsgStatusFeedback *aStatusFeedback,
nsIInterfaceRequestor* aNotificationCallbacks,
nsIURI ** aUrl)
nsIURI ** aUrl,
PRBool aRequestDSN)
{
// mscott: this function is a convience hack until netlib actually dispatches smtp urls.
// in addition until we have a session to get a password, host and other stuff from, we need to use default values....
@ -223,6 +227,7 @@ nsresult NS_MsgBuildSmtpUrl(nsIFile * aFilePath,
nsCOMPtr<nsIMsgMailNewsUrl> url = do_QueryInterface(smtpUrl);
url->SetSpec(urlSpec);
smtpUrl->SetRecipients(aRecipients);
smtpUrl->SetRequestDSN(aRequestDSN);
smtpUrl->SetPostMessageFile(aFilePath);
smtpUrl->SetSenderIdentity(aSenderIdentity);
smtpUrl->SetNotificationCallbacks(aNotificationCallbacks);

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Eric Ballet Baz BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -535,6 +536,7 @@ nsSmtpUrl::nsSmtpUrl() : nsMsgMailNewsUrl()
// nsISmtpUrl specific state...
m_isPostMessage = PR_TRUE;
m_requestDSN = PR_FALSE;
}
nsSmtpUrl::~nsSmtpUrl()
@ -613,6 +615,8 @@ NS_IMETHODIMP nsSmtpUrl::GetPostMessageFile(nsIFile ** aFile)
return NS_OK;
}
NS_IMPL_GETSET(nsSmtpUrl, RequestDSN, PRBool, m_requestDSN)
NS_IMETHODIMP
nsSmtpUrl::GetSenderIdentity(nsIMsgIdentity * *aSenderIdentity)
{

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Eric Ballet Baz BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -110,6 +111,7 @@ protected:
nsCString m_toPart;
PRBool m_isPostMessage;
PRBool m_requestDSN;
/* Smtp specific event sinks */
nsCString m_userName;

Просмотреть файл

@ -896,7 +896,7 @@ nsresult nsMsgMdnGenerator::SendMdnMsg()
nsCOMPtr<nsIRequest> aRequest;
smtpService->SendMailMessage(m_file, m_dntRrt.get(), m_identity,
nsnull, this, nsnull, nsnull, nsnull,
nsnull, this, nsnull, nsnull, PR_FALSE, nsnull,
getter_AddRefs(aRequest));
return NS_OK;

Просмотреть файл

@ -21,6 +21,7 @@
*
* Contributor(s):
* Dan Mosedale <dan.mosedale@oracle.com>
* Olivier Parniere BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -239,6 +240,13 @@ pref("mail.receipt.request_header_type", 0); // 0: MDN-DNT header 1:
pref("mail.receipt.request_return_receipt_on", false);
pref("mail.mdn.report.enabled", true); // false: Never send true: Send sometimes
pref("mail.dsn.always_request_on", false);
pref("mail.dsn.request_on_success_on", true); // DSN request is sent with SUCCESS option
pref("mail.dsn.request_on_failure_on", true); // DSN request is sent with FAILURE option
pref("mail.dsn.request_on_delay_on", true); // DSN request is sent with DELAY option
pref("mail.dsn.request_never_on", false); // DSN request is not sent with NEVER option
pref("mail.dsn.ret_full_on", true); // DSN request is sent with RET FULL option
pref("mail.showPreviewText", false);
pref("news.default_cc", "");

Просмотреть файл

@ -21,6 +21,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Eric Ballet Baz BT Global Services / Etat francais Ministere de la Defense
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -1378,6 +1379,9 @@ mime_parse_stream_complete (nsMIMESession *stream)
fields->SetReceiptHeaderType(((PRInt32)receiptType) - 1);
}
PR_FREEIF(parm);
parm = MimeHeaders_get_parameter(draftInfo, "DSN", NULL, NULL);
fields->SetDSN(parm && !strcmp(parm, "1"));
PR_Free(parm);
parm = MimeHeaders_get_parameter(draftInfo, "uuencode", NULL, NULL);
fields->SetUuEncodeAttachments(parm && !strcmp(parm, "1"));
PR_FREEIF(parm);