Skip to content
Snippets Groups Projects
Commit aaf0b7ff authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

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 6e74e262
Branches
Tags
No related merge requests found
......@@ -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";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment