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 34071 152f35832badf20ad9f71035a6a55f5add7b66cd
parent 34070 110a814e63fa5cc4109817f5b059a84f501a3bf3
child 34072 ec788f59f7697f702c90cd77277570d63481d985
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
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;