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

The overall context for this is that I am sending mail from a web application on one machine through sendmail on another machine, to final destination being a pop account on mx.google.com. The latter sendmail machine has 2 ip numbers because it doubles as a database server. When I look at the headers after receiving the message, the ip number references is the wrong ip number. The number is not random; it is the ip number for the database server (i.e. same physical machine).

Here is the symptom. My Eudora email client reports this header: Received from good.mydomain.com (bad.mydomain.com. [x.x.x.10]) by mx.google.com with ESMTPS id ...

The phrase 'good.mydomain.com' is correct and seems to originate from the confDOMAIN_NAME line in /etc/mail/sendmail.mc. The 'bad.mydomain.com' is the rdns for x.x.x.10. I want that to be x.x.x.66 which has RDNS to good.mydomain.com already set up and working. This uses public DNS, no special etc/hosts entries.

I have this line in /etc/mail/sendmail.mc which seems to be binding the receiving side of things to the desired .66 number: DAEMON_OPTIONS(`Port=smtp,Addr=x.x.x.x.66, Name=MTA')dnl

I gather that my x.x.x.10 ip number is somehow "first" on the network card, and I do not really want to change that. I just want to make Sendmail stick to the .66 number for the relay to mx.google.com.

No worries about an open relay, the firewall is set and only accepts connections from my web server machine.

i do know that I have to run make after each change to the macros, and that I have to restart the sendmail service too.

Thank you for considering my question.

share|improve this question

1 Answer 1

You're on the right path, but you need to use CLIENT_OPTIONS to configure the source IP sendmail uses for outbound mail.

CLIENT_OPTIONS(`Family=inet, Address=x.x.x.66')

After you 'make' that (which should happen automatically on Centos if you restart the sendmail service), the sendmail.cf file should contain a corresponding ClientPortOptions parameter.

share|improve this answer
    
YES! I added that line and all is well. Thank you so much. –  Anon E. Mouse Jun 14 '12 at 12:53
    
If it worked for you, you have to "accept" the answer by clicking on the number left to it, so that @jjv is rewarded with the points for a correct answer. –  adamo Jun 14 '12 at 14:04
    
Vote Up requires 15 reputation points ! Not sure how to get around that catch-22. –  Anon E. Mouse Jun 16 '12 at 8:37
    
@AnonE.Mouse: adamo wasn't saying to upvote the answer, he/she was saying to accept it: Click the checkmark next to it to mark the question answered (by this answer). More: meta.stackexchange.com/questions/5234/… –  T.J. Crowder Nov 16 '13 at 15:31

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.