[CentOS] dumb sendmail question -- how to get outbound messages to use "example.com" instead of hostname?

Jeff Potter jpotter-centos at codepuppy.com
Mon Jul 2 17:43:27 UTC 2007


Hi List,

I have a dumb sendmail question, and I'm wondering if anyone can  
point me in the right direction (besides "sendmail list is two doors  
down on the left" ;-).

One of our clients has a bunch of servers -- CentOS 5 -- that are on  
only a private network that's NATted to the outside world -- that is,  
those servers can initiate outbound connections fine, but don't have  
valid IPs / hostnames as far as the outside world is concerned.

The problem is the hostnames of these machines don't exist in real  
DNS anywhere, so when they try to send mail to the outside world,  
other mail servers are seeing an invalid domain in the from address  
and summarily rejecting the messages (which makes sense).

I need to figure out how to tell sendmail, when sending outbound  
messages, to use the domain name "example.com", instead of  
"subdomain.example.com". It would seem simple in /etc/mail/sendmail.mc:

	MASQUERADE_AS(`example.com')dnl
	LOCAL_DOMAIN(`example.com')dnl
	FEATURE(`masquerade_envelope')dnl
	FEATURE(masquerade_entire_domain)dnl
	MASQUERADE_DOMAIN(betsy.example.com)dnl

(Followed by a make -C /etc/mail; service sendmail restart)

This doesn't seem to work. The odd thing is that, when I send a  
message out to an external address of mine, the bounce back to root  
*does* get through successfully -- the from address at that point is  
"MAILER-DAEMON at example.com" so it allows it.

Thoughts? I'm thinking I'm missing something realllllllly basic.

best,
Jeff




More information about the CentOS mailing list