home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / uk-sendmail2.1 / Docs / Tutorial.ms < prev    next >
Encoding:
Text File  |  1991-06-11  |  14.6 KB  |  497 lines

  1. .TL
  2. Sendmail Configuration Package UK-2.1
  3. .sp
  4. A Tutorial based on the Examples
  5. .AU
  6. Jim Crammond
  7. .AI
  8. Dept of Computing, Imperial College,
  9. University of London, England
  10. .AU
  11. Jem Taylor
  12. .AI
  13. Dept of Computing Science,
  14. University of Glasgow, Glasgow, Scotland
  15. .DA 27 November 1988
  16. .LP
  17. .NH
  18. Setup at the example site cs.glasgow.ac.uk
  19. .LP
  20. The site
  21. .I cs.glasgow.ac.uk
  22. has several dozen machines using the 
  23. generic
  24. configuration 'slave' and two machines 'gateway' and 'uurelay' which
  25. have configurations of their own.
  26. We also generate configurations for two other 
  27. glasgow sites which are each set up in a similar way.
  28. This database of domain and channel
  29. tables is therefore used to make a total of five different configurations.
  30. Tables basically fall into three categories:
  31. .DS L
  32. Tables used in all configurations (with prefix "glasgow.")
  33. Tables used in cs dept. configurations (with prefix "cs-dept.")
  34. Tables used in only one configuration (e.g. with prefix "uurelay.")
  35. .DE
  36. .LP
  37. These tables can be found in the Examples directory.
  38. The following notes will cover the three configurations used for
  39. .I cs.glasgow.ac.uk.
  40. The arrangement of data files also takes account of other configurations
  41. generated from them for other sites.
  42. .LP
  43. All users have entries in
  44. .I /usr/lib/aliases
  45. which is maintained centrally on the host that has the master copy of
  46. .I /etc/passwd
  47. and we ensure that all our users have accounts on that machine, though many have
  48. .I /bin/noaccount
  49. as their login shell.
  50. .KS
  51. .NH
  52. Site topology
  53. .DS I
  54.  
  55.  -
  56.  |
  57.  |-- gateway (janet relay, sendmail database master & alias database master)
  58.  |        +---> janet WAN including relays to overseas domains
  59.  |
  60.  |--
  61.  e
  62.  t--
  63.  h
  64.  e-- (dozens of) 'slave's
  65.  r
  66.  n--
  67.  e
  68.  t--
  69.  |
  70.  |
  71.  |-- uurelay (uucp relay & news)
  72.  |       +---> uucp neighbours
  73.  -                                  
  74.  
  75. .DE
  76. .'have to use a vertical backbone so that troff can draw the diagram properly.
  77. .KE
  78. .NH
  79. The generic configuration 'slave'
  80. .LP
  81. The
  82. .I slave
  83. configuration is used on all machines which have only an ethernet connection.
  84. This includes two sun fileservers and their clients.
  85. The client workstations all mount /usr/spool/mail from
  86. their respective servers. Users with mailboxes on these machines have
  87. entries in /usr/lib/aliases pointing to the fileservers so that
  88. mail delivery is always done by the server.
  89. .SH
  90. Note
  91. .IP
  92. This is only safe if the NFS implementation supports flock() properly, as
  93. SUNs after version 3.4 SunOS, and 4.3BSD systems appear to do. Check your
  94. documentation.
  95. .LP
  96. The configuration itself is quite minimal, containing enough information
  97. to send mail directly to internal hosts but passing all "unknown" addresses
  98. to 'gateway' to resolve.
  99. .LP
  100. .KS
  101. .NH 2
  102. The configuration description 'config.slave'
  103. .DS I
  104. # basic settings
  105. config=slave
  106. domain="cs.glasgow.ac.uk"
  107. options=multihost,nrsformat
  108. postmaster=mailer-daemon
  109. tabledir=tables
  110.  
  111. # domain tables
  112. domain std file="cs-dept.ether.chn"
  113. domain top file="slave.top.dom"
  114.  
  115. # channels
  116. channel top file="slave.top.chn"
  117. channel local file="cs-dept.local.chn",
  118.         showldomain,shownrs,showuucp
  119. channel ether file="cs-dept.ether.chn"
  120. channel ether file="cs-dept.uucp.chn"
  121. channel news file="cs-dept.news.chn",relayed
  122. .DE
  123. .KE
  124. .LP
  125. Taking the lines one by one:
  126. .SH
  127. config=slave
  128. .LP
  129. The name of the configuration is 'slave'.
  130. The result of running 'make' will be a file named 'slave.cf'.
  131. .SH
  132. domain="cs.glasgow.ac.uk"
  133. .LP
  134. The domain name of the site is 
  135. .I "cs.glasgow.ac.uk" .
  136. Unless otherwise specified, mail leaving the site will be marked 
  137. .I "From: user@cs.glasgow.ac.uk" .
  138. .SH
  139. options=multihost,nrsformat
  140. .LP
  141. The configuration is for a 'multihost' site - more than one host will
  142. show itself to the outside world with the same site domain name.
  143. The host specific domain name is `hostname`.cs.glasgow.ac.uk
  144. but no-one outside the site will be aware of it.
  145. .LP 
  146. The configuration will recognise addresses with domains in the JNT
  147. sponsored NRS domain order - e.g.
  148. .I user@uk.ac.glasgow.cs .
  149. .SH
  150. postmaster=mailer-daemon
  151. .LP
  152. When sending error messages, sendmail will stamp them 
  153. .I "From: mailer-daemon" .
  154. To prevent error loops, messages 
  155. .I "To: mailer-daemon"
  156. should not be allowed to cause error messages themselves.
  157. There must therefore be an alias in 
  158. .I /usr/lib/aliases 
  159. to send such mail to someone.
  160. .SH
  161. tabledir=tables
  162. .LP
  163. We keep the domain and channel tables for all configurations in one
  164. directory called "tables" - you will find this directory in the Examples
  165. directory.
  166. .SH
  167. domain std file="cs-dept.ether.chn"
  168. .LP
  169. The list of domains for local hosts are stored in this file (named relative
  170. to tabledir).
  171. Note that the same file is also used for the ether channel, since all local
  172. hosts are directly reachable on the ethernet.
  173. .SH
  174. domain top file="slave.top.dom"
  175. .LP
  176. This contains the top domain data. In fact it contains just the one line
  177. .DS
  178. uk
  179. .DE
  180. .LP
  181. since these machines send all mail that they cannot deliver to 'gateway'.
  182. .SH
  183. channel top file="slave.top.chn"
  184. .LP
  185. This file contains the one line
  186. .DS
  187. ALL    gateway.cs.glasgow.ac.uk
  188. .DE
  189. .LP
  190. which sends all unrecognised domains to the domain 
  191. .I "gateway.cs.glasgow.ac.uk" ,
  192. for which there is an entry in 
  193. .I cs-dept.ether.chn .
  194. The domain recognition is thus centralised on the machine 'gateway',
  195. with slave machines only containing local information.
  196. .LP
  197. The advantage of doing this is that the slave configuration only needs
  198. to be updated when new machines arrive (or disappear) locally on the
  199. ethernet. The disadvantage is that the slaves can not recognise obvious
  200. mistakes in addresses - all rubbish will be sent to 'gateway' where it
  201. gets rejected.
  202. .SH
  203. channel local file="cs-dept.local.chn", showldomain, shownrs, showuucp
  204. .LP
  205. This file contains the site domain name and host specific domain name, thus:
  206. .DS
  207. cs.glasgow.ac.uk
  208. LHOST.cs.glasgow.ac.uk
  209. .DE
  210. .LP
  211. Since this file is shared with other configurations, it also contains some
  212. obselete names which still occur from time to time (e.g.
  213. .I glasgow.uucp ).
  214. .LP
  215. Some channel-specific options are specified: 
  216. .I 'showldomain'
  217. causes the local site domain name to be put on messages sent locally,
  218. so that mail from another user is delivered with
  219. .I "From: user@cs.glasgow.ac.uk"
  220. rather than 
  221. .I "From: user" ;
  222. .I 'shownrs'
  223. causes message headers to have NRS domain order, so that the message is in
  224. fact delivered with
  225. .I "From: user@uk.ac.glasgow.cs" ;
  226. .I 'showuucp'
  227. uses a heuristic to detect uucp style paths in headers. If an address
  228. contains several one-word site names, it is presented as a uucp style bang
  229. path, so that e.g.
  230. .IP
  231. From: bill%tipsy%mumps@illvax
  232. .LP
  233. will be re-written as
  234. .IP
  235. From: illvax!mumps!tipsy!bill
  236. .SH
  237. channel ether file="cs-dept.ether.chn"
  238. .LP
  239. The domains listed in this file are accessible by ethernet.
  240. This is the same file as is used for internal domain data above.
  241. .SH
  242. channel ether file="cs-dept.uucp.chn"
  243. .LP
  244. We have a second ether channel table containing those few NRS names
  245. which are actually uucp sites connected to uurelay. These contain
  246. the domain name of the uucp site and 'uurelay' as the host to send to.
  247. .SH
  248. channel news file="cs-dept.news.chn",relayed
  249. .LP
  250. The "usernames" described in this file are taken to represent newsgroup names,
  251. so that (for example) mail which 
  252. is addressed to a local user called "comp.mail.sendmail" is sent to the
  253. news channel. Since there are hundreds of newsgroups, we use wildcards
  254. to match just the top level newsgroup names, e.g.
  255. .DS
  256. comp.%s    uurelay
  257. .DE
  258. .LP
  259. The 
  260. .I 'relayed'
  261. option indicates that 
  262. .I mail-news
  263. is to be invoked on a different host, in this case 'uurelay'.
  264. We run news on 'uurelay' and mount its /usr/spool/news filesystem on all
  265. the other hosts using NFS (mounted soft,read-only to prevent hanging).
  266. On all the other machines 
  267. .I inews(1)
  268. is a shell script containing
  269. .DS I
  270. #!/bin/sh
  271. /usr/hosts/uurelay $0 $@
  272. .DE
  273. .NH 2
  274. Installing the configuration file
  275. .LP
  276. Since this is a shared configuration, we have a shell script to
  277. call the program
  278. .I Install.sh
  279. for each 'slave' host.  In the case of the sun fileservers, Install.sh
  280. is invoked with the -f option that prevents a freeze file
  281. (/usr/lib/sendmail.fc) from being created; on the client machines we only
  282. wish to restart the daemons, so we use the -n option, thus we have:
  283. .DS I
  284. sh Install.sh -f sun1 slave.cf
  285. sh Install.sh -n sun2 slave.cf
  286. sh Install.sh -n sun3 slave.cf
  287. etc . . .
  288. .DE
  289. .NH 2
  290. Shared system mailboxes
  291. .LP
  292. As mentioned above, the client workstations mount /usr/spool/mail from
  293. their NFS fileservers. At glasgow we go one stage further and only run
  294. sendmail SMTP listeners on the servers.
  295. Sendmail daemons on the client machines are started with
  296. .DS
  297. /usr/lib/sendmail -q1h
  298. .DE
  299. .LP
  300. The names of these clients are not in the ether channel or local domain
  301. tables because no mail is ever delivered to them - no user has an alias
  302. pointing to any such machine and, of course, the 
  303. .I 'multihost' 
  304. option ensures that mail sent from these machines contain the site domain name
  305. in the from address.
  306. .LP
  307. The same configuration runs on the NFS servers which can deliver mail locally;
  308. on these servers the sendmail daemon is started with
  309. .DS
  310. /usr/lib/sendmail -q1h -bd
  311. .DE
  312. .LP
  313. in the usual way.
  314. .NH
  315. The configuration 'gateway'
  316. .LP
  317. The host 
  318. .I gateway
  319. has access to the ethernet and also has access to JANET, the X.25 based
  320. UK academic network.
  321. This configuration uses a number of domain tables derived from the NRS
  322. (Name Registration Scheme) database. These are produced automatically
  323. by the
  324. .I c-nrs
  325. program (provided with unix-niftp package). For example, the 
  326. .I "uk.dom"
  327. domain table maps institution names to full domain names, with entries
  328. like:
  329. .DS
  330. glasgow    glasgow.ac.uk
  331. .DE
  332. .LP
  333. Many sites in the NRS have an abbreviated (or short) name and
  334. standard (or long) name, which are different. For example, the
  335. short form for 
  336. .I cs.glasgow.ac.uk
  337. is 
  338. .I cs.gla.ac.uk .
  339. Some sites like to rewrite one form into the other (e.g. convert all
  340. addresses into standard form) and c-nrs provides
  341. a table in which to do this. However, with 300+ entries, this is
  342. probably only advisable with IDA sendmail where the table can be
  343. compiled to an IDA database.
  344. .LP
  345. Similarly, there are essentially two ways to set up the janet channel table
  346. depending on how much you want sendmail to do, and how much you leave
  347. to the FTP system to do:
  348. .IP (a)
  349. use just wildcards to effectively pass all (unmatched)
  350. uk.ac and uk.co addresses to the FTP system for "routing".
  351. The unix-niftp system has its own NRS database (using dbm lookup).
  352. Local overrides, for example, known uk.co sites which are not NRS
  353. registered could be placed in the FTP tables or the janet channel table.
  354. .IP (b)
  355. Put all entries into the janet channel (with no wildcards).
  356. This has the advantages that verification of addresses is done by
  357. sendmail directly and that where application relays are involved
  358. the JNT header includes the relay domain (minor point).
  359. However, addresses should be mapped to
  360. a single form in the domain tables so that only one entry is needed
  361. per host in the channel table.  Again, this approach is probably only
  362. advisable with IDA sendmail where both the domain and channel tables
  363. can be compiled to ida databases, otherwise your sendmail may run
  364. rather slowly.
  365. .NH 2
  366. The configuration description 'config.gateway'
  367. .DS I
  368. #basic settings
  369. config=gateway
  370. domain="cs.glasgow.ac.uk"
  371. options=multihost,nrsformat
  372. postmaster=mailer-daemon
  373. install=-f
  374. tabledir=tables
  375.  
  376. # domain tables
  377. domain std file="cs-dept.ether.chn"
  378. domain std file="glasgow.uk.dom"    # generated by c-nrs
  379. domain std file="glasgow.gla.dom"    # generated by c-nrs
  380. domain std file="glasgow.local.dom"
  381. domain std file="glasgow.ukuucp.dom"
  382. domain top file="glasgow.top.dom"
  383.  
  384. # channels
  385. channel local file="cs-dept.local.chn",
  386.         showuucp,shownrs,showldomain
  387. channel ether file="cs-dept.ether.chn"
  388. channel ether file="cs-dept.uucp.chn"
  389. channel news file="cs-dept.news.chn",relayed
  390. channel janet file="gateway.janet.chn",auth
  391. channel top file="glasgow.top.dom"
  392. .DE
  393. .LP
  394. There are some notable differences from the 'slave' configuration:
  395. .SH
  396. install=-f
  397. .LP
  398. This configuration can be installed by "make install". The -f flag
  399. prevents a frozen configuration file (sendmail.fc) from being made
  400. when doing this.
  401. .SH
  402. Domain tables
  403. .LP
  404. The domain tables include two NRS derived tables for mapping subdomains
  405. of "ac.uk", "co.uk" and "glasgow.ac.uk" to full domains.
  406. In addition there is a domain table for mapping uucpnames of hosts connected
  407. to glasgow (via uurelay) to their NRS names, and another with names of hosts
  408. within the university but not on our ethernet and not in the NRS either.
  409. .LP
  410. The file
  411. .I glasgow.top.dom
  412. contains a complete list of top level domains that we recognise.
  413. .SH
  414. Channel tables
  415. .LP
  416. The janet channel table we use contains wildcards, with a few entries
  417. for local overrides - we run vanilla BSD4.3 sendmail.
  418. .LP
  419. The janet channel also has the
  420. .I auth
  421. directive to cause the mailer for that channel to be invoked via 
  422. .I authorise(8)
  423. allowing restrictions to be placed on users of the channel. See the
  424. .I
  425. User Guide
  426. .R
  427. and the manual page for
  428. .I authorise
  429. in the
  430. .I Manual
  431. directory for more details.
  432. .LP
  433. The top channel table is the same as the top domain table, specifying
  434. relays for the various top level domains; for example, sending all
  435. NIC based domains like 
  436. .I "edu"
  437. and 
  438. .I "com"
  439. to 
  440. .I nss.cs.ucl.ac.uk .
  441. .LP
  442. Although there is an entry for 
  443. .I "uk"
  444. in this table, it is never used because of the wildcards that match all
  445. possible uk addresses in the janet channel table.
  446. If we used IDA sendmail with a complete database of uk domains in the
  447. janet channel, then we need a separate top channel table with no entry
  448. for
  449. .I uk -
  450. this avoids relaying invalid addresses elsewhere.
  451. .NH 2
  452. The configuration description 'config.uurelay'
  453. .LP
  454. The host
  455. .I uurelay
  456. has the news system and is the uucp relay.
  457. It also has all the domain tables as well, as it's a MIPS/1000 and has lots 
  458. more spare CPU cycles than 'gateway'.
  459. .DS I
  460. # basic settings
  461. config=uurelay
  462. domain="cs.glasgow.ac.uk"
  463. options=multihost,nrsformat
  464. postmaster=mailer-daemon
  465. install=-f
  466. tabledir=tables
  467.  
  468. # domain tables
  469. domain std file="cs-dept.ether.chn"
  470. domain std file="glasgow.uk.dom"    # generated by c-nrs
  471. domain std file="glasgow.gla.dom"    # generated by c-nrs
  472. domain std file="glasgow.local.dom"
  473. domain std file="glasgow.ukuucp.dom"
  474. domain top file="glasgow.top.dom"
  475.  
  476. # channels
  477. channel local file="cs-dept.local.chn",
  478.         shownrs,showuucp,showldomain
  479. channel uucp file="uurelay.uucp.chn",
  480.         ldomain="glasgow.uucp",
  481.         sysname="glasgow",muucp
  482. channel ether file="cs-dept.ether.chn"
  483. channel news file="uurelay.news.chn"
  484. channel top file="uurelay.top.chn"
  485. .DE
  486. .LP
  487. This description shows the use of the uucp channel.
  488. Messages sent by UUCP will have the
  489. local domain name faked as "glasgow.uucp" instead of "cs.glasgow.ac.uk";
  490. the UUCP system name is 'glasgow'; the UUCP mailer is
  491. .I muucp
  492. instead of
  493. .I uux(1) .
  494. .LP
  495. The news channel uses a file specific to this host, because on this host
  496. messages for the news are to be delivered rather than forwarded.
  497.