You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Matt Adair <ml...@gmail.com> on 2006/08/19 03:22:01 UTC

local PHP mails "messed up"

We recently upgraded our spamassassin from 2.64 to 3.1.4, upgrading to
Perl 5.8.4 in the process.  We also run PHP 4.4.1.

Everything seems to be running OK, except for email that is sent
through PHP's mail command to local user accounts.  In this situation,
the email in our clients shows up with no to, from, or subject.

We us a system wide procmail to send email to spamassassin:

:0 B:
* ^Content-Transfer-Encoding: base64
* name=.*\.(com|bat|pif|vbs|scr|cmd|cpl|exe)
/dev/null

:0fw
* < 512000
| /usr/local/bin/spamassassin

:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
/dev/null

:0fw
| /usr/local/bin/clamassassin

:0:
* ^X-Virus-Status: Yes
/dev/null


So, when email is sent to a local account using PHP, as in the following:

$message = "This is what was sent....";

mail("user1@cadfx.com", "the subject", $message,
    "From: user2@cadfx.com", "-fuser2@cadfx.com");


This is the full result that we receive:

>From user2@cadfx.com  Fri Aug 18 21:03:58 2006
m user2@cadfx.com  Fri Aug 18 21:03:58 2006
X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on cadfx.com
X-Spam-Level:
X-Spam-Status: No, score=-99.4 required=4.0 tests=AWL,UNPARSEABLE_RELAY,
        USER_IN_WHITELIST autolearn=ham version=3.1.4
X-Virus-Status: No
X-Virus-Checker-Version: clamassassin 1.2.2 with clamscan / ClamAV
0.88.4/1683/Fri Aug 18 10:45:58 2006

>>From nobody  Fri Aug 18 21:03:58 2006
Return-Path: <us...@cadfx.com>
Received: (from nobody@localhost)
        by cadfx.com (8.11.6/8.11.0) id k7J13wM63086;
        Fri, 18 Aug 2006 21:03:58 -0400 (EDT)
        (envelope-from user2@cadfx.com)
Date: Fri, 18 Aug 2006 21:03:58 -0400 (EDT)
From: Matt Adair <us...@cadfx.com>
Message-Id: <20...@cadfx.com>
To: user1@cadfx.com
Subject: the subject

This is what was sent....

Notice that the sent email, including headers, is essentially in the body.

Any thoughts?

Thanks,

Matt Adair

Re: local PHP mails "messed up"

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
On 8/18/2006 9:22 PM, Matt Adair wrote:
> We recently upgraded our spamassassin from 2.64 to 3.1.4, upgrading to
> Perl 5.8.4 in the process.  We also run PHP 4.4.1.
> 
> Everything seems to be running OK, except for email that is sent
> through PHP's mail command to local user accounts.  In this situation,
> the email in our clients shows up with no to, from, or subject.
> 
> We us a system wide procmail to send email to spamassassin:

<snip>

Have you disabled both the call to spamassassin and clamassassin to see 
which one is actually causing the problem?  Judging by what you've 
provided it really looks like clamassassin may be causing the problem.

Daryl

Re: local PHP mails "messed up"

Posted by Rick Macdougall <ri...@ummm-beer.com>.
Matt Adair wrote:
> We recently upgraded our spamassassin from 2.64 to 3.1.4, upgrading to
> Perl 5.8.4 in the process.  We also run PHP 4.4.1.
> 
> Everything seems to be running OK, except for email that is sent
> through PHP's mail command to local user accounts.  In this situation,
> the email in our clients shows up with no to, from, or subject.
> 
> We us a system wide procmail to send email to spamassassin:
> 
> :0 B:
> * ^Content-Transfer-Encoding: base64
> * name=.*\.(com|bat|pif|vbs|scr|cmd|cpl|exe)
> /dev/null
> 
> :0fw
> * < 512000
> | /usr/local/bin/spamassassin
> 
> :0
> * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
> /dev/null
> 
> :0fw
> | /usr/local/bin/clamassassin
> 
> :0:
> * ^X-Virus-Status: Yes
> /dev/null
> 
> 
> So, when email is sent to a local account using PHP, as in the following:
> 
> $message = "This is what was sent....";
> 
> mail("user1@cadfx.com", "the subject", $message,
>    "From: user2@cadfx.com", "-fuser2@cadfx.com");
> 
> 
> This is what was sent....
> 
> Notice that the sent email, including headers, is essentially in the body.
> 
> Any thoughts?

Hi,

Add \r\n at the end of the additional_headers and see if that helps.

Qmail will reject the message if they aren't there, other MTA's will 
still accept the message but it isn't RFC compliant and may break SA as 
well as other programs.

Example:

mail("user1@cadfx.com", "the subject", $message,    "From: 
user2@cadfx.com\r\n", "-fuser2@cadfx.com");