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.

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.

  • YES! I added that line and all is well. Thank you so much. Jun 14, 2012 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, 2012 at 14:04
  • Vote Up requires 15 reputation points ! Not sure how to get around that catch-22. Jun 16, 2012 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/… Nov 16, 2013 at 15:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .