After upgrading my previous server with a new one, I run a lot of migration scripts and update procedures to make sure that everything transferred OK and worked as expected. However, a little thing kept bugging me until today.
Usually, when you want to send an email message to a local user, you either send it to user@localhost or just to user and the mail service makes sure that the local hostname is added after the ‘@’ (if there is nothing there of course). But the problem for me was that messages to local users relayed through my external mailgate after the upgrade.
The /etc/hosts and the configuration files of postfix were already filled with the correct hostnames and I could not find anything until I tried to search all the files in /etc hierarchy for the old hostname.
To my surprise, I found that the old hostname was still in /etc/mailname which, according to its man page, is a plain ASCII configuration file, which on a Debian system contains the visible mail name of the system.
I don’t know if the upgrade kept it intact or it was the restoration of /etc data files that caused this discrepancy. The good thing is that I found it easily by searching with grep.
Visit The Light of the LAMP blog for more…