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.

PHP mail() not working

Discussion in 'E-mail Discussions' started by zelf, Dec 8, 2005.

  1. zelf

    zelf Active Member

    Joined:
    Dec 6, 2005
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    PHP mail() not working [Solved]

    I've read dozens and dozens of threads on this issue. I've tried several of the fixes, but still no mail is being sent.

    I have all the latest and greatest updates.

    I've run /scripts/upcp
    I've run /scripts/updatephpconf
    I've run /scripts/eximup --force
    I've verified in php.ini sendmail_path = /usr/sbin/sendmail -t -i
    Prevent nobody is not checked under mail settings

    Clearly I've missed the thread for this tweak. Where is the thread for fixing this issue?

    I desperately need to get this up and running so users can use the PHP mail() function.

    The problems was solved in this thread: http://forums.cpanel.net/showthread.php?t=47441
     
    #1 zelf, Dec 8, 2005
    Last edited: Dec 8, 2005
  2. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Are you sure that the mail script is correct? If so please check the exim_mainlog while you run the script. That should give you an idea of the issue.
     
  3. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    That sould be sendmail_path = /usr/sbin/sendmail -t -i
     
  4. zelf

    zelf Active Member

    Joined:
    Dec 6, 2005
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Yes. Okay, here's the issue how do I fix this? It's clearly some kind of setting in Exim.

    Mail only delivers to email accounts that do not have a domain on this particular server.

    e.g. I can send email to a Yahoo account, but if I attempt to send email to a domain that has a website on my server the exim_mainlog shows the following:

    2005-12-08 11:51:27 1EkPvp-0002yO-T3 <= nobody@mydomain.com U=nobody P=local S=1966 id=ir6xmd.b4gepe@mydomain.com
    2005-12-08 11:51:27 1EkPvp-0002yO-T3 => test <test@clientsdomain.com> R=localuser T=local_delivery
    2005-12-08 11:51:27 1EkPvp-0002yO-T3 => me <tech@mydomain.com> R=localuser T=local_delivery
    2005-12-08 11:51:27 1EkPvp-0002yO-T3 Completed​

    I am only using this server for web hosting and database hosting.

    I need to tell Exim to treat every deliver as remote from localhost. Any Exim experts out there.
     
    #4 zelf, Dec 8, 2005
    Last edited: Dec 8, 2005
  5. zelf

    zelf Active Member

    Joined:
    Dec 6, 2005
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Just mistyped in the window here. It is correct in php.ini
     
  6. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Are you able to send the mails to that domains using webmail? Are you having the issue only with the script?
     
  7. zelf

    zelf Active Member

    Joined:
    Dec 6, 2005
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    I am not offering webmail on this server. Seriously it's not the script!

    The issue is with Exim. That should be clear from my Post you replied to. I can send mail using the PHP htmlMimeClass or simply by using the mail() as long as the address I am sending to is not a hosted domain on my server.

    How do I tell Exim to treat all emails deliveries as remote and to never try to deliver them locally, but only ever deliver from the localhost?

    This is easy in Postfix. Maybe I need to join the Exim mail list for this one.
     
  8. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    The exim will first check for /etc/localdomains to see if the domain is there. If that is the case, it will deliver it locally. In this case you have to remove the domains from local domains and add it to /etc/remotedomains. That is why it is really important in the cas eof cpanel server, not to have test domains like hotmail, since all the mails addressed to hotmail will be delivered locally and may not reach correctly.
     
  9. zelf

    zelf Active Member

    Joined:
    Dec 6, 2005
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Right, the problems was solved in this thread: http://forums.cpanel.net/showthread.php?t=47441

    I'm not following you here. I never did set up a domain like hotmail or yahoo for testing. When I sent an email to a Yahoo account it did make it out. Now that I understand the /etc/localdomains and /etc/remotedomains I can see why that non localdomain made it out and the others did not.

    In any event, thanks for your help. Understanding that Exim looks for /etc/localdomains and then /etc/remotedomains was what I needed.

    Now how do I tell cPanel to always put newly created domains into /etc/remotedomains and not /etc/localdomains so I don't have to keep shuffling things around in there?
     
    #9 zelf, Dec 8, 2005
    Last edited: Dec 8, 2005
Loading...

Share This Page