Hi again! I am having a problem with the "Return-Path" header when sending email from the PHP mail() function and I suspect it is a server issue.

I explicitly set the return path, as in:

$headers = "From: auto_notify@mydomain.com\r\n";
$headers .= "Reply-To: auto_notify@mydomain.com\r\n";
$headers .= "Return-Path: auto_notify@mydomain.com\n";
$headers .= 'MIME-Version: 1.0'."\n";
$headers .= 'Content-type: text/html; charset=ISO-8859-1'."\n";

But on the receiving end of the email "Return-Path" is always changed back to "nobody@mail.mydomain.com" (everything else is as I set it). This is particularly a problem because many businesses are using Barracuda firewalls which IGNORE the "From" header, taking the sender address from the "Return-Path" header. Barracuda firewalls apparently don't like "nobody" as a sender name.

Can someone tell me either how to get my explicit Return-Path to stick or what configuration file to change on the server?

I am running SUSE 9/Apache 1.3/PHP 4.3

    Return path is set in php.ini (or in vhost).

    In php.ini

    sendmail_path = "/usr/sbin/sendmail -t -i -f webmaster@yourdomain.com"
    

    Or apache vhost:

    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f webmaster@yourdomain.com"
    

    We set that in vhost for every domain in our server so each domain has it's own return path with their own domain.

      Thanks! The sendmail_path wasn't set in php.ini. It works better now.

        Write a Reply...