doug@seismo.gps.caltech.edu (Doug Neuhauser) (10/12/89)
I have a problem with rewriting rules in my sendmail.cf file that is used with Sun's MX version of sendmail (under SunOS 4.0.3). When using Sun's YP and resolver libraries with utilities such as rlogin, telnet, and ftp, the YP apparently uses the "domain_name_search" capability of the name server in an attempt match hostnames. For example, if my domain is "gps.caltech.edu", and name_server lookup of name "foo" will first attempt to match "foo.gps.caltech.edu", and if that is unsuccessfull, it will attempt to match "foo.caltech.edu". I want my sendmail.cf to provide the same behaviour, e.g. have a hostname "foo" be expanded to "foo.gps.caltech.edu" if this host exists, or "foo.caltech.edu" if that host exists. If NEITHER exists, the name should get left as "foo" and will be trapped later on. I've tried the rule: R$*<@$->$* $:$1<@$[$2$]>$3 map through host file This will expand "foo" to "foo.gps.caltech.edu" if the name server finds a match, but it does NOT appear to perform a domain_name_search on the domain, trying "foo.caltech.edu". I then added the following rule and definition: DC caltech.edu R$*<@$->$* $:$1<@$[$2.$C$]>$3 map through host file If "foo.caltech.edu" is an alias, it will return the canonical name for the system, but if "foo.caltech.edu" does NOT exist, it leaves the name as "foo.caltech.edu". BTW, I also tried: R$*<@$%y>$* $:$1<@$[$2$]>$3 map through host file (where $%y maps it through the YP database) but this gets very confused. Since the YP name server support does "walk up" the tree, if "foo" matches "foo.caltech.edu" via the name server support in YP, the pattern will match, and SENDMAIL will try to map it "foo" through the name server, and will fail, which will leave the name as "foo". I know that I could abandon Sun's sendmail and use the latest and greatest from Berkeley, but I find some of the other Sun-specific stuff for YP support and remote-forwarding for remote-mounted mailboxes useful. Any ideas on how to solve this problem? ---------------------------------------------------------------------------- Doug Neuhauser Div. of Geological and Planetary Sciences doug@seismo.gps.caltech.edu California Institute of Technology 818-356-3993 MS 252-21, Pasadena, CA 91125