Bug 521158 - Implement menu option for "Remind me later" to add attachment(s) before sending (allow activating and checking the status of Attachment Reminder independent of the attachment specific keywords and the number of attachments). r=mkmelin, ui-r=bwinton
authorSuyash Agarwal <syshagarwal@gmail.com>
Tue, 12 Nov 2013 10:00:10 -0500
changeset 16885 42d26678e7e69f539793b49ae5c98fe7c3c36375
parent 16884 f7c79b0b1901e40f0bebed92eb89864942eb1393
child 16886 0ae2fe7ca0a1774c6e964db4bebc124cedeaf044
push id1074
push userbugzilla@standard8.plus.com
push dateMon, 03 Feb 2014 22:47:23 +0000
treeherdercomm-beta@6b791b5369ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, bwinton
bugs521158
Bug 521158 - Implement menu option for "Remind me later" to add attachment(s) before sending (allow activating and checking the status of Attachment Reminder independent of the attachment specific keywords and the number of attachments). r=mkmelin, ui-r=bwinton
mail/components/compose/content/MsgComposeCommands.js
mail/components/compose/content/messengercompose.xul
mail/locales/en-US/chrome/messenger/messengercompose/composeMsgs.properties
mail/locales/en-US/chrome/messenger/messengercompose/messengercompose.dtd
mailnews/compose/public/nsIMsgCompFields.idl
mailnews/compose/src/nsMsgCompFields.cpp
mailnews/compose/src/nsMsgCompFields.h
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/mime/src/mimedrft.cpp
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -64,17 +64,17 @@ var gCloseWindowAfterSave;
 var gSavedSendNowKey;
 var gSendFormat;
 
 var gMsgIdentityElement;
 var gMsgAddressingWidgetTreeElement;
 var gMsgSubjectElement;
 var gMsgAttachmentElement;
 var gMsgHeadersToolbarElement;
