Sendmail + UUCP HOWTOAuthor: Jamal Hadi Salim (firstname.lastname@example.org or email@example.com)
After finally settling down and properly reading TFM (the Bat Book,
to be precise) i have solved the Caramilk secret! The steps below have
been tested 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 UUCP interworking with sendmail there.
What this Document tries to show youHow 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 youI have been receiving incredible number of questions regarding topics which are beyond the focus of this HOWTO. 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:
b) how to setup DNS.Refer to the many fine references on this, including:
c) how to setup databases (other than the mailertable) to work with sendmail.Refer to the many fine references on this, including:
THE SETUPThis is for a system, hypothecally named me.com, 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 or are known by in the MX records on the internet.
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-requisites1) If you are already running DNS or have a pointer to a DNS server (in your /etc/resolv.conf) and are on a live connection to the net then skip this part. You are safe. You dont have to do any 'smart' thing skip to 2)
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 stand-alone machine with no DNSPART 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:
# ifndef NAMED_BIND conf.h:# define NAMED_BIND 0 /* use Berkeley Internet Domain Server */
a) use an RFC1597 IP address (10.0.0.0-10.255.255.255, 172.16.0.0-172.31.255.255,
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
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
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 (the mc file)I) create your .mc file using your favorite editor; i'll call this file my.mc
a) No DNS -- standalone
VERSIONID(`me.com's setup with uucp created by xxxx --no dns ')
FEATURE(mailertable, hash /etc/mailertable)dnl
Let's dissect this:
me.com is not connected to the net via tcp/ip so it is safe
b) DNS on
VERSIONID(`me.com's setup with uucp created by xxxx --dns enabled')dnl
FEATURE(mailertable, hash /etc/mailertable)dnl
II) create your sendmail.cf filea) backup your old /etc/sendmail.cf file
b) overwrite the sendmail.cf with the new one: m4 my.mc > /etc/sendmail.cf
c) verify that the sendmail.cf file was correctly created based on your specifications.
Some of the gotchas that i came across were: - missing uucp-dom mailer This was because i didnt have the smtp mailer entry. Actually, i understand it is important to have it defined before the uucp
III) create your /etc/mailertableif you dont have uucp sites feeding off you skip this step
a) create/edit the file /etc/mailertable
This says anything that is addressed to system1.org or to *.system1.org
that we receive will be sent using the uucp-dom mailer and be
delivered to system1 (defined in the the uucp sys file) in
other words we are doing the mail routing for *.system1.org ; similar
for down.com and its subnodes except for the additional filtering;
we bounce back any mail for down's subnode up.down.com using sendmail's
built-in error mailer with the message "Host is unknown at
me.com"; This is because we have been asked to do this by the admin
at down.com. To bounce unknown subdomains to us we use the last
line in the mailertable (which is what all unknown nodes default to).
if you use hash:
do this every time you change the file.
IV) restart sendmail
V) test sendmaili) sendmail -bv user@destination
ii) using sendmail -bt and enter various addresses using 3,0
ruleset to see where they end up and the various rulesets and cf walks taken.
You are set!
1) Add info on setting up system down.com (so as to show how to