PHP - Apcahe & Return-Path:

hi,

i got an Apcahe2 Server with PHP 4.3.11 (test server with no control panels)

i have a prb with mail(), when we send a mail form there server the header says

Return-Path: <apache>

-----------
Return-Path: <apache>
X-Original-To: test@webmail.test.com
Delivered-To: test@webmail.test.com
Received: from gate.test.com (localhost.localdomain [127.0.0.1])
by gate.test.com (Test -Out- Relay Server-1) with ESMTP id 86359174FD5
for <test@webmail.test.com>; Tue, 1 Nov 2005 09:24:11 +0600 (LKT)
Received: from security.test.com (unknown [192.168.51.6])
by gate.test.com (Test -Out- Relay Server-1) with ESMTP id 72767173490
for <test@webmail.test.com>; Tue, 1 Nov 2005 09:24:11 +0600 (LKT)
Received: from security.test.com (localhost.localdomain [127.0.0.1])
by security.test.com (Test -In- Relay Server) with ESMTP id B7EAF48850
for <test@webmail.test.com>; Tue, 1 Nov 2005 09:31:24 +0600 (LKT)
Received: by security.test.com (Test -In- Relay Server, from userid 48)
id 982A848853; Tue, 1 Nov 2005 09:31:24 +0600 (LKT)
To: test@webmail.test.com
Subject: An HTML Message
From: <admin@test.com>, "MIME-Version:1.0"
Content-Type: multipart/mixed; boundary = HTMLDEMO4366e18c84d2a
Message-Id: <20051101033124.982A848853@security.test.com>
Date: Tue, 1 Nov 2005 09:31:24 +0600 (LKT)
X-Virus-Scanned: security.test.com
X-Virus-Scanned: gate.test.com
Status: RO
X-UID: 537
Content-Length: 296
X-Keywords:
----------------


---------PHP TEST----------
<?php
//add From: header
$headers = "From: admin@test.com \r\n";

//specify MIME version 1.0
$headers .= "MIME-Version: 1.0\r\n";

//unique boundary
$boundary = uniqid("HTMLDEMO");

//tell e-mail client this e-mail contains//alternate versions
$headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n";

//plain text version of message
$body = "--$boundary\r\n" .
"Content-Type: text/plain; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$body .= chunk_split(base64_encode("This is the plain text version!"));

//HTML version of message
$body .= "--$boundary\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$body .= chunk_split(base64_encode("This the <b>HTML</b> version!"));

//send message
mail("test@webmail.test.com", "An HTML Message", $body, $headers);
?>
-----------------------------------------

this make some of the servers to reject the email as Return-Path: <apache> not an RFC valid email.

can any one help me to fix this ?

the php.ini sendmail_from dont help.

 

 

 

 

Top