Commit 1a9bc450 authored by rswindell's avatar rswindell
Browse files

Include the RFC822 "Received" header fields.

Removed the X-Comment-To header field (is this file being used for NNTP?).
Added an 'unfold' boolean argument (defaults to true). If false, don't unfold
the header fields.
parent becd6992
const RFC822HEADER = 0xb0; // from smbdefs.h
const SMTPRECEIVED = 0xd3;
require("utf8_ascii.js", 'utf8_ascii');
MsgBase.HeaderPrototype.get_rfc822_header=function(force_update)
MsgBase.HeaderPrototype.get_rfc822_header=function(force_update, unfold)
{
var content_type;
var i;
......@@ -28,7 +29,7 @@ MsgBase.HeaderPrototype.get_rfc822_header=function(force_update)
else
this.rfc822 += "From: " + quoted_from +" <"+this.from.replace(/ /g,".").toLowerCase()+"@"+this.from_net_addr+">\r\n";
this.rfc822 += "X-Comment-To: "+this.to+"\r\n";
// this.rfc822 += "X-Comment-To: "+this.to+"\r\n";
if(this.path != undefined)
this.rfc822 += "Path: "+system.inetaddr+"!"+this.path+"\r\n";
if(this.from_org != undefined)
......@@ -58,6 +59,13 @@ MsgBase.HeaderPrototype.get_rfc822_header=function(force_update)
if(this.reverse_path != undefined)
this.rfc822 += "Return-Path: "+this.reverse_path+"\r\n";
// "Received" headers
if(this.field_list!=undefined) {
for(i in this.field_list)
if(this.field_list[i].type == SMTPRECEIVED)
this.rfc822 += "Received: " + this.field_list[i].data + "\r\n";
}
// Fidonet headers
if(this.ftn_area != undefined)
this.rfc822 += "X-FTN-AREA: "+this.ftn_area+"\r\n";
......@@ -87,7 +95,7 @@ MsgBase.HeaderPrototype.get_rfc822_header=function(force_update)
this.rfc822 += "Content-Transfer-Encoding: 8bit\r\n";
}
// Unwrap headers
if(unfold !== false)
this.rfc822=this.rfc822.replace(/\s*\r\n\s+/g, " ");
this.rfc822 += "\r\n";
// Illegal characters in header?
......
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