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

Les Mikesell lesmikesell at gmail.com
Fri Nov 11 04:23:41 UTC 2005

On Thu, 2005-11-10 at 21:55, Nick Bryant wrote:
> 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.

Just set MASQUERADE_AS in sendmail.mc and restart sendmail 
with 'service sendmail restart' (the init script takes care
of rebuilding sendmail.cf)  If you want root's mail to also
be masq'd, remove the EXPOSED_USER setting.  If you are also
receiving mail, be sure to put all the names to accept as local
in the local-host-names file (also needs a sendmail restart).

  Les Mikesell
    lesmikesell at gmail.com

More information about the CentOS mailing list