Commit 439c60fb authored by Rob Swindell's avatar Rob Swindell 💬

Clean-up header dumps of non-RFC822 messages.

If there's no 'id' property, don't display "Message-ID: undefined".
If the new default_content_type argument is false, don't display
a default content-type and content-transfer-encoding.
parent e8b99730
......@@ -3,7 +3,7 @@
require("utf8_ascii.js", 'utf8_ascii');
require("smbdefs.js", 'RFC822HEADER');
MsgBase.HeaderPrototype.get_rfc822_header=function(force_update, unfold)
MsgBase.HeaderPrototype.get_rfc822_header=function(force_update, unfold, default_content_type)
{
var content_type;
var i;
......@@ -17,7 +17,8 @@ MsgBase.HeaderPrototype.get_rfc822_header=function(force_update, unfold)
if(this.cc_list)
this.rfc822 += "Cc: " + this.cc_list + "\r\n";
this.rfc822 += "Subject: "+this.subject+"\r\n";
this.rfc822 += "Message-ID: "+this.id+"\r\n";
if(this.id)
this.rfc822 += "Message-ID: "+this.id+"\r\n";
this.rfc822 += "Date: "+this.date+"\r\n";
var quoted_from = '"' + this.from + '"';
......@@ -105,7 +106,7 @@ MsgBase.HeaderPrototype.get_rfc822_header=function(force_update, unfold)
this.rfc822 += this.field_list[i].data+"\r\n";
}
}
if(content_type==undefined) {
if(content_type==undefined && default_content_type !== false) {
var charset = this.text_charset || (this.is_utf8 ? "UTF-8" : "IBM437");
this.rfc822 += "Content-Type: text/plain; charset=" + charset + "\r\n";
this.rfc822 += "Content-Transfer-Encoding: 8bit\r\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment