We had a problem with Sendmail on Solaris 8 where it would list the From: address in outgoing mail as "user@foo" instead of "email@example.com". Fixing this was a pain because nothing appeared to be wrong. We ran find|grep searches to be sure every file in /etc with the host name in it was using the full "foo.org", we upgraded libresolver and sendmail to the latest patches available, we added "Dj", "DM" and "Dm" rules specifying "foo.org" to every .cf file in /etc/mail, we tried copying sendmail.cf and submit.cf files from another working system, none of it helped. All the while check-hostname, uname -a, uname -X, and the basic hostname command all reported the host name as the full "foo.org".
What eventually fixed the problem was adding the wrong hostname to the /etc/hosts file. Where it had said:
22.214.171.124 foo.org sun450
We changed it to say:
126.96.36.199 foo.org foo sun450
That seemed to do it. Sendmail is now sending mail From: firstname.lastname@example.org instead of @foo. This leaves the question of why.
I will pose two sides to the question because there might be two different answers. Why was Sendmail using plain "foo" before when there is nothing on the system to specify a "foo" without a ".org"? And why did sendmail not pick up "foo.org" as the name matched to its external interface until I added just plain "foo" to the hosts file?
Thanks to anybody who could clear this up.