-var gRemindLater;
+var gManualAttachmentReminder;
 var gComposeType;
 
 // i18n globals
 var gSendDefaultCharset;
 var gCharsetTitle;
 var gCharsetConvertManager;
 var _gComposeBundle;
 function getComposeBundle() {
@@ -118,17 +118,17 @@ function InitializeGlobalVariables()
   gAutoSaving = false;
   gCloseWindowAfterSave = false;
   gSavedSendNowKey = null;
   gSendFormat = nsIMsgCompSendFormat.AskUser;
   gSendDefaultCharset = null;
   gCharsetTitle = null;
   gCharsetConvertManager = Components.classes['@mozilla.org/charset-converter-manager;1'].getService(Components.interfaces.nsICharsetConverterManager);
   gHideMenus = false;
-  gRemindLater = false;
+  gManualAttachmentReminder = false;
 
   gLastWindowToHaveFocus = null;
   gReceiptOptionChanged = false;
   gDSNOptionChanged = false;
   gAttachVCardOptionChanged = false;
   gAttachmentsSize = 0;
   gNumUploadingAttachments = 0;
   msgWindow = Components.classes["@mozilla.org/messenger/msgwindow;1"]
@@ -1830,30 +1830,30 @@ attachmentWorker.onmessage = function(ev
   else {
     removeNotification = true;
     this.lastMessage = null;
   }
   if (notification && removeNotification)
     nBox.removeNotification(notification);
   if (msg) {
     var addButton = {
-      accessKey : getComposeBundle().getString("addAttachmentButton.accessskey"),
+      accessKey : getComposeBundle().getString("addAttachmentButton.accesskey"),
       label: getComposeBundle().getString("addAttachmentButton"),
       callback: function (aNotificationBar, aButton)
       {
         goDoCommand("cmd_attachFile");
       }
     };
 
     var remindButton = {
-      accessKey : getComposeBundle().getString("remindLaterButton.accessskey"),
+      accessKey : getComposeBundle().getString("remindLaterButton.accesskey"),
       label: getComposeBundle().getString("remindLaterButton"),
       callback: function (aNotificationBar, aButton)
       {
-        gRemindLater = true;
+        toggleAttachmentReminder(true);
       }
     };
 
     notification = nBox.appendNotification("", "attachmentReminder",
                                  /* fake out the image so we can do it in CSS */
                                  "null",
                                  nBox.PRIORITY_WARNING_MEDIUM,
                                  [addButton, remindButton]);
@@ -1928,17 +1928,17 @@ function ShouldShowAttachmentNotificatio
 }
 
 /**
  * Check for attachment keywords, and display a notification if it's
  * appropriate.
  */
 function CheckForAttachmentNotification(event)
 {
-  if (!CheckForAttachmentNotification.shouldFire || gRemindLater)
+  if (!CheckForAttachmentNotification.shouldFire || gManualAttachmentReminder)
     return;
   if (!event)
     attachmentWorker.lastMessage = null;
   CheckForAttachmentNotification.shouldFire = false;
   let nBox = document.getElementById("attachmentNotificationBox");
   let notification = nBox.getNotificationWithValue("1");
   let removeNotification = false;
 
@@ -2101,16 +2101,17 @@ function ComposeStartup(recycled, aParam
   gMsgCompose.recycledWindow = recycled;
 
   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);
+  toggleAttachmentReminder(gMsgCompose.compFields.attachmentReminder);
 
   // If recycle, editor is already created.
   if (!recycled)
   {
     let editortype = gMsgCompose.composeHTML ? "htmlmail" : "textmail";
     editorElement.makeEditable(editortype, true);
 
     // setEditorType MUST be called before setContentWindow
@@ -2452,16 +2453,19 @@ function DoSpellCheckBeforeSend()
 function GenericSendMessage(msgType)
 {
   var msgCompFields = gMsgCompose.compFields;
 
   Recipients2CompFields(msgCompFields);
   var subject = GetMsgSubjectElement().value;
   msgCompFields.subject = subject;
   Attachments2CompFields(msgCompFields);
+  // Some other msgCompFields have already been updated instantly in their respective
+  // toggle functions, e.g. ToggleReturnReceipt(), ToggleDSN(),  ToggleAttachVCard(),
+  // and toggleAttachmentReminder().
 
   let sending = msgType == nsIMsgCompDeliverMode.Now ||
       msgType == nsIMsgCompDeliverMode.Later ||
       msgType == nsIMsgCompDeliverMode.Background;
   if (sending)
   {
     expandRecipients();
     // Check if e-mail addresses are complete, in case user turned off
@@ -2507,32 +2511,38 @@ function GenericSendMessage(msgType)
             getComposeBundle().getString("cancelSendingButton"),
             null, null, {value:0}) == 1)
       {
         GetMsgSubjectElement().focus();
         return;
       }
     }
 
-    // Alert the user if
-    //  - the button to remind about attachments was clicked, or
-    //  - the aggressive pref is set and the notification was not dismissed
-    // and the message (still) contains attachment keywords.
-    if ((gRemindLater || (getPref("mail.compose.attachment_reminder_aggressive") &&
-          document.getElementById("attachmentNotificationBox").currentNotification)) &&
-        ShouldShowAttachmentNotification(false)) {
+    // Attachment Reminder: Alert the user if
+    //  - the user requested "Remind me later" from either the notification bar or the menu
+    //    (alert regardless of the number of files already attached: we can't guess for how many
+    //    or which files users want the reminder, and guessing wrong will annoy them a lot), OR
+    //  - the aggressive pref is set and the latest notification is still showing (implying
+    //    that the message has no attachment(s) yet, message still contains some attachment
+    //    keywords, and notification was not dismissed).
+    if (gManualAttachmentReminder || (getPref("mail.compose.attachment_reminder_aggressive") &&
+         document.getElementById("attachmentNotificationBox").currentNotification)) {
       let flags = Services.prompt.BUTTON_POS_0 * Services.prompt.BUTTON_TITLE_IS_STRING +
                   Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_IS_STRING;
       let hadForgotten = Services.prompt.confirmEx(window,
                             getComposeBundle().getString("attachmentReminderTitle"),
                             getComposeBundle().getString("attachmentReminderMsg"),
                             flags,
                             getComposeBundle().getString("attachmentReminderFalseAlarm"),
                             getComposeBundle().getString("attachmentReminderYesIForgot"),
                             null, null, {value:0});
+      // Deactivate manual attachment reminder after showing the alert to avoid alert loop.
+      // We also deactivate reminder when user ignores alert with [x] or [ESC].
+      toggleAttachmentReminder(false);
+
       if (hadForgotten)
         return;
     }
 
     // Check if the user tries to send a message to a newsgroup through a mail
     // account.
     var currentAccountKey = getCurrentAccountKey();
     let account = MailServices.accounts.getAccount(currentAccountKey);
@@ -3127,16 +3137,34 @@ function ToggleAttachVCard(target)
   if (msgCompFields)
   {
     msgCompFields.attachVCard = ! msgCompFields.attachVCard;
     target.setAttribute('checked', msgCompFields.attachVCard);
     gAttachVCardOptionChanged = true;
   }
 }
 
+/**
+ * Toggles or sets the status of manual Attachment Reminder, i.e. whether
+ * the user will get the "Attachment Reminder" alert before sending or not.
+ * Toggles checkmark on "Remind me later" menuitem and internal
+ * gManualAttachmentReminder flag accordingly.
+ *
+ * @param aState (optional) true = activate reminder.
+ *                          false = deactivate reminder.
+ *                          (default) = toggle reminder state.
+ */
+function toggleAttachmentReminder(aState = !gManualAttachmentReminder)
+{
+  gManualAttachmentReminder = aState;
+  document.getElementById("cmd_remindLater")
+          .setAttribute("checked", aState);
+  gMsgCompose.compFields.attachmentReminder = aState;
+}
+
 function ClearIdentityListPopup(popup)
 {
   if (popup)
     while (popup.hasChildNodes())
       popup.removeChild(popup.lastChild);
 }
 
 function FillIdentityList(menulist)
--- a/mail/components/compose/content/messengercompose.xul
+++ b/mail/components/compose/content/messengercompose.xul
@@ -101,16 +101,17 @@
   <commandset id="composerListMenuItems"/>
 
   <!-- File Menu -->
   <command id="cmd_new" oncommand="goDoCommand('cmd_newMessage')"/>
   <command id="cmd_attachFile" oncommand="goDoCommand('cmd_attachFile')"/>
   <command id="cmd_attachCloud" oncommand="attachToCloud(event.target.cloudProvider); event.stopPropagation();"/>
   <command id="cmd_attachPage" oncommand="goDoCommand('cmd_attachPage')"/>
   <command id="cmd_attachVCard" checked="false" oncommand="ToggleAttachVCard(event.target)"/>
+  <command id="cmd_remindLater" checked="false" oncommand="toggleAttachmentReminder()"/>
   <command id="cmd_close" oncommand="goDoCommand('cmd_close')"/>
   <command id="cmd_saveDefault" oncommand="goDoCommand('cmd_saveDefault')"/>
   <command id="cmd_saveAsFile" oncommand="goDoCommand('cmd_saveAsFile')"/>
   <command id="cmd_saveAsDraft" oncommand="goDoCommand('cmd_saveAsDraft')"/>
   <command id="cmd_saveAsTemplate" oncommand="goDoCommand('cmd_saveAsTemplate')"/>
   <command id="cmd_sendButton" oncommand="goDoCommand('cmd_sendButton')"/>
   <command id="cmd_sendNow" oncommand="goDoCommand('cmd_sendNow')"/>
   <command id="cmd_sendWithCheck" oncommand="goDoCommand('cmd_sendWithCheck')"/>
@@ -384,16 +385,22 @@
         accesskey="&attachCloud.accesskey;"
         command="cmd_attachCloud">
     <menupopup id="attachCloudMenu_attachCloudPopup" onpopupshowing="addAttachCloudMenuItems(this);"/>
   </menu>
   <menuitem id="attachmentListContext_attachPageItem"
             label="&attachPage.label;"
             accesskey="&attachPage.accesskey;"
             command="cmd_attachPage"/>
+  <menuseparator id="attachmentListContext_remindLaterSeparator"/>
+  <menuitem id="attachmentListContext_remindLaterItem"
+            type="checkbox"
+            label="&remindLater.label;"
+            accesskey="&remindLater.accesskey;"
+            command="cmd_remindLater"/>
 </menupopup>
 
 <menupopup id="toolbar-context-menu"
            onpopupshowing="onViewToolbarsPopupShowing(event, 'compose-toolbox');">
   <menuseparator/>
   <menuitem id="CustomizeComposeToolbar"
             command="cmd_CustomizeComposeToolbar"
             label="&customizeToolbar.label;"
@@ -446,16 +453,19 @@
                         key="key_attachFile" command="cmd_attachFile"/>
               <menu label="&attachCloudCmd.label;" accesskey="&attachCloudCmd.accesskey;"
                     command="cmd_attachCloud">
                 <menupopup onpopupshowing="addAttachCloudMenuItems(this);"/>
               </menu>
               <menuitem label="&attachPageCmd.label;" accesskey="&attachPageCmd.accesskey;" command="cmd_attachPage"/>
               <menuseparator/>
               <menuitem type="checkbox" label="&attachVCardCmd.label;" accesskey="&attachVCardCmd.accesskey;" command="cmd_attachVCard"/>
+              <menuseparator id="menu_Attach_RemindLaterSeparator"/>
+              <menuitem id="menu_Attach_RemindLaterItem" type="checkbox" label="&remindLater.label;"
+                        accesskey="&remindLater.accesskey;" command="cmd_remindLater"/>
             </menupopup>
           </menu>
           <menuseparator/>
           <menuitem id="menu_SaveCmd" label="&saveCmd.label;" accesskey="&saveCmd.accesskey;"
                     key="key_save" command="cmd_saveDefault"/>
           <menu id="menu_SaveAsCmd" label="&saveAsCmd.label;" accesskey="&saveAsCmd.accesskey;">
             <menupopup id="menu_SaveAsCmdPopup" onpopupshowing="InitFileSaveAsMenu();">
               <menuitem id="menu_SaveAsFileCmd"
@@ -718,16 +728,22 @@
                   accesskey="&attachPageCmd.accesskey;"
                   command="cmd_attachPage"/>
         <menuseparator/>
         <menuitem id="button-attachPopup_attachVCardItem"
                   type="checkbox"
                   label="&attachVCardCmd.label;"
                   accesskey="&attachVCardCmd.accesskey;"
                   command="cmd_attachVCard"/>
+        <menuseparator id="button-attachPopup_remindLaterSeparator"/>
+        <menuitem id="button-attachPopup_remindLaterItem"
+                  type="checkbox"
+                  label="&remindLater.label;"
+                  accesskey="&remindLater.accesskey;"
+                  command="cmd_remindLater"/>
       </menupopup>
     </toolbarbutton>
 
     <toolbarbutton class="toolbarbutton-1" type="menu-button"
                id="spellingButton" label="&spellingButton.label;"
                tooltiptext="&spellingButton.tooltip;"
                command="cmd_spelling">
       <!-- this popup gets dynamically generated -->
--- a/mail/locales/en-US/chrome/messenger/messengercompose/composeMsgs.properties
+++ b/mail/locales/en-US/chrome/messenger/messengercompose/composeMsgs.properties
@@ -319,19 +319,19 @@ renameAttachmentTitle=Rename Attachment
 renameAttachmentMessage=New attachment name:
 
 ## Attachment Reminder
 ## LOCALIZATION NOTE (mail.compose.attachment_reminder_keywords): comma separated
 ##   words that that should trigger an attachment reminder.
 mail.compose.attachment_reminder_keywords=.doc,.pdf,.xls,.ppt,.rtf,.pps,attachment,attach,attached,attaching,enclosed,CV,cover letter
 
 addAttachmentButton=Add Attachment…
-addAttachmentButton.accessskey=A
+addAttachmentButton.accesskey=A
 remindLaterButton=Remind Me Later
-remindLaterButton.accessskey=R
+remindLaterButton.accesskey=L
 
 attachmentReminderTitle=Attachment Reminder
 attachmentReminderMsg=Did you forget to add an attachment?
 # LOCALIZATION NOTE (attachmentReminderKeywordsMsgs): Semi-colon list of plural forms.
 # See: http://developer.mozilla.org/en/Localization_and_Plurals
 # #1 number of keywords
 attachmentReminderKeywordsMsgs=Found an attachment keyword:;Found #1 attachment keywords:
 attachmentReminderOptionsMsg=Attachment reminder words can be configured in your preferences
--- a/mail/locales/en-US/chrome/messenger/messengercompose/messengercompose.dtd
+++ b/mail/locales/en-US/chrome/messenger/messengercompose/messengercompose.dtd
@@ -23,16 +23,18 @@
 <!ENTITY attachFileCmd.key "A">
 <!ENTITY attachCloudCmd.label "Filelink">
 <!ENTITY attachCloudCmd.accesskey "i">
 <!ENTITY attachPageCmd.label "Web Page…">
 <!ENTITY attachPageCmd.accesskey "W">
 <!--LOCALIZATION NOTE attachVCardCmd.label Don't translate the term 'vCard' -->
 <!ENTITY attachVCardCmd.label "Personal Card (vCard)">
 <!ENTITY attachVCardCmd.accesskey "P">
+<!ENTITY remindLater.label "Remind Me Later">
+<!ENTITY remindLater.accesskey "L">
 <!ENTITY closeCmd.label "Close">
 <!ENTITY closeCmd.key "W">
 <!ENTITY closeCmd.accesskey "c">
 <!ENTITY saveCmd.label "Save">
 <!ENTITY saveCmd.key "S">
 <!ENTITY saveCmd.accesskey "s">
 <!ENTITY saveAsCmd.label "Save As">
 <!ENTITY saveAsCmd.accesskey "A">
--- a/mailnews/compose/public/nsIMsgCompFields.idl
+++ b/mailnews/compose/public/nsIMsgCompFields.idl
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "nsIMsgAttachment.idl"
 #include "nsISimpleEnumerator.idl"
 
-[scriptable, uuid(bfd07df7-6707-47c8-860d-fd4b30934034)]
+[scriptable, uuid(4f803e7a-5bd5-4344-9901-7a9ee89be780)]
 interface nsIMsgCompFields : nsISupports {
 
   attribute AString from;
   attribute AString replyTo;
   attribute AString to;
   attribute AString cc;
   attribute AString bcc;
   readonly attribute bool hasRecipients;
@@ -39,16 +39,18 @@ interface nsIMsgCompFields : nsISupports
   attribute boolean returnReceipt;
   attribute long receiptHeaderType;
   attribute boolean DSN;
   attribute boolean attachVCard;
   attribute boolean forcePlainText;
   attribute boolean useMultipartAlternative;
   attribute boolean bodyIsAsciiOnly;
   attribute boolean forceMsgEncoding;
+  /// Status of manually-activated attachment reminder.
+  attribute boolean attachmentReminder;
 
   attribute AString otherRandomHeaders;
 
   /**
    * Beware that when setting this property, your body must be properly wrapped,
    * and the line endings must match MSG_LINEBREAK, namely "\r\n" on Windows
    * and "\n" on Linux and OSX.
    */
--- a/mailnews/compose/src/nsMsgCompFields.cpp
+++ b/mailnews/compose/src/nsMsgCompFields.cpp
@@ -32,16 +32,17 @@ nsMsgCompFields::nsMsgCompFields()
   m_forcePlainText = false;
   m_useMultipartAlternative = false;
   m_returnReceipt = false;
   m_receiptHeaderType = nsIMsgMdnGenerator::eDntType;
   m_DSN = false;
   m_bodyIsAsciiOnly = false;
   m_forceMsgEncoding = false;
   m_needToCheckCharset = true;
+  m_attachmentReminder = false;
 
   // Get the default charset from pref, use this as a mail charset.
   nsString charset;
   NS_GetLocalizedUnicharPreferenceWithDefault(nullptr, "mailnews.send_default_charset",
                                               NS_LITERAL_STRING("ISO-8859-1"), charset);
 
   LossyCopyUTF16toASCII(charset, m_DefaultCharacterSet); // Charsets better be ASCII
   SetCharacterSet(m_DefaultCharacterSet.get());
@@ -352,16 +353,28 @@ NS_IMETHODIMP nsMsgCompFields::SetAttach
 }
 
 NS_IMETHODIMP nsMsgCompFields::GetAttachVCard(bool *_retval)
 {
   *_retval = m_attachVCard;
   return NS_OK;
 }
 
+NS_IMETHODIMP nsMsgCompFields::GetAttachmentReminder(bool *_retval)
+{
+  *_retval = m_attachmentReminder;
+  return NS_OK;
+}
+
+NS_IMETHODIMP nsMsgCompFields::SetAttachmentReminder(bool value)
+{
+  m_attachmentReminder = value;
+  return NS_OK;
+}
+
 NS_IMETHODIMP nsMsgCompFields::SetForcePlainText(bool value)
 {
   m_forcePlainText = value;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgCompFields::GetForcePlainText(bool *_retval)
 {
--- a/mailnews/compose/src/nsMsgCompFields.h
+++ b/mailnews/compose/src/nsMsgCompFields.h
@@ -134,32 +134,34 @@ public:
   nsresult SetTemplateName(const char *value) {return SetAsciiHeader(MSG_X_TEMPLATE_HEADER_ID, value);}
   const char* GetTemplateName() {return GetAsciiHeader(MSG_X_TEMPLATE_HEADER_ID);}
 
   const char* GetDraftId() {return GetAsciiHeader(MSG_DRAFT_ID_HEADER_ID);}
 
   bool GetReturnReceipt() {return m_returnReceipt;}
   bool GetDSN() {return m_DSN;}
   bool GetAttachVCard() {return m_attachVCard;}
+  bool GetAttachmentReminder() {return m_attachmentReminder;}
   bool GetForcePlainText() {return m_forcePlainText;}
   bool GetUseMultipartAlternative() {return m_useMultipartAlternative;}
   bool GetBodyIsAsciiOnly() {return m_bodyIsAsciiOnly;}
   bool GetForceMsgEncoding() {return m_forceMsgEncoding;}
 
   nsresult SetBody(const char *value);
   const char* GetBody();
 
   nsresult SplitRecipientsEx(const nsAString &recipients,
                              nsTArray<nsMsgRecipient> &aResult);
 
 protected:
   char*       m_headers[MSG_MAX_HEADERS];
   nsCString   m_body;
   nsCOMArray<nsIMsgAttachment> m_attachments;
   bool        m_attachVCard;
+  bool        m_attachmentReminder;
   bool        m_forcePlainText;
   bool        m_useMultipartAlternative;
   bool        m_returnReceipt;
   bool        m_DSN;
   bool        m_bodyIsAsciiOnly;
   bool        m_forceMsgEncoding;
   int32_t     m_receiptHeaderType;        /* receipt header type */
   nsCString   m_DefaultCharacterSet;
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -454,16 +454,21 @@ mime_generate_headers (nsMsgCompFields *
       PUSH_STRING("receipt=0");
     PUSH_STRING("; ");
     if (fields->GetDSN())
       PUSH_STRING("DSN=1");
     else
       PUSH_STRING("DSN=0");
     PUSH_STRING("; ");
     PUSH_STRING("uuencode=0");
+    PUSH_STRING("; ");
+    if (fields->GetAttachmentReminder())
+      PUSH_STRING("attachmentreminder=1");
+    else
+      PUSH_STRING("attachmentreminder=0");
 
     PUSH_NEWLINE ();
   }
 
 
   nsCOMPtr<nsIHttpProtocolHandler> pHTTPHandler = do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv);
   if (NS_SUCCEEDED(rv) && pHTTPHandler)
   {
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -2885,16 +2885,17 @@ nsMsgComposeAndSend::InitCompositionFiel
 
   mCompFields->SetAttachVCard(fields->GetAttachVCard());
   mCompFields->SetForcePlainText(fields->GetForcePlainText());
   mCompFields->SetUseMultipartAlternative(fields->GetUseMultipartAlternative());
   int32_t receiptType = nsIMsgMdnGenerator::eDntType;
   fields->GetReceiptHeaderType(&receiptType);
 
   mCompFields->SetReturnReceipt(fields->GetReturnReceipt());
+  mCompFields->SetAttachmentReminder(fields->GetAttachmentReminder());
   mCompFields->SetReceiptHeaderType(receiptType);
 
   mCompFields->SetDSN(fields->GetDSN());
 
   mCompFields->SetBodyIsAsciiOnly(fields->GetBodyIsAsciiOnly());
   mCompFields->SetForceMsgEncoding(fields->GetForceMsgEncoding());
 
   nsCOMPtr<nsISupports> secInfo;
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -1299,16 +1299,22 @@ mime_parse_stream_complete (nsMIMESessio
       parm = MimeHeaders_get_parameter(draftInfo, "html", NULL, NULL);
       if (parm)
         sscanf(parm, "%d", &htmlAction);
       PR_FREEIF(parm);
       parm = MimeHeaders_get_parameter(draftInfo, "linewidth", NULL, NULL);
       if (parm)
         sscanf(parm, "%d", &lineWidth);
       PR_FREEIF(parm);
+      parm = MimeHeaders_get_parameter(draftInfo, "attachmentreminder", NULL, NULL);
+      if (parm && !strcmp(parm, "1"))
+        fields->SetAttachmentReminder(true);
+      else
+        fields->SetAttachmentReminder(false);
+      PR_FREEIF(parm);
 
     }
 
   // identity to prefer when opening the message in the compose window?
     identityKey = MimeHeaders_get(mdd->headers, HEADER_X_MOZILLA_IDENTITY_KEY, false, false);
     if ( identityKey && *identityKey )
     {
         nsresult rv = NS_OK;