I have an environment where multiple servers are behind a firewall. A few of these machines are completely inaccessable from outside the firewall, and hence they have names that are unresolvable on the internet. I have them smarthosting through a machine that's publicly accessabe. (These are centos linux machines by the way) So, for example:
machine hidden.foo.com sits behind the firewall. machine www.foo.com
is also behind the firewall but is publicly accessable. There is forward/reverse DNS for www.foo.com
but not for hidden.foo.com. On hidden.foo.com I have modified /etc/mail/sendmail.mc to contain define(`SMART_HOST', `www.foo.com'
), and I've rebuilt sendmail.cf and restarted sendmail.
When I try to send mail from hidden.foo.com it gets received by www.foo.com
without any problems. But then when www.foo.com
tries to deliver the mail it usually gets rejected with a "Sender address rejected: Domain not found" error because the from address appears as email@example.com.
So what's the right way to configure sendmail to ensure these e-mails get delivered? Having hidden.foo.com deliver the messages as just "firstname.lastname@example.org" would be fine as far as I'm concerned.