home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
LINUX
/
HOWTO
/
mini
/
smuucp.txt
< prev
next >
Wrap
Text File
|
1997-07-07
|
12KB
|
353 lines
Linux Sendmail+UUCP Mini HOWTO
by Jamal Hadi Salim (jamal@glcom.com)
v1.2, 15 March 1996
History:
-------
Initial edition July/96: works only with non-bind edition of sendmail
Update Oct 01 /96: works with the redhat supplied binary
Update Oct 07 /96: added/modified a tip on how to compile non-bind sendmail
Update Oct 25 /96: added/modified a tip on how to keep sendmail
getHostbyAddr() happy via a dummy /etc/hosts entry
update Mar 15 /97: I am amazed at the response/feedback i am
receiving so i decided to refine this further. Fixed some small errors;
added diagram + references.
After finally settling down and properly reading TFM (the Bat Book,
to be precise) i have solved the Caramilk secret! The steps below
will work with the binary supplied by RedHat. Perhaps i should
send this tip to the maintainer of the Sendmail FAQ too since there
is absolutely no mention of it.
What this Document tries to show you
------------------------------------
How to setup a single machine, reffered to as me.com in the
example, with no direct access to the internet to route mail for you
via sendmail and UUCP to a 'smarter host' eg your ISP.
Optionally you can configure this machine to feed other
machines i.e you are their 'smart' host or gateway.
What this Document does not tell you
------------------------------------
I have been receiving incredible number of questions regarding the
following topics. The purpose of this document is not to describe
them so please try not send me any questions on the following:
a) how to setup UUCP. Refer to many fine references on this,
including:
- UUCP HOWTO (Vince Skahan, <vince@halcyon.com>)
- Using and managing UUCP (Ed Ravin et al -- publisher O'reilly)-- THE BEST
- Linux Network Administrator Guide (Olaf Kirch)
b) how to setup DNS. Refer to the many fine references on this,
including:
- Caching named mini howto (Nicolai Langfeldt)
- The bat book (Sendmail;Costalles, Allman, Rickert;publisher O'reilly)
- DNS and BIND (Publisher O'reilly)
- TCP/IP Network Administration (Hunt, Craig;Publisher O'reilly)
- Linux Network Administrator Guide (Olaf Kirch)
- sendmail Theory and Practice (Avolio and Vixie; publisher Digital press)
c) how to setup databases (other than the mailertable) to work with
sendmail. Refer to the many fine references on this,
including:
- The bat book (Sendmail;Costalles, Allman, Rickert -- publisher O'reilly)
- TCP/IP administration (Publisher O'reilly)
- sendmail Theory and Practice (Avolio and Vixie; publisher Digital press)
- docs bundled with sendmail
d) how to write or modify rulesets or mailers.
- All the above references (in c)
You can also find help on the following newsgroups:
- comp.mail.sendmail
- comp.mail.uucp
- comp.os.linux.networking
IRC channels
- #linux, #unix
THE SETUP:
---------
This is for a system whose mail is sent out only via UUCP.
mysmarthost is the ISPs hostname as set up in the uucp sys file
and me.com is the hostname we use. mysmarthost hooks to the
internet. We really dont care how it does it, we just know it
knows how to get us there.
me.com, whose setup we describe in the example, feeds sites down.com
and system1.org and their subnodes.
me.com connects to down.com via TCP/IP and connects to system1.org via
raw UUCP using a phone line.
The setup description is shown below.
------------------------
| |
| Internet |
| |
-----------------------
|
| PPP/dedicated line running TCP-IP
|
-------------
| |
|mysmarthost | Authoritative name server for
| | *.me.com, *.down.com, *.system1.org
| |
--------------
|
| UUCP via a phone line receive for
| system1.org, *.system1.org,*.down.com, down.com
| as well as me.com and *.me.com
------------
| * ***** * |
------------ | * me.com * | ------
| * * | |
| | * ***** * | |
| ------------ |
|UUCP via phone line | uucp via TCP/IP
| |
----------- -----------
| | | |
|system1.org| | down.com |-------
| | | | |
---------- ------------ |
| |
| |
| | LAN: smtp to nodes
| UUCP phone line
| |
----------- -------------
| | | |
|system1's| | down's |
|subnodes | | LAN |
| | ------------
----------
pre-requisites
==============
1) If you are on a machine using uucp for mail then you dont really need to
compile bind/resolv into sendmail;
How to survive name canonicalization on a estand-alone machine with no DNS
--------------------------------------------------------------------------------
PART I:
------
If you get a pre-compiled sendmail with BIND in it you
can still live with it (As is the case with Redhat supplied sendmail).
a) Refer to my solution for this based on the m4 file described (my
favorite). Try to use this option unless you really insist on b) or c)
below
OR
b)If you talk to me i could supply you with a non-BIND compiled version (8.8.5).
Perhaps RedHat should consider supplying two sendmail binaries (like slakware)
One with BIND and the other with no BIND.
OR
c) The quickest solution to get sendmail with no bind is to edit src/conf.h
lines below to read as i have shown:
conf.h:# ifndef NAMED_BIND
conf.h:# define NAMED_BIND 0 /* use Berkeley Internet Domain Server */
AND
PART II:
-------
Sendmail would however normally insist on doing name look ups to resolve
the host part using gethostbyaddr() for each email it sends (even if you tell
it not to canonify names).
a) use an RFC1597 IP address (10.0.0.0-10.255.255.255,
172.16.0.0-172.31.255.255, 192.168.0.0-192.168.255.255)
Edit /etc/hosts and add the following as a sample
for the host myhost
10.0.0.1 myhost.me.com myhost
or
b) If you use NIS (and NIS is compiled into sendmail as seems to be the case in
Redhat. Redhat also has NIS built in)
make sure the /etc/nsswitch.conf file contains:
hosts: files dns
and in /etc/hosts and add the following as a sample for the host myhost
[again using RFC1597 IP addressing scheme]
10.0.0.1 myhost.me.com myhost
NOTE:
----
In both a) and b) above it is critical that you list the long (fully qualified)
in the /etc/hosts file used.
i.e the line should read
10.0.0.1 myhost.me.com myhost
and NOT
10.0.0.1 myhost
you will also need to define the sendmail $w macro to hold myhost.me.com
add the Following line to your /etc/sendmail.cf after it is generated
Dwmyhost.me.com
(or you can use MASQUAREADE_AS(myhost.me.com) in the .mc below)
NOTE!!!!! myhost as a domain name is given as an example; you dont
have to use it as is. Pick your own hostname if you dont have one
already.
--------------------------------------------------------------------------------
2) Ensure that you have makemap and it is capable of supporting
hash and or the more common dbm format or even btree format
(The Redhat version does not support dbm). Makemap is normaly distributed with
sendmail.
SETUP
--------------------------------------------------------------------------------
1) create your .mc file using your favorite editor; i'll call this file
my.mc
============== file my.mc =======================
include(`../m4/cf.m4')
VERSIONID(`me.com's setup with uucp created by xxxx')dnl
OSTYPE(linux)
FEATURE(nodns)dnl
FEATURE(nocanonify)dnl
FEATURE(always_add_domain)dnl
FEATURE(mailertable, hash /etc/mailertable)dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(uucp)
define(`SMART_HOST', uucp-dom:mysmarthost)
===============================================
Let's dissect this:
include(`../m4/cf.m4')
requests for the m4 macro found in ../m4/cf.m4 to be include
to resolve some things
VERSIONID(`me.com's setup with uucp created by xxxx'