Technical article 107682

How can I configure sendmail to use the hostresorder local bind functionality?

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4

Written · Last revised

Problem

Consider the following network:

Note: The ip addresses and names are purely arbitrary and used strictly for this example.

  196.0.0             209.230.108  domain name (mydomain.com)
     -                   _
     |   +-----+         |
.10  |---|     | .10     |
     |   |     |---------|
     |   +-----+         |
     |   midnight        |
     |                   |
     |                   |
     |                   |
     |                   |
     |   +-----+         |
.15  |---|     |         |
     |   |     |         -
     |   +-----+
     -    molly

The 196.0.0 network is a private, unregistered network and unknown to the Internet. There is no DNS running on the private network. All machines on this INTRANET connect via TCP/IP via /etc/hosts.

The 209.230.108 network is registered and known to the Internet. This network is using DNS to resolve ip to name and vice versa.

The 209.230.108.10 box (midnight) is a sendmail box. If it is
running OpenServer Enterprise System 5.0.0 or 5.0.2 you will need
to obtain the latest sendmail by obtaining Support Level Supplement
(SLS) OSS443A. This corrects all known security vulnerabilities (as
of CERT CA-97.05) and installs a newer version (8.8.5) of sendmail.
It will also allow the `hostresorder local bind' type of
functionality required for this networking configuration.

The goal is to allow the 209.230.108.10 box to be able to send mail to the 196.0.0.15 box (molly). In fact, it is desirable to have all mail destined for 209.230.108.10 to be forwarded to 196.0.0.15, and the sender to receive mail that it was received by the user on the registered domain, thus keeping the private network unknown. The sender will see that mail was received by <user@mydomain.com> with no reference to molly or the private domain.

Currently no mail is being forwarded to the 196.0.0.15. In addition, when trying to send mail directly from midnight to molly I receive error messages such as:

message is deferred: hostname lookup failure
OR:
transient parse error

Cause

sendmail is configured to use DNS by default. With this network
configuration sendmail is choking on DNS resolution within the
private network. Furthermore, we must configure sendmail to
route incoming mail to the 196.0.0.15 box.

Solution

First, configure sendmail to utilize the hostresorder local bind functionality that DNS can use when this entry is included in the /etc/resolv.conf. That is, check the /etc/hosts first and if it can resolve the ip-name or name-ip there, proceed. Otherwise, use DNS. Since our registered network is using DNS we cannot do away with this functionality altogether.

To do this, take these steps:
1. Install SLS OSS443A.

2. Edit /usr/lib/sendmail.cf and add the following entry immediately after the OPTIONS heading:

#Service.Switch to add hostresorder local bind functionality
O ServiceSwitchFile=/etc/service.switch

3. Now create a file called service.switch in the /etc directory. Add one line that reads:

hosts files dns

The permissions and owner/group on /etc/service.switch are:

chown bin:bin /etc/service.switch
chmod 644 /etc/service.switch

Next, configure sendmail to route all incoming mail to the 196.0.0.15 box and keep the private network secure from any sender. To do this, take these steps:

Edit the /usr/lib/sendmail.cf file. It is recommended that a copy be made before making any changes.

1. Find Ruleset 0 by searching for S0. Find the line that looks similar to the following:

R$* < @ [ $+ ] > S*        $#smtp $@ [$2] $: $1 < @ [2] > $3

Copy this line and comment out the first instance with a # sign. Edit the copied line so that your entry looks similar to the following:

#R$* < @ [ $+ ] > S*       $#smtp $@ [$2] $: $1 < @ [2] > $3
R$* < @ $D . > S*          $#smtp $@ molly.mydomain.com $: $1 < @ $D >

2. Search for an entry that looks similar or identical to this:

R$+        $#local $: $1   regular local names

Copy it and comment the first instance out with a # sign. Edit the copied line so that your entire entry looks like the following:

#R$+       $#local $: $1   regular local names
R$+        $#smtp $@ molly.mydomain.com $: $! < @ $D >

3. Finally, verify that you have an entry at the top of your file that looks like the following:

# Our local (e.g. LAN) domain name
DDmydomain.com

See also

_Sendmail_, by Bryan Costales with Eric Allman (O'Reilly & Associates, Inc.).

From the Xinuos technical article database, record 107682. Reproduced with permission. The original is at www.sco.com/ta/107682, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.