diff --git a/exec/load/822header.js b/exec/load/822header.js index 8022352e43f5bf2b34c6639cabc3902956bf64e0..83fbecd7872c41a0086c4a50726405908dee5f4b 100644 --- a/exec/load/822header.js +++ b/exec/load/822header.js @@ -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";