Bug 1151448 - Cross-posts won't send becuase Newsgroups: groups are separated with comma+space, not just comma. r=jcranmer, a=rkent
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Sun, 21 Jun 2015 21:40:16 +0300
changeset 26075 71c23450e64ea4c4ccb4d1e49076391d2a5e7917
parent 26074 839e5b1bcdb6b4daf16f180e6da8e6417f4c102f
child 26076 e167a3321887135cb7effdd0503fce5dd89743ad
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjcranmer, rkent
bugs1151448
Bug 1151448 - Cross-posts won't send becuase Newsgroups: groups are separated with comma+space, not just comma. r=jcranmer, a=rkent
mailnews/compose/test/unit/test_messageHeaders.js
mailnews/mime/src/extraMimeParsers.jsm
--- a/mailnews/compose/test/unit/test_messageHeaders.js
+++ b/mailnews/compose/test/unit/test_messageHeaders.js
@@ -264,17 +264,17 @@ function* testNewsgroups() {
     .subscribeToNewsgroup("mozilla.test");
   let identity = getSmtpIdentity("from@tinderbox.invalid",
     getBasicSmtpServer());
   fields.newsgroups = "mozilla.test, mozilla.test.multimedia";
   fields.followupTo = "mozilla.test";
   yield richCreateMessage(fields, [], identity);
   checkDraftHeaders({
     // The identity should override the compose fields here.
-    "Newsgroups": "mozilla.test, mozilla.test.multimedia",
+    "Newsgroups": "mozilla.test,mozilla.test.multimedia",
     "Followup-To": "mozilla.test",
     "X-Mozilla-News-Host": "localhost",
   });
 }
 
 function* testSendHeaders() {
   let fields = new CompFields();
   let identity = getSmtpIdentity("from@tinderbox.invalid",
--- a/mailnews/mime/src/extraMimeParsers.jsm
+++ b/mailnews/mime/src/extraMimeParsers.jsm
@@ -12,17 +12,17 @@ function parseNewsgroups(headers) {
 
 function emitNewsgroups(groups) {
   // Don't encode the newsgroups names in RFC 2047...
   if (groups.length == 1)
     this.addText(groups[0], false);
   else {
     this.addText(groups[0], false);
     for (let i = 1; i < groups.length; i++) {
-      this.addText(", ", true);
+      this.addText(",", false); // only comma, no space!
       this.addText(groups[i], false);
     }
   }
 }
 
 jsmime.headerparser.addStructuredDecoder("Newsgroups", parseNewsgroups);
 jsmime.headerparser.addStructuredDecoder("Followup-To", parseNewsgroups);
 jsmime.headeremitter.addStructuredEncoder("Newsgroups", emitNewsgroups);