main.cf should not refer to localhost

Bug #948320 reported by Morten Kjeldgaard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Invalid
Undecided
Unassigned
Nominated for Precise by Morten Kjeldgaard

Bug Description

The postfix package distributes a main.cf configuration file that refers to localhost in at least one of the parameter settings. Instead, it should use localhost's IP address (127.0.0.1), because postfix might not be able to resolve "localhost" even though it is defined in /etc/hosts. I had this problem on my server, I gave up figuring out how to solve the problem, and finally edited the config file and the problem went away. I suppose it has something to do with nsswitch.conf, and whether localhost is resolved by the nameserver, etc. etc. But I could not figure out what the problem was.

Nevertheless, it is a bug, since postfix' configuration ought to be independent of the particular setup of a server. Using 127.0.0.1 is bulletproof.

For example:

  content_filter = smtp-amavis:[localhost]:10024

should be:

  content_filter = smtp-amavis:[127.0.0.1]:10024

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 948320] [NEW] main.cf should not refer to localhost

It's not bulletproof on an IPv6 host. I think if you can't resolve localhost you have bigger problems.

Revision history for this message
James Page (james-page) wrote :

I'm in agreement with Scott; if your system can't resolve 'localhost' then its probably going to have a number of other issues as well.

The Ubuntu Server guide has some helpful advice on network configuration that might help you out:

https://help.ubuntu.com/11.10/serverguide/C/network-configuration.html

Marking this bug as 'Invalid' as the consensus is that guaranteed resolution of localhost is not unreasonable.

Changed in postfix (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.