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.

Directing email bounces from PHP scripts

Discussion in 'E-mail Discussions' started by Doctor_Cox, May 25, 2006.

  1. Doctor_Cox

    Doctor_Cox Member

    Joined:
    Sep 11, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    We have a server running cPanel, and a content management system that utilises email forms for various tasks. We have a major problem with the way cPanel directs bounced messages from PHP scripts. A recent example would be setting up a mailing list from an old SQL table from another server containing email addresses and details of their past subscribers. The table had serveral hundred entries, a sizeable portion of which were no longer valid. So we got bombarded with many bounce messages from the no longer valid emails.

    We would like these bounces to go to the client instead so they can maintain their mailing list. However I have tried various combinations of headers many times. cPanel (or at least Exim) seems to either ignore them, replace them, or spit them out with the main message body. I can't be the first one who has experienced this problem. Does any one know of a work around?
     
  2. kdarray

    kdarray Well-Known Member

    Joined:
    Apr 13, 2006
    Messages:
    81
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Washington
    What are you running

    Is this server running phpsuexec or just suexec thus causing email to be sent from nobody with a return address of nobody@server.domain.com so that they wont get returned as bounced to the sending domain? What are the basic specs please.
     
  3. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    A neat trick would be to pipe such bounces to a script that can parse the message so that the correct recipient can be identified and thus forward the message on to where you think it would be of more use.
     
  4. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Alternatively you could use phpmailer. I have tried and implemented it on many client servers/ websites. All mails send from it has proper from address and hence is bounced back only to them and not to nobody@servername.

    You could copy phpmailer files anywhere in your php include path for all the users to access. This way when a new version arrives you can just overwrite the old version and upgrade for all users simultaneously. ;)
     
Loading...

Share This Page