Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm configuring postfix on CentOS. When I set

inet_interfaces = all 

mail recieving works. But when I change it to

inet_interfaces = $myhostname, localhost

mail is not recieved. What's wrong here?

share|improve this question

myhostname may be set incorrectly

It needs to resolve to the IP address that you need to listen on the internet with. i.e. most likely the primary IP of the machine as shown by ip addr sh

if you do a host $(postconf myhostname) where $myhostname is the value of postconf myhostname then you should see if it resolves correctly. The only exception to this is if the hostname is specified in /etc/hosts. So if the first doesn't resolve correctly, then try `grep $(postconf myhostname) /etc/hosts"

You may have multiple interfaces defined and myhostname is not the right interface to listen on.

share|improve this answer

What is the value of $myhostname? It might not contain a valid value.

Have a look at this page.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.