home *** CD-ROM | disk | FTP | other *** search
- .TL
- Sendmail Configuration Package UK-2.1
- .sp
- A Tutorial based on the Examples
- .AU
- Jim Crammond
- .AI
- Dept of Computing, Imperial College,
- University of London, England
- .AU
- Jem Taylor
- .AI
- Dept of Computing Science,
- University of Glasgow, Glasgow, Scotland
- .DA 27 November 1988
- .LP
- .NH
- Setup at the example site cs.glasgow.ac.uk
- .LP
- The site
- .I cs.glasgow.ac.uk
- has several dozen machines using the
- generic
- configuration 'slave' and two machines 'gateway' and 'uurelay' which
- have configurations of their own.
- We also generate configurations for two other
- glasgow sites which are each set up in a similar way.
- This database of domain and channel
- tables is therefore used to make a total of five different configurations.
- Tables basically fall into three categories:
- .DS L
- Tables used in all configurations (with prefix "glasgow.")
- Tables used in cs dept. configurations (with prefix "cs-dept.")
- Tables used in only one configuration (e.g. with prefix "uurelay.")
- .DE
- .LP
- These tables can be found in the Examples directory.
- The following notes will cover the three configurations used for
- .I cs.glasgow.ac.uk.
- The arrangement of data files also takes account of other configurations
- generated from them for other sites.
- .LP
- All users have entries in
- .I /usr/lib/aliases
- which is maintained centrally on the host that has the master copy of
- .I /etc/passwd
- and we ensure that all our users have accounts on that machine, though many have
- .I /bin/noaccount
- as their login shell.
- .KS
- .NH
- Site topology
- .DS I
-
- -
- |
- |-- gateway (janet relay, sendmail database master & alias database master)
- | +---> janet WAN including relays to overseas domains
- |
- |--
- e
- t--
- h
- e-- (dozens of) 'slave's
- r
- n--
- e
- t--
- |
- |
- |-- uurelay (uucp relay & news)
- | +---> uucp neighbours
- -
-
- .DE
- .'have to use a vertical backbone so that troff can draw the diagram properly.
- .KE
- .NH
- The generic configuration 'slave'
- .LP
- The
- .I slave
- configuration is used on all machines which have only an ethernet connection.
- This includes two sun fileservers and their clients.
- The client workstations all mount /usr/spool/mail from
- their respective servers. Users with mailboxes on these machines have
- entries in /usr/lib/aliases pointing to the fileservers so that
- mail delivery is always done by the server.
- .SH
- Note
- .IP
- This is only safe if the NFS implementation supports flock() properly, as
- SUNs after version 3.4 SunOS, and 4.3BSD systems appear to do. Check your
- documentation.
- .LP
- The configuration itself is quite minimal, containing enough information
- to send mail directly to internal hosts but passing all "unknown" addresses
- to 'gateway' to resolve.
- .LP
- .KS
- .NH 2
- The configuration description 'config.slave'
- .DS I
- # basic settings
- config=slave
- domain="cs.glasgow.ac.uk"
- options=multihost,nrsformat
- postmaster=mailer-daemon
- tabledir=tables
-
- # domain tables
- domain std file="cs-dept.ether.chn"
- domain top file="slave.top.dom"
-
- # channels
- channel top file="slave.top.chn"
- channel local file="cs-dept.local.chn",
- showldomain,shownrs,showuucp
- channel ether file="cs-dept.ether.chn"
- channel ether file="cs-dept.uucp.chn"
- channel news file="cs-dept.news.chn",relayed
- .DE
- .KE
- .LP
- Taking the lines one by one:
- .SH
- config=slave
- .LP
- The name of the configuration is 'slave'.
- The result of running 'make' will be a file named 'slave.cf'.
- .SH
- domain="cs.glasgow.ac.uk"
- .LP
- The domain name of the site is
- .I "cs.glasgow.ac.uk" .
- Unless otherwise specified, mail leaving the site will be marked
- .I "From: user@cs.glasgow.ac.uk" .
- .SH
- options=multihost,nrsformat
- .LP
- The configuration is for a 'multihost' site - more than one host will
- show itself to the outside world with the same site domain name.
- The host specific domain name is `hostname`.cs.glasgow.ac.uk
- but no-one outside the site will be aware of it.
- .LP
- The configuration will recognise addresses with domains in the JNT
- sponsored NRS domain order - e.g.
- .I user@uk.ac.glasgow.cs .
- .SH
- postmaster=mailer-daemon
- .LP
- When sending error messages, sendmail will stamp them
- .I "From: mailer-daemon" .
- To prevent error loops, messages
- .I "To: mailer-daemon"
- should not be allowed to cause error messages themselves.
- There must therefore be an alias in
- .I /usr/lib/aliases
- to send such mail to someone.
- .SH
- tabledir=tables
- .LP
- We keep the domain and channel tables for all configurations in one
- directory called "tables" - you will find this directory in the Examples
- directory.
- .SH
- domain std file="cs-dept.ether.chn"
- .LP
- The list of domains for local hosts are stored in this file (named relative
- to tabledir).
- Note that the same file is also used for the ether channel, since all local
- hosts are directly reachable on the ethernet.
- .SH
- domain top file="slave.top.dom"
- .LP
- This contains the top domain data. In fact it contains just the one line
- .DS
- uk
- .DE
- .LP
- since these machines send all mail that they cannot deliver to 'gateway'.
- .SH
- channel top file="slave.top.chn"
- .LP
- This file contains the one line
- .DS
- ALL gateway.cs.glasgow.ac.uk
- .DE
- .LP
- which sends all unrecognised domains to the domain
- .I "gateway.cs.glasgow.ac.uk" ,
- for which there is an entry in
- .I cs-dept.ether.chn .
- The domain recognition is thus centralised on the machine 'gateway',
- with slave machines only containing local information.
- .LP
- The advantage of doing this is that the slave configuration only needs
- to be updated when new machines arrive (or disappear) locally on the
- ethernet. The disadvantage is that the slaves can not recognise obvious
- mistakes in addresses - all rubbish will be sent to 'gateway' where it
- gets rejected.
- .SH
- channel local file="cs-dept.local.chn", showldomain, shownrs, showuucp
- .LP
- This file contains the site domain name and host specific domain name, thus:
- .DS
- cs.glasgow.ac.uk
- LHOST.cs.glasgow.ac.uk
- .DE
- .LP
- Since this file is shared with other configurations, it also contains some
- obselete names which still occur from time to time (e.g.
- .I glasgow.uucp ).
- .LP
- Some channel-specific options are specified:
- .I 'showldomain'
- causes the local site domain name to be put on messages sent locally,
- so that mail from another user is delivered with
- .I "From: user@cs.glasgow.ac.uk"
- rather than
- .I "From: user" ;
- .I 'shownrs'
- causes message headers to have NRS domain order, so that the message is in
- fact delivered with
- .I "From: user@uk.ac.glasgow.cs" ;
- .I 'showuucp'
- uses a heuristic to detect uucp style paths in headers. If an address
- contains several one-word site names, it is presented as a uucp style bang
- path, so that e.g.
- .IP
- From: bill%tipsy%mumps@illvax
- .LP
- will be re-written as
- .IP
- From: illvax!mumps!tipsy!bill
- .SH
- channel ether file="cs-dept.ether.chn"
- .LP
- The domains listed in this file are accessible by ethernet.
- This is the same file as is used for internal domain data above.
- .SH
- channel ether file="cs-dept.uucp.chn"
- .LP
- We have a second ether channel table containing those few NRS names
- which are actually uucp sites connected to uurelay. These contain
- the domain name of the uucp site and 'uurelay' as the host to send to.
- .SH
- channel news file="cs-dept.news.chn",relayed
- .LP
- The "usernames" described in this file are taken to represent newsgroup names,
- so that (for example) mail which
- is addressed to a local user called "comp.mail.sendmail" is sent to the
- news channel. Since there are hundreds of newsgroups, we use wildcards
- to match just the top level newsgroup names, e.g.
- .DS
- comp.%s uurelay
- .DE
- .LP
- The
- .I 'relayed'
- option indicates that
- .I mail-news
- is to be invoked on a different host, in this case 'uurelay'.
- We run news on 'uurelay' and mount its /usr/spool/news filesystem on all
- the other hosts using NFS (mounted soft,read-only to prevent hanging).
- On all the other machines
- .I inews(1)
- is a shell script containing
- .DS I
- #!/bin/sh
- /usr/hosts/uurelay $0 $@
- .DE
- .NH 2
- Installing the configuration file
- .LP
- Since this is a shared configuration, we have a shell script to
- call the program
- .I Install.sh
- for each 'slave' host. In the case of the sun fileservers, Install.sh
- is invoked with the -f option that prevents a freeze file
- (/usr/lib/sendmail.fc) from being created; on the client machines we only
- wish to restart the daemons, so we use the -n option, thus we have:
- .DS I
- sh Install.sh -f sun1 slave.cf
- sh Install.sh -n sun2 slave.cf
- sh Install.sh -n sun3 slave.cf
- etc . . .
- .DE
- .NH 2
- Shared system mailboxes
- .LP
- As mentioned above, the client workstations mount /usr/spool/mail from
- their NFS fileservers. At glasgow we go one stage further and only run
- sendmail SMTP listeners on the servers.
- Sendmail daemons on the client machines are started with
- .DS
- /usr/lib/sendmail -q1h
- .DE
- .LP
- The names of these clients are not in the ether channel or local domain
- tables because no mail is ever delivered to them - no user has an alias
- pointing to any such machine and, of course, the
- .I 'multihost'
- option ensures that mail sent from these machines contain the site domain name
- in the from address.
- .LP
- The same configuration runs on the NFS servers which can deliver mail locally;
- on these servers the sendmail daemon is started with
- .DS
- /usr/lib/sendmail -q1h -bd
- .DE
- .LP
- in the usual way.
- .NH
- The configuration 'gateway'
- .LP
- The host
- .I gateway
- has access to the ethernet and also has access to JANET, the X.25 based
- UK academic network.
- This configuration uses a number of domain tables derived from the NRS
- (Name Registration Scheme) database. These are produced automatically
- by the
- .I c-nrs
- program (provided with unix-niftp package). For example, the
- .I "uk.dom"
- domain table maps institution names to full domain names, with entries
- like:
- .DS
- glasgow glasgow.ac.uk
- .DE
- .LP
- Many sites in the NRS have an abbreviated (or short) name and
- standard (or long) name, which are different. For example, the
- short form for
- .I cs.glasgow.ac.uk
- is
- .I cs.gla.ac.uk .
- Some sites like to rewrite one form into the other (e.g. convert all
- addresses into standard form) and c-nrs provides
- a table in which to do this. However, with 300+ entries, this is
- probably only advisable with IDA sendmail where the table can be
- compiled to an IDA database.
- .LP
- Similarly, there are essentially two ways to set up the janet channel table
- depending on how much you want sendmail to do, and how much you leave
- to the FTP system to do:
- .IP (a)
- use just wildcards to effectively pass all (unmatched)
- uk.ac and uk.co addresses to the FTP system for "routing".
- The unix-niftp system has its own NRS database (using dbm lookup).
- Local overrides, for example, known uk.co sites which are not NRS
- registered could be placed in the FTP tables or the janet channel table.
- .IP (b)
- Put all entries into the janet channel (with no wildcards).
- This has the advantages that verification of addresses is done by
- sendmail directly and that where application relays are involved
- the JNT header includes the relay domain (minor point).
- However, addresses should be mapped to
- a single form in the domain tables so that only one entry is needed
- per host in the channel table. Again, this approach is probably only
- advisable with IDA sendmail where both the domain and channel tables
- can be compiled to ida databases, otherwise your sendmail may run
- rather slowly.
- .NH 2
- The configuration description 'config.gateway'
- .DS I
- #basic settings
- config=gateway
- domain="cs.glasgow.ac.uk"
- options=multihost,nrsformat
- postmaster=mailer-daemon
- install=-f
- tabledir=tables
-
- # domain tables
- domain std file="cs-dept.ether.chn"
- domain std file="glasgow.uk.dom" # generated by c-nrs
- domain std file="glasgow.gla.dom" # generated by c-nrs
- domain std file="glasgow.local.dom"
- domain std file="glasgow.ukuucp.dom"
- domain top file="glasgow.top.dom"
-
- # channels
- channel local file="cs-dept.local.chn",
- showuucp,shownrs,showldomain
- channel ether file="cs-dept.ether.chn"
- channel ether file="cs-dept.uucp.chn"
- channel news file="cs-dept.news.chn",relayed
- channel janet file="gateway.janet.chn",auth
- channel top file="glasgow.top.dom"
- .DE
- .LP
- There are some notable differences from the 'slave' configuration:
- .SH
- install=-f
- .LP
- This configuration can be installed by "make install". The -f flag
- prevents a frozen configuration file (sendmail.fc) from being made
- when doing this.
- .SH
- Domain tables
- .LP
- The domain tables include two NRS derived tables for mapping subdomains
- of "ac.uk", "co.uk" and "glasgow.ac.uk" to full domains.
- In addition there is a domain table for mapping uucpnames of hosts connected
- to glasgow (via uurelay) to their NRS names, and another with names of hosts
- within the university but not on our ethernet and not in the NRS either.
- .LP
- The file
- .I glasgow.top.dom
- contains a complete list of top level domains that we recognise.
- .SH
- Channel tables
- .LP
- The janet channel table we use contains wildcards, with a few entries
- for local overrides - we run vanilla BSD4.3 sendmail.
- .LP
- The janet channel also has the
- .I auth
- directive to cause the mailer for that channel to be invoked via
- .I authorise(8)
- allowing restrictions to be placed on users of the channel. See the
- .I
- User Guide
- .R
- and the manual page for
- .I authorise
- in the
- .I Manual
- directory for more details.
- .LP
- The top channel table is the same as the top domain table, specifying
- relays for the various top level domains; for example, sending all
- NIC based domains like
- .I "edu"
- and
- .I "com"
- to
- .I nss.cs.ucl.ac.uk .
- .LP
- Although there is an entry for
- .I "uk"
- in this table, it is never used because of the wildcards that match all
- possible uk addresses in the janet channel table.
- If we used IDA sendmail with a complete database of uk domains in the
- janet channel, then we need a separate top channel table with no entry
- for
- .I uk -
- this avoids relaying invalid addresses elsewhere.
- .NH 2
- The configuration description 'config.uurelay'
- .LP
- The host
- .I uurelay
- has the news system and is the uucp relay.
- It also has all the domain tables as well, as it's a MIPS/1000 and has lots
- more spare CPU cycles than 'gateway'.
- .DS I
- # basic settings
- config=uurelay
- domain="cs.glasgow.ac.uk"
- options=multihost,nrsformat
- postmaster=mailer-daemon
- install=-f
- tabledir=tables
-
- # domain tables
- domain std file="cs-dept.ether.chn"
- domain std file="glasgow.uk.dom" # generated by c-nrs
- domain std file="glasgow.gla.dom" # generated by c-nrs
- domain std file="glasgow.local.dom"
- domain std file="glasgow.ukuucp.dom"
- domain top file="glasgow.top.dom"
-
- # channels
- channel local file="cs-dept.local.chn",
- shownrs,showuucp,showldomain
- channel uucp file="uurelay.uucp.chn",
- ldomain="glasgow.uucp",
- sysname="glasgow",muucp
- channel ether file="cs-dept.ether.chn"
- channel news file="uurelay.news.chn"
- channel top file="uurelay.top.chn"
- .DE
- .LP
- This description shows the use of the uucp channel.
- Messages sent by UUCP will have the
- local domain name faked as "glasgow.uucp" instead of "cs.glasgow.ac.uk";
- the UUCP system name is 'glasgow'; the UUCP mailer is
- .I muucp
- instead of
- .I uux(1) .
- .LP
- The news channel uses a file specific to this host, because on this host
- messages for the news are to be delivered rather than forwarded.
-