OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Incorrect domainname

From: Paul Hewlett (paulgccs.co.za)
Date: Mon Dec 03 2007 - 08:09:27 CST


I recently upgraded from 2.3.6 to 2.4.5 on my Gentoo master box and postfix is
now unable to get the domainname - it insists that it is 'localdomain'.

My setup is very simple - I am just using postfix as the local mta and
forwarding any non-local addresses to another gentoo box also running
postfix. I have been using postfix in this way for a number of years without
trouble but I note that postfix 2.4 has a documented 'improvement' whereby
the hostname does not necessarily have to include the FQDN and will default
to
localdomain. Executing hostname,hostname -f and dnsdomainname commands from
the shell prompt returns the correct result in all cases. i.e. sundown,
sundown.cpt.gccs.co.za and cpt.gccs.co.za.

I had a look at the source code but apart from a big warning about not
using 'gethostbyname' in the 'get_hostname.c' file nothing seems to have
changed. I upgraded from 2.4.5 to 2.4.6 but this did not fix it.

The error msg in /var/log/messages is:

Dec 3 15:55:53 sundown postfix/smtp[14135]: 3149077A7DC:
to=<supportcpt.gccs.co.za>, orig_to=<rootsundown.localdomain>, relay=none,
delay=130621, delays=130621/0.02/0/0, dsn=4.3.5, status=deferred (Host or
domain name not found. Name service error for name=smtp.localdomain type=A:
Host not found)

The /etc/hosts file is:

# /etc/hosts: This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04
20:12:25 azarah Exp $
#
127.0.0.1 sundown.cpt.gccs.co.za sundown localhost
# IPV6 versions of localhost and co
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

and postconf -n is:

sundown etc # postconf -n
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
home_mailbox = .maildir/
html_directory = /usr/share/doc/postfix-2.4.6-r1/html
mail_owner = postfix
mailbox_command = /usr/bin/procmail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.4.6-r1/readme
relayhost = [smtp.$mydomain]
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
unknown_local_recipient_reject_code = 550

and /etc/mail/aliases is:
sundown etc # cat /etc/mail/aliases
# Basic system aliases -- these MUST be present.
MAILER-DAEMON: postmaster
postmaster: root

# General redirections for pseudo accounts.
adm: root
bin: root
daemon: root
exim: root
lp: root
mail: root
named: root
nobody: root
postfix: root

# Well-known aliases -- these should be filled in!
root: support
operator: support
support: supportcpt.gccs.co.za

# Standard RFC2142 aliases
abuse: postmaster
ftp: root
hostmaster: root
news: usenet
noc: root
security: root
usenet: root
uucp: root
webmaster: root
www: webmaster

# trap decode to catch security attacks
# decode: /dev/null

Any help appreciated - I can install from source if required.

Regards
--
Paul Hewlett Technical Director
Global Call Center Solutions Ltd, 2nd Floor, Milnerton Mall
Cnr Loxton & Koeberg Roads, 7435 Milnerton
www.gccs.co.za
Tel: +27 86 111 3433 Fax: +27 86 111 3520 Cel: +27 76 072 7906
VOIP: 087 750 7474