Project

General

Profile

Bug #2206

wrong /etc/hosts setup in ix-hostname

Added by tj45 - over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Nice to have
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Hey,

I think the /etc/hosts setup (as done in /etc/rc.d/ix-hostname) is currently "broken".

In ix-hostname the hosts file gets copied from base to /etc/hosts, containing one line to resolve 127.0.0.1. After that a line with the user supplied hostname and domain ist appended to /etc/hosts.
Now there are two lines resolving 127.0.0.1, but only the one copied with the base version of the hosts file matches:

[...]
127.0.0.1 localhost localhost.my.domain freenas freenas.local
[...]
127.0.0.1 $hostname $hostname.$domain

I'm very new to [[FreeBSD]] and [[FreeNAS]], so sorry if this is kind of bullshit ;)

Associated revisions

Revision c423f1ea (diff)
Added by William Grzybowski over 6 years ago

Force local_hostname to send emails ticket: #2206

History

#1 Updated by William Grzybowski over 6 years ago

That is the expected behavior. What is your issue with this?

#2 Updated by tj45 - over 6 years ago

I noticed this when i send a test mail from the webinterface. My smtpd rejected the mail because in the ehlo [[FreeNAS]] send "localhost.my.domain" as hostname.

The used smtplib in python tries to resolve the hostname by calling socket.getfqdn(localhost) r1, which resolves the first entry of /etc/hosts as hostname, which is (as i thought) wrong, because i supplied a hostname and a domain.

r1 Line 259: http://hg.python.org/cpython/file/2.7/Lib/smtplib.py

Thank you!

#3 Updated by William Grzybowski over 6 years ago

If thats the issue then maybe we should set local_hostname when using SMTP from smtplib

#4 Updated by William Grzybowski over 6 years ago

Should have been fixed in [c423f1ea]

Also available in: Atom PDF