Skip to content
Snippets Groups Projects
Commit 439c60fb 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 e8b99730
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require("utf8_ascii.js", 'utf8_ascii'); require("utf8_ascii.js", 'utf8_ascii');
require("smbdefs.js", 'RFC822HEADER'); 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 content_type;
var i; var i;
...@@ -17,6 +17,7 @@ MsgBase.HeaderPrototype.get_rfc822_header=function(force_update, unfold) ...@@ -17,6 +17,7 @@ MsgBase.HeaderPrototype.get_rfc822_header=function(force_update, unfold)
if(this.cc_list) if(this.cc_list)
this.rfc822 += "Cc: " + this.cc_list + "\r\n"; this.rfc822 += "Cc: " + this.cc_list + "\r\n";
this.rfc822 += "Subject: "+this.subject+"\r\n"; this.rfc822 += "Subject: "+this.subject+"\r\n";
if(this.id)
this.rfc822 += "Message-ID: "+this.id+"\r\n"; this.rfc822 += "Message-ID: "+this.id+"\r\n";
this.rfc822 += "Date: "+this.date+"\r\n"; this.rfc822 += "Date: "+this.date+"\r\n";
...@@ -105,7 +106,7 @@ MsgBase.HeaderPrototype.get_rfc822_header=function(force_update, unfold) ...@@ -105,7 +106,7 @@ MsgBase.HeaderPrototype.get_rfc822_header=function(force_update, unfold)
this.rfc822 += this.field_list[i].data+"\r\n"; 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"); var charset = this.text_charset || (this.is_utf8 ? "UTF-8" : "IBM437");
this.rfc822 += "Content-Type: text/plain; charset=" + charset + "\r\n"; this.rfc822 += "Content-Type: text/plain; charset=" + charset + "\r\n";
this.rfc822 += "Content-Transfer-Encoding: 8bit\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