Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Mail from 'nobody'?

Discussion in 'E-mail Discussion' started by mistervlad, Feb 7, 2008.

  1. mistervlad

    mistervlad Member

    Dec 1, 2007
    Likes Received:
    Trophy Points:
    Any idea how I can change the the way php sends email, so that it would at least say that it is from the server admin?

    the reason I am asking, is becuase i just got an email returned to me, that was sent from 'nobody@<my cpanel server name>', when it shoud have been sent from 'info@<one of my resold accounts>'.

    The return path from to that 'nobody' account...

    please help!

    I also think that my server is acting as an open email relay? even though i thought i closed it up?
  2. Abhilash V Nair

    Abhilash V Nair Registered

    Aug 7, 2006
    Likes Received:
    Trophy Points:

    I am not very sure about this but as there are no replies I just want to answer it :)


    Regarding the first question, the sender address can be mentioned on your PHP script itself. On the line where you mention about the sender address(from_header in my script) just give the required one. I have got a test script for you, on which you can check and can make changes on your script.(This script will give you an idea how to set the from header on PHP.)

    $to = "";
    $from_header = "From:";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";
    if (mail($to, $subject, $body, $from_header)) {
    echo("<p>Message successfully sent!</p>");
    } else {
    echo("<p>Message delivery failed...</p>");


    NB : This code once executed will send the mail and will display the result whether it has been send or not.


    To check whether your server is accepting open relay, just do the following

    Telnet to yourmailserver at port 25 and issue all the following commands:
    mail from:
    rcpt to:


    If you are getting the error "554 : Relay access denied" then the server is not an open Relay

    If not Just pass the command "DATA" sfter the recipient and then enter the message ending with a period ie : "."

    If you get the reply "SUCCESS Relay Accepted - final response code 550"

    Then as you feared your server is subjected to open relay and if not enjoy.......... It is not :)


    I hope your server is not open relay supporting, but if it is so, as it is a Cpanel Server you can stop it normally using the below scripts

    /etc/rc.d/init.d/antirelayd restart
    service exim restart

    Hope this helps. Thank you.

    With Best Regards,

    Abhilash V.Nair
    Software Engineer
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 Abhilash V Nair, Feb 8, 2008
    Last edited: Feb 8, 2008
  3. vanessa

    vanessa Well-Known Member

    Sep 26, 2006
    Likes Received:
    Trophy Points:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    'nobody' is the user that Apache runs as, so if you have PHP compiled as an Apache module or you're using mod_perl, the email was probably sent by one or the other. You can verify this by sending an email through a PHP application.

    It's not a good idea to allow nobody mail on the server because as most of it will probably be legitimate, the 'nobody' user does not abide by outgoing mail limits of the server and is also commonly identified as spam by mail providers. You should disable 'nobody' mail via WHM > Tweak settings, and either start having your resellers use SMTP with PHP (which most software nowadays has an option for), or compile PHP under suPHP or phpsuexec so that PHP executes scripts as the user who owns them instead of 'nobody'.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice