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 server issues

Discussion in 'E-mail Discussion' started by Tapan, Aug 29, 2005.

  1. Tapan

    Tapan Well-Known Member

    Joined:
    Dec 4, 2004
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Chandigarh
    Hello,


    I am the root user of the server. And i am using CPanel/WHM. I have set "Default catch-all/default address behavior for new accounts" option tp "blackhole".

    Now the problem i am facing is that all emails belong to my clients which are being sent from php scripts to people and if a email address to which the email is sent does not exists then when the bounced email comes back..

    i am getting the bounced mail and not the actual client (the account holder) as a result i am getting all the bounced back emails.

    How do i resolve this ? My server admin is unable to fix the issue.

    Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    For starters, you should be using :fail: and not :blackhole: as has been mentioned often enough now:
    http://www.configserver.com/free/fail.html

    As for bounces, you need to ensure that the PHP scripts specify the From: and Return-Path: header records of a valid email address when they use the mail() command. If they are already doing that, then the only definite resolution is to enable phpsuexec.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Tapan

    Tapan Well-Known Member

    Joined:
    Dec 4, 2004
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Chandigarh
    Hi,

    Okay i have set it to fail. Now how to install phpsuexec ? and i have heard its not really good and can make php scripts not to work at all.

    Is that true ?

    What will i be facing if i get this phpsuexec installed ?

    Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Tapan

    Tapan Well-Known Member

    Joined:
    Dec 4, 2004
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Chandigarh
    Hi,

    Earlier in my shared server i was not using phpsuexec and i never recieved any email from any account. But now on this new server why this is happening ? Isn't this odd ? Should'nt the email bounce back to users's default account instead of me ?

    Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. neonix

    neonix Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    124
    Likes Received:
    2
    Trophy Points:
    168
    A quick workaround will be to open an email account on yahoo.com or gmail.com and redirect 'nobody''s mail to these addresses.

    You can do this from WHM > mail preferences
     
  6. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    497
    Likes Received:
    3
    Trophy Points:
    318
    phpsuexec is *not* enabled on our server, but (much to my surprise) this worked for me without editing exim.conf as some have suggested (note the -f option in the 5th parameter $more). Running this genericised script successfully delivered the bounced/failed message notification back to myaddress@mydomain.com *without* setting either the reply-to or return-path addresses. I'm running exim-4.52-7.

    PHP:

    <?php
    $to               
    "nonexistentperson@test.com";
    $from           "myaddress@mydomain.com";      
    $subject        "the subject";
    $message     "the message";
    $headers      "From: $from";
    $add_parms  "-f$from";

    mail($to$subject$message$headers$add_parms);

    ?> 

    p.s. This forum posting http://forum.cpanelhosts.com/viewtopic.php?t=319 alerted me to the '5th variable', but I didn't need to add untrusted_set_sender = *@+local_domains to exim.conf as suggested by faldran for it to work on my server. Result!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    497
    Likes Received:
    3
    Trophy Points:
    318
    This from http://au3.php.net/manual/en/function.mail.php

    We're running exim, so I'm assuming that if the advice for sendmail users is to add trusted users to /etc/mail/trusted-users, then equivalent advice for exim users is to add untrusted_set_sender = *@+local_domains to exim.conf ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    497
    Likes Received:
    3
    Trophy Points:
    318
    http://www.exim.org/exim-html-4.50/doc/html/spec.html

    But I reckon

    untrusted_set_sender = *@+local_domains

    is better because then at least you've got some restriction (members of local_domains) on who can set the -f option, as opposed to no restriction whatsoever (which spammers, viruses tend to like).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    497
    Likes Received:
    3
    Trophy Points:
    318
    Ha! I just looked at exim.conf on one of our servers, and lo and behold, right at the top of the script:

    Job done! So all I have to do is to set the 5th php mail() function parameter to -fuser@domain.com and it should be all good (for bounced messages to get back to user@domain.com). I don't like making custom edits to exim.conf because it's probably one of those files that cPanel takes upon itself to auto-update, thereby overwriting my changes.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

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