Problem
After changing hostname with uname -S, the old server name still shows up in the "From:" field of outgoing email. How can I get Sendmail to recognize a new hostname?
Solution
Follow these steps:1. Begin by editing the configuration file for sendmail(ADMN), the
sendmail.cf, in the /usr/lib directory. You will find references
to the older server name there that need to be changed.Note: If the domain name is staying the same, then don't change it, only the host name.
These will look similar to:# All the names this host is known by
DWoldservername.domain.COM
#
CWoldservername.domain.COM oldservernameChange the entries to:# All the names this host is known by
DWnewservername.domain.COM
#
CWnewservername.domain.COM newservername2. You also should edit the /usr/mmdf/mmdftailor file. Even though
Sendmail is being used, the mmdftailor file is still important
because Sendmail reads it to obtain several settings. Change all
references to the old server name here, too. For example:MLOCMACHINE "oldservername.domain.COM"would change to:MLOCMACHINE "newservername.domain.COM"3. Once the above two files have been modified, stop and restart
Sendmail. To stop Sendmail, use the following command to get the
associated process number:ps -ef | grep sendmailThis will return output similar to:root 2488 1033 7 15:01:29 ttyp5 00:00:00 sendmail4. Kill the parent of these two processes (in the above example):
kill 10335. Restart sendmail from the command line, which is in the /etc/rc2.d directory.
See also
ta103333, "How Do I Change the System's Name?"