The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Email Bounces from PHP Scripts

Discussion in 'E-mail Discussions' started by Doctor_Cox, Sep 11, 2005.

  1. Doctor_Cox

    Doctor_Cox Member

    Joined:
    Sep 11, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Greetings All,

    I have a massive problem with Cpanel (or something associated) ignoring headers in e-mails sent from PHP scripts. As my company runs a web directory from which visitors can e-mail visitors via an e-mail form, getting bounces is critical so we know if we need to delete a business. I have set headers in PHP like so based upon my research...

    $Headers .= "Return-Errors-To: me@somewhere.com\r\n";
    $Headers .= "Errors-To: me@somewhere.com\r\n";

    However, any bounces always end up sent to zeta@somewhere.com, where our poor web hosting tech has to sort through them. This is unacceptable. He says he never set this address himself, it is some kind of system default.

    From my perspective it's nearly impossible to tell what exactly is responsible for this annoying flaw - cPanel, Exim, PHP, Fedora or something else. Any help is much appreciated and would be reimbursed with a six pack of beer if physically possible.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    The problem is that emails are sent out from the server under the nobody account from php scripts if you do not have phpsuexec enabled. The two header records that you should try and add are:

    From:
    Return-Path:

    not the two that you listed.
     
  3. Doctor_Cox

    Doctor_Cox Member

    Joined:
    Sep 11, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your response.

    The From: is set based upon whatever the sender types in the form. I have experimented with setting the Return-Path, but it keeps getting overwritten with nobody@zeta.somewhere.com every time (earlier it would simply spit it out in the main part of the mail), even though my other headers remain present and untouched. That's where the confusion comes in - what's doing that? Cpanel, Apache, Exim... so many possible culprits.
     
  4. henker

    henker Well-Known Member

    Joined:
    May 1, 2003
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    If you have added nobody to the trusted senders, you can add the following line to the
    virtual host in /usr/local/apache/conf/httpd.conf:

    Code:
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f webmaster@particulardomain.com"
    After an apache restart, the emails have a return-path of the changed sender.
     
  5. maverick23

    maverick23 Well-Known Member

    Joined:
    Feb 23, 2005
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    DataCenter Provider
    Hi,

    Is it also possible that whenever we create a new account and can have this line added by default.

    Rajat
     
  6. henker

    henker Well-Known Member

    Joined:
    May 1, 2003
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    You'd have to create and tweak a /scripts/postwwwacct to accomplish that.
     
  7. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Bounces

    This is an old thread I know, sorry,

    I have phpsuexec enable and I want a particular php script to use the proper Return Path.

    I have:
    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\n";
    $headers .= "X-Priority: 3\n";
    $headers .= "X-MSMail-Priority: Normal\n";
    $headers .= "X-Mailer: php\n";
    $headers .= 'From: '.$From. "\r\n" .
    'Reply-Path: '.$Reply. "\r\n" .
    'Reply-To: '.$Reply. "\r\n" .
    'X-Mailer: PHP/' . phpversion();
    My bounce emails are going to root.

    What am I doing wrong.
     
Loading...

Share This Page