I am running a php-based forum system (Invision Power Board), and having difficulty with the email. I have the board set to use my ISP's SMTP server, and it (I think it's being done by the SMTP server?) is adding these headers to any outgoing email:
Date: Tue, 23 Dec 2003 01:52:27 +0000 (GMT)
X-Comment: Sending client does not conform to RFC822 minimum requirements
X-Comment: Date has been added by Maillennium
Unfortunately, it appears that many spam filters trigger on the Maillennium X-Comments to detect non-conforming email clients, thus some members of my board (notably those with AOL accounts) cannot get email from the site.
How would I add a Date: header to email formatted by this board? Could I add it as an extra header in php.ini (note that though I'm running a Linux system, I'm pushing this mail through an SMTP server, not a local sendmail server)? All of the header functions in the code for this board seem to be in a file called emailer.php, and are entered in an array (var $mail_headers = array(). There is no Date: entry.
Some of what I think is the relevant code looks like this:
var $mail_headers = array();
.
<snip>
.
$this->header = $ibforums->vars['email_header'];
.
<snip>
.
function build_headers()
{
global $ibforums;
$this->mail_headers = "From: \"".$ibforums->var ['board_name']."\" <".$this->from.">\n";
.
<snip>
.
function send_mail()
{
.
<snip>
.
else
{
$this->smtp_send_mail();
.
<snip>
.
function smtp_send_mail()
{
$data = $this->smtp_crlf_encode( $this->mail_headers."\n" . $this->message);
So (if I'm reading this right; I'm not a programmer), it looks like an array of headers, called mail_headers, is being built in the build_headers function, the send_mail function determines that smtp is set to true (it is), and passes control to the function smtp_send_mail, which then uses the mail_headers array in formatting the message.
Assumming this is correct, is there an easy way to add a correctly formatted Date: header to the mail_headers array so I can avoid the "does not conform" and "Date added" errors?