[svlug] Sendmail Frustrations

Seth David Schoen schoen at uclink4.berkeley.edu
Sun Nov 1 22:43:59 PST 1998


Tom Harincar writes:

> Hi folks:
> 
> I have been struggling with Sendmail (RH 5.1) for several days now... I have
> a small network here at home (no gateways - no internet connection) with
> which I am able to send and receive mail on a single machine but not to any
> other connected machine.  Sendmail is running and, according to the Redhat
> install docs, the default sendmail.cf is ready to work for most smtp only
> sites.
> 
> Here are my dumb questions:
> 
> _In general, how is Sendmail supposed to find the host address information
> it needs?

The default for SMTP is to use DNS.  In particular, sendmail will _not_
respect your /etc/hosts, which can be annoying.  It will function as an
ordinary resolver client which needs to talk to a DNS server, and which will
believe what (and only what) that server tells it.

That means in particular that you probably need to have BIND running
on at least one machine on your network if you want to use sendmail with
TCP/IP and not just for local mail delivery (within one machine).  If you
will ever need sendmail to resolve a domain name, you'll need BIND, and
you'll need to point your resolver at that copy of BIND, so:
 
> _Does DNS first need to be properly configured before Sendmail will work
> properly?

Yes.

> Can this be done simply wth a resolve.cfg file?

Yes, except that this file is called resolv.conf. :-)

sendmail will use its resolver, which reads resolv.conf, to find a DNS
server, and use that server to resolve hostnames.

If you do want sendmail to use /etc/hosts, there is a HostsFile option to
make it do so.  You may, however, need to set the ServiceSwitchFile first,
to explain the precedence of the various means of resolving hostnames.
(_sendmail_, p. 713.)  The default on Red Hat and elsewhere that I've seen
is simply not to use /etc/hosts at all.

To make a ServiceSwitchFile, create a file containing the line

mail dns hosts

or just

mail hosts

-- perhaps called /etc/service.switch.  Then set the sendmail
ServiceSwitchFile option to point at this file.  Then set your HostsFile to
point at /etc/hosts (which is apparently the default value for this option
anyway).
 
> _What about sendmail.cw - where does this fit in?

sendmail.cw is a list of valid names for the host running sendmail (host names
which should be considered local to that machine).  If you want to accept mail
for a local or virtual user on the machine running sendmail, and that mail
is going to be address to a user at some.fqdn, you need to list "some.fqdn" in
sendmail.cw (unless some.fqdn can be found (by a reverse DNS lookup?) to
be the name of the local host).

If you do not list all the names of that machine in sendmail.cw (or in the
class "w" (hence the name!) in sendmail.cf, you may get errors like "Config
error: mail loops back to me?".
 
> _I would like not to have to run m4 - is this OK or do I need to?

That's OK, if you're willing to edit /etc/sendmail.cf.
 
> _Does a particular machine need to be designated as a mail gateway?

Not necessarily.  If all your mail is internal, then you'll never have a
delivery request that you can't resolve yourself.  However, if you want to
have a "mail hub" (not necessarily the same as a "mail gateway"), you can
instruct other machines to forward to it.  You'd probably do this using
the "DS" sendmail define:

DScleverhost.mynetwork

What cleverhost then does with the mail is up to you.  It might deliver it
_all_ locally (by any of several means, the simplest being telling it in
/etc/sendmail.cw that it "is" each of the machines for which it receives
mail, so that all mail to them ends up being considered local).  Or it
might (by virtue of having access to a sufficiently knowledgeable DNS
server) try to deliver the mail back to the individual hosts it's addressed
to -- which I assume would be clever enough to recognize the mail as local
when it arrived, the DS define notwithstanding.
 
> _Is there a good explanation of basic Sendmail configuration which does not
> assume to high a level of basic knowledge of related issues?

Not really.  That's one reason many people hate sendmail. :-)

"http://www.sendmail.org/" has some basic tutorials on various topics.

-- 
   Seth David Schoen L&S '01 (undeclared) / schoen at uclink4.berkeley.edu
He said, "This is what the king who will reign over you will do."  And they
said, "Nay, but we will have a king over us, that we also may be like all the
nations." (1 Sam 8)  http://ishmael.geecs.org/~sigma/   http://www.loyalty.org/

--
echo "unsubscribe svlug" | mail majordomo at svlug.org
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ to unsubscribe



More information about the svlug mailing list