Greetings,

I'm using the sendmail binary found in the mini_sendmail-chroot package to be able to use the mail() function in PHP pages. However, it simply refuses to send mail when I specify the recipient address in the form "Name <[EMAIL PROTECTED]>".

For the example, let's consider the following PHP script :

        <?php
        $endl="\n";

        $headers =
                "MIME-Version: 1.0$endl".
                "Content-type: text/plain; charset=utf-8$endl".
                "Content-Transfer-Encoding: 8bit$endl".
                "X-Mailer: Foo$endl".
                "From: Foo Bar <[EMAIL PROTECTED]>$endl".
                "Reply-To: Foo Baz <[EMAIL PROTECTED]>";

        $dest = "Myself <[EMAIL PROTECTED]>";
        $subject = "foo";
        $body = "foo$endl"."bar";

        mail( $dest, $subject, $body, $headers );
        ?>

When run from the shell, thus in a non-chrooted environment and using the system's sendmail, the script works as expected. However, when run in Apache, no mail is sent and the following line appears in the error log :

        /usr/sbin/sendmail: unexpected response 553 to RCPT TO command

And if I just put "[EMAIL PROTECTED]" in my $dest variable, the mail is sent in both environments, so this is clearly the "mini sendmail" not liking recipient addresses in the "Name <address>" format.

So I wonder, is it a bug, a configuration mistake, or is it simply how it's supposed to work ? Any input would be appreciated.

Firas

--
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Reply via email to