Bug 1151448 - Cross-posts won't send becuase Newsgroups: groups are separated with comma+space, not just comma. r=jcranmer, a=rkent
--- 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);