[CentOS] [OT] Forcing sendmail to NOT take its domain from DNS

Nick Bryant list at everywhereinternet.com
Fri Nov 11 03:55:58 UTC 2005


It seems when sendmail starts up it takes the host name from a gethostname()
which in turn is derived from a reverse lookup of the machines IP.

It uses this hostname as the default "From" address in outgoing mails e.g.
if the hostname was box.foo.bar mails from root would appear as
root at box.foo.bar

In my setup foo.bar is an internal domain which isn't recognized by remote
MTA's as being a valid domain, understandably.

So I'd like to change foo.bar to foo.bar.com so the box can send mails.

The catch is I don't want to change my hostname which is on an internal
scheme which is working will for a lot of other things.

So far I've tried in sendmail.cf:

Djfoo.bar.com

And a sendmail -bt -d0.4 gives:

Version 8.12.11
 Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
                MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET
NETINET6
                NETUNIX NEWDB NIS PIPELINING SASL SCANF STARTTLS TCPWRAPPERS
                USERDB USE_LDAP_INIT
Canonical name: box.foo.bar
        a.k.a.: box
 UUCP nodename: box.foo.bar
        a.k.a.: [10.1.1.1]

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = box
  (canonical domain name) $j = foo.bar.com
         (subdomain name) $m = foo.bar
              (node name) $k = box.foo.bar
========================================================

So although the canonical domain name now reads right it still takes the
foo.bar domain :(

Any ideas? exim? :)






More information about the CentOS mailing list