Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uwm.edu!ux1.cso.uiuc.edu!mp.cs.niu.edu!rickert From: rickert@mp.cs.niu.edu (Neil Rickert) Newsgroups: comp.unix.questions Subject: Re: Now that resolver is used, mail ignores 'mailhost' in /etc/hosts Keywords: resolver, sun, hosts Message-ID: <1990Dec19.053726.22589@mp.cs.niu.edu> Date: 19 Dec 90 05:37:26 GMT References: <1990Nov30.135031.25038@uunet!unhd> <114205@uunet.UU.NET> <1990Dec18.234957.29846@mlb.semi.harris.com> Organization: Northern Illinois University Lines: 36 In article <1990Dec18.234957.29846@mlb.semi.harris.com> del@algol.mlb.semi.harris.com (Don Lewis) writes: > >There is also an environment variable "HOSTALIASES" that you can set >to a file name that contains aliases for hosts and the actual host >names. You could put "mailhost whatever" in a file, and set the >HOSTALIASES variable before starting sendmail. This feature allows users >to define their own host aliases as well (it'll probabably break things >if users uses these aliases in mail addresses unless the addresses are >somehow canonicalized). This appears to be undocumented in the Sun >man pages. I found out about it by looking at the Berkeley code and >doing a strings on Sun's libresolve.a. If you are smart you won't even try this. The ability to do this is a bug. The IDA sendmail sources, for example, unsetenv('HOSTALIASES') to prevent this. The problem is that it is terribly unreliable. Mail that comes in over the network uses the HOSTALIASES set before the daemon was started. Mail that is created by a local user depends on the HOSTALIASES set by that user. But if the mail can't immediately go out it is queued, and the next try it depends on the HOSTALIASES of the daemon again. For UUCP mail the value of HOSTALIASES will depend on whether the connection was started by cron, by a remote dial in, or by a local user issuing a 'uucp' command. The real secret for 'mailhost' is that the name is encoded right inside 'sendmail.cf'. Just edit 'sendmail.cf', and change 'mailhost' to the fully qualified domain name of the mail host. The rebuild the freeze file with 'sendmail -bz' (if you use a freeze file). Finally kill and restart the sendmail daemon. -- =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= Neil W. Rickert, Computer Science Northern Illinois Univ. DeKalb, IL 60115 +1-815-753-6940