I was helping out someone with a postfix issue, and something just clicked that will speed up diagnosing similar problems. It’s not so much a postfix problem as a hostname problem, and it’s very basic.
The symptom was, mail sent to the server at domain.com was being bounced. Looking at postfix logs, postfix was trying to deliver the mail to s123.s123. (something like that, anyway)
To the quick, hostname printed s123 and hostname -f said something to the tune of it couldn’t find the FQDN.
The fix, edit /etc/hosts to look like
127.0.0.1 localhost
1.2.3.4 domain.com s123
Where 1.2.3.4 is the ethernet’s ip address.
Now, hostname said s123 and hostname -f said domain.com . A restart of postfix, and it was accepting mail again.
The thing that clicked was the relationship between /etc/hosts, hostname and hostname -f.
See basic hostname set up part 2
Related posts: