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

mitt

Member
May 11, 2004
22
0
151
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 [email protected] using localhost. Localhost actual resolves to a different ip than domain1.com so the reverse lookup/PTR shows domain2.com.
 

mitt

Member
May 11, 2004
22
0
151
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 [email protected].

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.