Bug 1516509 - add undisclosed-recipients when queueing message. r=aceman a=jorgk
authorJorg K <jorgk@jorgk.com>
Fri, 28 Dec 2018 10:31:24 +0100
changeset 33909 8432e7fd9626148b3787ccc429a28588079a21bf
parent 33908 81e801fbbdbd9df6bc9c8a52db95e697179263b8
child 33910 faa09be420d4aed29c76d18636af23e5184f9882
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersaceman, jorgk
bugs1516509
Bug 1516509 - add undisclosed-recipients when queueing message. r=aceman a=jorgk
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;