Bug 1516509 - add undisclosed-recipients when queueing message. r=aceman DONTBUILD
authorJorg K <jorgk@jorgk.com>
Fri, 28 Dec 2018 10:31:24 +0100
changeset 33217 152f35832bad
parent 33216 110a814e63fa
child 33218 ec788f59f769
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1516509
Bug 1516509 - add undisclosed-recipients when queueing message. r=aceman DONTBUILD
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgSend.cpp
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -384,17 +384,17 @@ nsresult mime_generate_headers(nsIMsgCom
   finalHeaders->GetAddressingHeader("Cc", recipients);
   hasDisclosedRecipient |= !recipients.IsEmpty();
 
   // If we don't have disclosed recipient (only Bcc), address the message to
   // undisclosed-recipients to prevent problem with some servers
 
   // If we are saving the message as a draft, don't bother inserting the undisclosed recipients field. We'll take care of that when we
   // really send the message.
-  if (!hasDisclosedRecipient && !isDraft)
+  if (!hasDisclosedRecipient && (!isDraft || deliver_mode == nsIMsgSend::nsMsgQueueForLater))
   {
     bool bAddUndisclosedRecipients = true;
     prefs->GetBoolPref("mail.compose.add_undisclosed_recipients", &bAddUndisclosedRecipients);
     if (bAddUndisclosedRecipients)
     {
       bool hasBcc = false;
       fields->HasHeader("Bcc", &hasBcc);
       if (hasBcc)
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -157,17 +157,17 @@ static nsresult StripOutGroupNames(char 
           atFound = true;
         break;
 
       case ':':
         if (!quoted && !atFound)
         {
           // ok, we found a group name
           // let's backup the write cursor to remove the group name
-          writePtr = previousSeparator + 1;
+          writePtr = previousSeparator;
           group = true;
           continue;
         }
         break;
 
       case ';':
         if (quoted || !group)
           break;