Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 26
  1. #1
    Member
    Join Date
    Sep 2003
    Posts
    71

    Default bounced emails going to nobody

    I have several accounts that we developed php scripts for that send out emails to people such as postcard scripts, or scripts that send out to a list of selected people. If the script sends out to a bad email address the bounce messages get sent to nobody which then get forwarded to me as server admin even though there is a specific user's email address in the from field in each message that goes out.

    I am assuming then, that the server is inserting the nobody address somewhere in the header of each email. Is there a configuration on the server that inserts the senders email in the right place in the header?

  2. #2
    Member
    Join Date
    Sep 2004
    Posts
    529

    Default

    It's the Return-path: in the header...
    Exim seems to have been changed by cpanel to no longer automatically figure out where these emails should really go.

    There are a number of other threads here discussing this... search for them for more info.

  3. #3
    Member
    Join Date
    Oct 2003
    Posts
    18

    Default

    I've been following this one up to.

    It appears you have to enable phpsuexec and rebuild apache, so the php scripts
    will run under the ID of the user and not nobody.
    Then you have to ensure the scripts are chmod'd like perl scripts to get them to
    work correctly.

    Did that, it caused a configuartion error apache page to appear, i think something
    needed updating in the httpd.conf file.

    So i recompiled without it.
    I thought, why go to all this trouble when it wasn't using phpsuexec in the first place
    and the return to path used to work.

    The odd thing is, if the mail address is correct, then the reply-to is the sender address
    of the mail and not nobody@mysubdomain.myserver.com
    It appears EXIM is adding the return-path nobody@mysubdomain.myserver.com
    so bounded e-mails from all the hosting accounts come bouncing back to the
    server admin acccount for php based apps, since they run as nobody.

    That was my question, without using phpsuexec, how can EXIM be changed to
    figure things out like it used to.

    On i plod!!!

    If you get an answer before i do, please update this thread.

  4. #4
    Member
    Join Date
    Oct 2003
    Posts
    18

    Default return-path nobody bounced mail in PHP - Solution

    Thanks to those members who have posted the solution,
    here is the implementation notes for those a little more challenged:

    Open "WHM"
    Under "Service Configuration" , click "Exim Configuration Editor"
    Click "Switch to advanced mode"

    In the first editable text box below
    #!!# cPanel Exim 4 Config:

    ADD:

    local_from_check = false
    untrusted_set_sender = root


    In the textbox that follows (REWRITE CONFIGURATION)
    begin rewrite:

    ADD:

    nobody@lsearch;/etc/localdomains "${if !eq {$header_From:}{}{$header_sender:$header_From:}fail}" Fs
    cpanel@lsearch;/etc/localdomains "${if !eq {$header_From:}{}{$header_sender:$header_From:}fail}" Fs

    NOTE: there is no space between fai and l in the word fail above.
    There appears to be a text translation problem in the forum.


    Now Click Save, Exim will restart with the updated config.
    It now works ( it does for me ).
    One note worth mentioning, the TextBoxes were empty prior to
    me populating them.
    Last edited by neil_rutherford; 11-07-2004 at 04:11 AM.

  5. #5
    Member
    Join Date
    Oct 2004
    Posts
    11

    Default

    Quote Originally Posted by neil_rutherford
    Thanks to those members who have posted the solution,
    here is the implementation notes for those a little more challanged:

    Open "WHM"
    Under "Service Configuration" , click "Exim Configuration Editor"
    Click "Switch to advanced mode"

    In the first editable text box below
    #!!# cPanel Exim 4 Config:

    ADD:

    local_from_check = false
    untrusted_set_sender = root


    In the textbox that follows (REWRITE CONFIGURATION)
    begin rewrite:

    ADD:

    nobody@lsearch;/etc/localdomains "${if !eq {$header_From:}{}{$header_sender:$header_From:}fail}" Fs
    cpanel@lsearch;/etc/localdomains "${if !eq {$header_From:}{}{$header_sender:$header_From:}fail}" Fs



    Now Click Save, Exim will restart with the updated config.
    It now works ( it does for me ).
    One note worth mentioning, the TextBoxes were empty prior to
    me populating them.
    This method did not work for me. if someone has the solution please let me know. Thanks. I'm actually looking through this thread too. Not sure if it is the same problem.
    Last edited by lemonsensation; 11-06-2004 at 11:50 PM.

  6. #6
    FWC
    FWC is offline
    Member
    Join Date
    May 2002
    Location
    Ontario, Canada
    Posts
    354

    Default

    Quote Originally Posted by lemonsensation
    This method did not work for me. if someone has the solution please let me know. Thanks. I'm actually looking through this thread too. Not sure if it is the same problem.
    Remove the spaces between the i and l in the word fail in each line. That will break the rewrite and prevent it from doing it's job. It worked for me after I fixed them.

  7. #7
    Member
    Join Date
    Oct 2003
    Posts
    18

    Default

    It must be a forum problem.

    I copied the rewrite rule and it appears ok without the space between fai and l
    You view it and it appears with a space.
    You edit it the text to update it and no space.... must be text translation in the forum
    that is doing this.

  8. #8
    Member
    Join Date
    Oct 2004
    Posts
    11

    Default

    crap, actually my problem with PHP scripts is a little bit different than yours. My problem with PHP scripts is that when the php script tries to send out an email, it sends the email as "nobody@MYHOSTNAME.com" when the web address and MYHOSTNAME are totally different. So to solve this problem, I turn on "Prevent the user 'nobody' from sending out mail to remote addresses (php and cgi scripts generally run as nobody if you are not using phpsuexec and suexec respectively.)"

    After doing that, emails get stuck in the Mail Queue. It says the email it was trying to send to has an "unrouteable mail domain".

    I tried the PHPsuexec and it fixed the problem. However, I would like to keep phpsuexec off, if possible. So I try out this solution by modifying Exim. At first it didn't work at all because of the "fai l" problem. After fixing it, the email instead of going to the mail queue, it gets sent to :blackhole: with the same error saying "unrouteable mail domain".

    The php script I am using is Drupal. I'm using WHM 9.9.7 cPanel 9.9.8-S6. Basically, emails are being sent out as nobody even though I have configured Drupal. Works fine with phpsuexec but I would like to keep phpsuexec off.

    UPDATE: I made my own thread since my problem is different than yours. It is here: http://forums.cpanel.net/showthread....092#post151092
    Last edited by lemonsensation; 11-07-2004 at 09:56 AM.

  9. #9
    Member
    Join Date
    Oct 2003
    Posts
    18

    Default

    PHP Code:
    actually my problem with PHP scripts is a little bit different than yoursMy problem with PHP scripts is that when the php script tries to send out an emailit sends the email as "nobody@MYHOSTNAME.com" when the web address and MYHOSTNAME are totally different
    From what you are saying above, it's symptomatic of what i had.
    PHP was sending mail as nobody@.... because phpsuexec was off and apache uses nobody
    account.
    phpsuexec is still off, i applied what was written above and now all PHP mail
    sent via the PHP scripts i have written go via their account and host name and any
    are returned mails are returned to the account that sent them, not nobody.

    You might have other config parameters configured differently which is stopping you achieving your goal.

  10. #10
    Member
    Join Date
    Jan 2003
    Posts
    276

    Default

    Hello Neil!

    The fix that you have posted in this thread worked great on all my servers.

    Mail is still being send by nobody@myserver.com but when there are any bouces it gets returned to the sender address.

    Thank you for posting it here I did a search for this a few times now but never found the fix anywhere else.
    www.ccccanada.com
    Web and Server Hosting

  11. #11
    Member
    Join Date
    Oct 2004
    Posts
    11

    Default

    Quote Originally Posted by neil_rutherford
    PHP Code:
    actually my problem with PHP scripts is a little bit different than yoursMy problem with PHP scripts is that when the php script tries to send out an emailit sends the email as "nobody@MYHOSTNAME.com" when the web address and MYHOSTNAME are totally different
    From what you are saying above, it's symptomatic of what i had.
    PHP was sending mail as nobody@.... because phpsuexec was off and apache uses nobody
    account.
    phpsuexec is still off, i applied what was written above and now all PHP mail
    sent via the PHP scripts i have written go via their account and host name and any
    are returned mails are returned to the account that sent them, not nobody.

    You might have other config parameters configured differently which is stopping you achieving your goal.
    Hi, Yah you are right neil_rutherford. ccccanada pointed it out in my other thread. I had
    Prevent the user 'nobody' from sending out mail to remote addresses (php and cgi scripts generally run as nobody if you are not using phpsuexec and suexec respectively.)
    enabled and phpsuexec disabled so it just wouldn't allow PHP to send emails at all even though I added your code. In order for you code to work, I need to keep "Prevent the user 'nobody' from sending out mail" OFF and phpsuexec OFF. Thanks.

  12. #12
    Member
    Join Date
    Oct 2003
    Posts
    18

    Default

    I'm using the following stable version:

    WHM 9.9.7 cPanel 9.9.8-R5
    RedHat Enterprise 3 i686 - WHM X v3.1.0

    Attached is a copy of the servers exim.conf that cpanel merges with the changes
    i've added via the cpanel admin tool.
    Compare it to see what is different with your settings.

    Or, upload it to your server, and copy it to
    /etc/exim.conf
    and restart exim.

    It sends e-mail as user@user.com and return path is user@user.com (for example).

    I've included a php test mailing script you can run.

    Don't forget to rename both files attached to
    exim.conf and email-test.php

    Update the from and to address in the top of the email-test.php

    Neil.
    Attached Files

  13. #13
    Member
    Join Date
    May 2003
    Location
    Tiznit (Morocco)
    Posts
    178

    Default

    This problem it's correct using c orrect programing on PHP.

    Programers must use 5 parameter of funtion email() .
    Tutorial on Spanish language for oscommerce and other scripts for mail() return nobody

  14. #14
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2004
    Posts
    347

    Default

    Quote Originally Posted by neil_rutherford
    nobody@lsearch;/etc/localdomains "${if !eq {$header_From:}{}{$header_sender:$header_From:}fail}" Fs
    cpanel@lsearch;/etc/localdomains "${if !eq {$header_From:}{}{$header_sender:$header_From:}fail}" Fs
    It works great, but if there is no "From:" header, mails are bounced to root.
    So how to modify those lines to make such thing:

    bounced messages are delivered to sender (not nobody) and if there is no valid sender they are simply deleted and not send to root.

    Hope you will help me

  15. #15
    Member
    Join Date
    Mar 2003
    Posts
    18

    Default

    i'm gettin a error in the line below the other one is working as far as i can tell at the moment.

    But when i did this earlyer it was working but now it doesn't. Can some one advice me.

    Code:
    error in ACL: unknown ACL verb in "nobody@lsearch;/etc/localdomains "${if !eq {$header_From:}{}{$header_sender:$header_From:}fail}" Fs"
    The fail is not fai l but it reads fail

Similar Threads & Tags
Similar threads

  1. How to stop bounced emails
    By xml in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-15-2007, 12:28 PM
  2. Bounced emails getting lost
    By coopersita in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-28-2006, 10:55 PM
  3. Emails being bounced
    By WGN in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-07-2006, 10:33 AM
  4. Exim, Nobody, bounced emails.
    By Adrnalnrsh in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 05-17-2005, 10:38 AM
  5. Bounced emails
    By sigep739 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-26-2004, 06:06 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube