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.

Mail from 'nobody'?

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

  1. mistervlad

    mistervlad Member

    Joined:
    Dec 1, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    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

    Joined:
    Aug 7, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

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

    1)

    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.)

    =========================================
    <?php
    $to = "recipient@example.com";
    $from_header = "From: info@yourdomainname.com";
    $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.

    2)

    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:
    helo client.server.com
    mail from: abhi@somedomain.com
    rcpt to: you@somedomain.com

    ========================================

    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 :)

    3)

    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

    =======================
    /scripts/fixrelayd
    /etc/rc.d/init.d/antirelayd restart
    service exim restart
    =======================

    Hope this helps. Thank you.

    With Best Regards,
    --

    Abhilash V.Nair
    Software Engineer
     
    #2 Abhilash V Nair, Feb 8, 2008
    Last edited: Feb 8, 2008
  3. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    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'.
     
Loading...

Share This Page