mail error when using PHP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I've encountered an odd error, and it seems to happen only when PHP is used
to send email. I'm using PHP 4.1.2 on RH 7.1. The problem is best seen when
OS Commerce generates email.

Specifically, email that is sent to a local mailbox has the 'F' removed from
the "From " header (I think this is the very first character in email
messages). With the 'F' missing, the mail file is obviously corrupted. For
now, I've resorted to using sed() and lockfile to fix it.

When I had a little time some months ago, I spelunked through the OSC code;
it seems the problem is within a PHP mail handling function.

Has anyone ever seen this? What can I do to fix it? (Or, more politely,
where can I look to learn how to fix it?)

Clueless in Virginia's technological backwater,

Re: mail error when using PHP says...
Quoted text here. Click to load it

No, the 'From:' header is usually in the center or lower of the headers.
There are a bunch of trace headers before it indicating where the email
has been in transit.

Quoted text here. Click to load it

It may be a problem in what is passed to mailto as additional headers.
It can take a "From:" as one of these and overwrite its default value.

Check the 'F' is actually getting passed in, if it isn't being passed at
all you might solve the problem by setting the header yourself this way.

Format for that header is:

Quoted String "Name Here" is optional, address can be '<>' if no bounce
is ever wanted.

To prevent bounces with <>, but allow manual replies there is "Reply-
To:" with same format as "From:"

Treehouse Networks abuse@

Re: mail error when using PHP

Quoted text here. Click to load it

What makes you think the OP is talking about the 'From: ' header, he
specifically states the 'From ' header in a local mailbox. That is the
first line in a mbox format:
From Sat Nov 27 13:00:00 2004

Quoted text here. Click to load it

Your software is ancient, my guess is you have a software bug, either in
php (research or in you MTA. Get out your tools like
ethereal and reading the mailspool dir to see what is acutally being

Re: mail error when using PHP

TreeNet Admin wrote:
Quoted text here. Click to load it

Don't forget that all lines *must* end <CR><LF> - that's \r\n

It's in the standard, even though some mail servers don't enforce it.


Site Timeline