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.

How can i send mail from php script where localhost resolves to accounts domain

Discussion in 'E-mail Discussions' started by mitt, May 3, 2011.

  1. mitt

    mitt Member

    Joined:
    May 11, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Hi All, i have a server running WHM/cPanel most up to date. Mail server is Exim.

    I have about 10 accounts on the server that use php scripts to send mail. Password recover, order updates etc.

    Many of the emails sent from the scripts are undeliverable because the from address and the reverse looked up domain are different. Is there some way to force localhost to resolve to the cPanel account's domain in the case of the mail scripts? I have PTR records for domains but localhost resolves to the main IP of the machine which is a different domain/host name with no PTR record.

    Hopefully i am making this clear. PHP attempts to send mail from person@domain1.com using localhost. Localhost actual resolves to a different ip than domain1.com so the reverse lookup/PTR shows domain2.com.
     
  2. mitt

    mitt Member

    Joined:
    May 11, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    More info. PLEASE help if you have any info.

    I have copied these instruction to a t Changing the Sending IP for Outbound Email in Exim

    with absolutely no effect. My PTR for the domain i have set in mailips and mail_helo is correct. And yet sending mail ALWAYS come from my server's main domain nobody@main.serverdomain.com.

    It makes no sense. As though exim is completely ignoring any config i change. This is extremely frustrating.

    How can a shared IP be useful at all for sending mail from web scripts? Without the account's domain being used most major email providers (hotmail, gmail, yahoo, etc etc) will reject the mail.

    Someone help please. I've also tried setting the interface to the IP i want (whose valid PTR returns the domain i want to use) and STILL the mail is delivered as the main server domain.
     
Loading...

Share This Page