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.

php mail() -f additional_parameters does nothing

Discussion in 'E-mail Discussions' started by neil_rutherford, Sep 17, 2010.

  1. neil_rutherford

    Joined:
    Oct 8, 2003
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    I've spent the last couple of hours google'ing and trying all sorts of test to
    try and set up a bounce address hander for the php mail function.
    No mater what i try the -f 5th mail() parameter does nothing.

    Using this:

    PHP:
    <?php
        $mail_to 
    "bad.user@domain.com";
        
    $mail_subject "Subject";
        
    $mail_message "Message";
        
    $mail_headers 'From: support@mydomain.com' "\r\n";

        
    mail($mail_to$mail_subject$mail_message$mail_headers"-fbounce@mydomain.com");
    ?>
    Even setting:

    /etc/mail/trusted-users

    to:
    apache, nobody, mywwwusr
    and without (empty as default)

    No matter what I try, the return header in the e-mail always bounces back
    to the "From", not the -f bounce user, on good e-mails has the "From", not -f

    I've looked through the Exim consider, nothing stands out, i even changed
    the -f option there.. (affects outlook comment) nothing... and changed it back.

    my php.ini is set to default path:

    sendmail_path = "/usr/sbin/sendmail -t -i"


    I've got my own server, so it's not an webhoster issue.

    I'd like to know how i can tell all mails i send from mail() where to bounce back.

    I even tried setting the "Errors-To" (which isn't recommended in the RFC), it's set in the headers,
    does nothing... everything still comes back to the "From" sender.

    Any pointers on what is preventing this would be great.
     
  2. neil_rutherford

    Joined:
    Oct 8, 2003
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    doesn't anyone have a clue on the above?
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  4. Imai

    Imai Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Hello Neil

    Did you solve this problem?
    please share

    Thank You
    Imai
     
  5. devendradb

    devendradb Member

    Joined:
    May 8, 2010
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mumbai, India
    On shared webhosting and cpanel they disabled PHP mail() internal function. so you need to install Pear Mail Package on Cpanel. On your website Cpanel search PHP Pear modules click on it. It will first show you previously instaaled Pear packages then click on available Pear packages. Select Mail Package latest version and say install. for using pear mail sendmail function see online documentation. if you could not find solution let me know
    - Devendra
     
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Note: cPanel&WHM does not disable the PHP mail() function by default. However, this is something a system administrator can configure via WHM.
     
Loading...

Share This Page