Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

I believe you need to configure this at your mail-server level (Exim). Have a look at these instructions for configuring Exim for different IP addresses. You should be able to configure which IP addresses are used for sending based on the domain that is sending the mail, thus you can configure it so that the domains match your reverse lookup IPs.

share|improve this answer
    
I've actually followed the exact instructions from this page.. And still my email headers come out with the original domain tied to the OTHER ip. So the changes i made in mailips are ignored. No idea why.. I've turned "Send outgoing mail from the IP that matches the domain name in /etc/mailips (*: IP can be added to the file to change the main outgoing interface)" on in the EXIM config as well. No luck. –  rich May 3 '11 at 15:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.