ID: 15841
Comment by: bug at bug dot com
Reported By: rha at juggernaut dot com dot au
Status: No Feedback
Bug Type: Mail related
Operating System: Linux
PHP Version: 4.1.2
Assigned To: yohgaki
New Comment:
nevermind, please delete my previous comment. qmail is broken and dead.
let's just move forward instead of trying to support legacy software and
holding technology back.
please close this ticket and label it as "will not fix," which i
suppose is the correct status.
Previous Comments:
------------------------------------------------------------------------
[2006-07-11 18:30:19] bug at bug dot com
what php needs is to make the $headers argument for the mail() function
an array instead of a string and then php will automagically put the
correct line endings depending on what OS it's running on. \n for unix,
\r\n for windows, \r for mac
you can keep it backwards compatiable by accepting a string as well.
also add another option in the php.ini to enable/disable the mangling
of the header line endings.
could we get an update on this bug please?
------------------------------------------------------------------------
[2005-07-27 16:01:55] mark at thelecks dot com
So has there been any resolution to this? Has PHP made any
modifications to their mail function? or provided a better work around?
------------------------------------------------------------------------
[2005-06-27 21:41:34] guy dot kastenbaum at filnet dot net
I agree with @patpro, mail() should reformate the headers.
This is my quick-and-dirty workaround (from a Q&D specialist) , in
/etc/php.ini :
sendmail_path = "unix2dos|dos2unix|sendmail -t -i"
Guyzmo -- (don't let me programm after midnight)
------------------------------------------------------------------------
[2004-09-28 00:41:06] zap at cyborganic dot net
I suddenly had header problems. Perhaps my host changed mail configs or
updated PHP (they never reply to my email, so I don't ask many
question). In any case, all my beautiful HTML emails were being sent
out with broken headers that yturned them into ugly unreadable text and
code.
I am on a Unix server, so I changed all my /r/n newlines to /n. This
fixed the issue immediately. If you find this happens to you, just use
the appropriate newline characters for your host OS.
THANKS for pointing out this bug!
------------------------------------------------------------------------
[2004-06-09 09:25:00] patpro at patpro dot net
Hi,
I would really want official PHP Team confirmation for
comments [18 Apr 2:46pm CEST] and [6 Mar 2002 11:04am
CET].
I'm facing the same problem on FreeBSD 5.x, mod_php4
-4.3.6_1,1
If you follow the documentation (using \r\n) mail() will
output badly formated headers. Many SMTPds or Filters
will rewrite headers (sendmail does, Amavisd-new does,
..., but postfix alone doesn't, for example)
I've set up a shell script to pipe mail()'s output into
a file rather than into a SMTP :
$ more /usr/local/sbin/sendmail.cat
#!/bin/sh
cat > /tmp/mailout
then I've set sendmail path to /usr/local/sbin/
sendmail.cat in httpd.conf :
php_admin_value sendmail_path "/usr/local/sbin/
sendmail.cat"
using \r\n as a header separator results in a mix of \n
and \r\n :
$ cat -v /tmp/mailout
To: [EMAIL PROTECTED]
Subject: un dernier test
From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Content-Type: text/html; charset=iso-8859-1^M
MIME-Version: 1.0^M
Content-Transfer-Encoding: 8bit^M
this mix is not RFC compliant and breaks rendering in
many mail clients.
It would be nice to change the php documentation
accordingly, and even nicer to provide mail() with the
ability to reformat headers.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15841
--
Edit this bug report at http://bugs.php.net/?id=15841&edit=1