home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LINUX / HOWTO / mini / smuucp.txt < prev    next >
Text File  |  1997-07-07  |  12KB  |  353 lines

  1. Linux Sendmail+UUCP Mini HOWTO
  2. by Jamal Hadi Salim (jamal@glcom.com)
  3. v1.2, 15 March 1996
  4.  
  5. History:
  6. -------
  7. Initial edition July/96: works only with non-bind edition of sendmail
  8. Update Oct 01 /96: works with the redhat supplied binary
  9. Update Oct 07 /96: added/modified a tip on how to compile non-bind sendmail
  10. Update Oct 25 /96: added/modified a tip on how to keep sendmail
  11. getHostbyAddr() happy via a dummy /etc/hosts entry 
  12. update Mar 15 /97: I am amazed at the response/feedback i am
  13. receiving so i decided to refine this further. Fixed some small errors; 
  14. added diagram + references.
  15.  
  16. After finally settling down and properly reading TFM (the Bat Book,
  17. to be precise) i have solved the Caramilk secret! The steps below
  18. will work with the binary supplied by RedHat. Perhaps i should
  19. send this tip to the maintainer of the Sendmail FAQ too since there
  20. is absolutely no mention of it.
  21.  
  22. What this Document tries to show you
  23. ------------------------------------
  24. How to setup a single machine, reffered to as me.com in the
  25. example, with no direct access to the internet to route mail for you 
  26. via sendmail and UUCP to a 'smarter host' eg your ISP. 
  27. Optionally you can configure this machine to feed other
  28. machines i.e you are their 'smart' host or gateway.
  29.  
  30. What this Document does not tell you
  31. ------------------------------------
  32. I have been receiving incredible number of questions regarding the
  33. following  topics. The purpose of this document is not to describe
  34. them so please try not send me any questions on the following:
  35.  
  36. a) how to setup UUCP. Refer to many fine references on this,
  37. including:
  38. - UUCP HOWTO (Vince Skahan, <vince@halcyon.com>)
  39. - Using and managing UUCP (Ed Ravin et al -- publisher O'reilly)-- THE BEST
  40. - Linux Network Administrator Guide (Olaf Kirch)
  41. b) how to setup DNS. Refer to the many fine references on this,
  42. including:
  43. - Caching named mini howto (Nicolai Langfeldt)
  44. - The bat book (Sendmail;Costalles, Allman, Rickert;publisher O'reilly)
  45. - DNS and BIND (Publisher O'reilly)
  46. - TCP/IP Network Administration (Hunt, Craig;Publisher O'reilly)
  47. - Linux Network Administrator Guide (Olaf Kirch)
  48. - sendmail Theory and Practice (Avolio and Vixie; publisher Digital press)
  49. c) how to setup databases (other than the mailertable) to work with
  50. sendmail. Refer to the many fine references on this,
  51. including:
  52. - The bat book (Sendmail;Costalles, Allman, Rickert -- publisher O'reilly)
  53. - TCP/IP administration (Publisher O'reilly)
  54. - sendmail Theory and Practice (Avolio and Vixie; publisher Digital press)
  55. - docs bundled with sendmail
  56. d) how to write or modify rulesets or mailers.
  57. - All the above references (in c) 
  58.  
  59. You can also find help on the following newsgroups:
  60. - comp.mail.sendmail
  61. - comp.mail.uucp
  62. - comp.os.linux.networking
  63.  
  64. IRC channels
  65. - #linux, #unix
  66.  
  67.  
  68. THE SETUP:
  69. ---------
  70.  
  71. This is for a system whose mail is sent out only via UUCP.
  72. mysmarthost is the ISPs hostname as set up in the uucp sys file
  73. and me.com is the hostname we use. mysmarthost hooks to the
  74. internet. We really dont care how it does it, we just know it
  75. knows how to get us there.
  76. me.com, whose setup we describe in the example, feeds sites down.com 
  77. and system1.org and their subnodes.
  78. me.com connects to down.com via TCP/IP and connects to system1.org via
  79. raw UUCP using a phone line.
  80. The setup description is shown below.
  81.  
  82.     ------------------------
  83.     |                 |
  84.     |     Internet        |
  85.     |                 |
  86.     -----------------------
  87.                     |   
  88.             | PPP/dedicated line running TCP-IP
  89.             |
  90.                 -------------
  91.                 |            |
  92.                 |mysmarthost | Authoritative name server for 
  93.                 |            | *.me.com, *.down.com, *.system1.org
  94.                 |            |
  95.                 --------------
  96.                 |
  97.                 | UUCP via a phone line receive for 
  98.                 | system1.org, *.system1.org,*.down.com, down.com
  99.             | as well as me.com and *.me.com
  100.                  ------------
  101.                 | * *****  *  |
  102.    ------------    | * me.com *  | ------
  103.                 | *        *  |      |
  104.    |            | * *****  *  |      |
  105.    |             ------------        | 
  106.    |UUCP via phone line              | uucp via TCP/IP
  107.    |                                 |
  108.  -----------                  -----------
  109. |           |                |           |
  110. |system1.org|                | down.com  |-------
  111. |           |                |           |      |
  112.  ----------                  ------------       |
  113.      |                        |
  114.      |                        |
  115.      |                        | LAN: smtp to nodes
  116.      | UUCP phone line
  117.      |                        |
  118. -----------                     -------------
  119. |         |                   |           |
  120. |system1's|                   | down's    |
  121. |subnodes |                   | LAN       |
  122. |         |                   ------------
  123. ----------
  124.  
  125. pre-requisites
  126. ==============
  127. 1) If you are on a machine using uucp for mail then you dont really need to 
  128. compile bind/resolv into sendmail; 
  129.  
  130.  
  131. How to survive name canonicalization on a estand-alone machine with no DNS
  132. --------------------------------------------------------------------------------
  133. PART I:
  134. ------
  135. If you get a pre-compiled sendmail with BIND in it you 
  136. can still live with it (As is the case with Redhat supplied sendmail). 
  137.  
  138. a) Refer to my solution for this based on the m4 file described (my
  139. favorite). Try to use this option unless you really insist on b) or c)
  140. below
  141.  
  142. OR
  143.  
  144. b)If you talk to me i could supply you with a non-BIND compiled version (8.8.5).
  145. Perhaps RedHat should consider supplying two sendmail binaries (like slakware)
  146. One with BIND and the other with no BIND.
  147.  
  148. OR
  149.  
  150. c) The quickest solution to get sendmail with no bind is to edit src/conf.h 
  151. lines below to read as i have shown:
  152.  
  153. conf.h:# ifndef NAMED_BIND
  154. conf.h:#  define NAMED_BIND     0     /* use Berkeley Internet Domain Server */
  155.  
  156. AND
  157.  
  158. PART II:
  159. -------
  160. Sendmail would however normally insist on doing name look ups to resolve
  161. the host part using gethostbyaddr() for each email it sends (even if you tell 
  162. it not to canonify names).
  163.  
  164.  
  165. a) use an RFC1597 IP address (10.0.0.0-10.255.255.255, 
  166. 172.16.0.0-172.31.255.255, 192.168.0.0-192.168.255.255) 
  167. Edit /etc/hosts and add the following as a sample 
  168. for the host myhost
  169.  
  170.         10.0.0.1   myhost.me.com   myhost
  171. or
  172. b) If you use NIS (and NIS is compiled into sendmail as seems to be the case in 
  173. Redhat. Redhat also has NIS built in)
  174. make sure the /etc/nsswitch.conf file contains:
  175. hosts:  files dns 
  176. and in /etc/hosts and add the following as a sample for the host myhost
  177. [again using RFC1597 IP addressing scheme]
  178.  
  179.         10.0.0.1   myhost.me.com   myhost
  180.  
  181. NOTE:
  182. ----
  183. In both a) and b) above it is critical that you list the long (fully qualified) 
  184. in the /etc/hosts file used.
  185. i.e  the line should read
  186.  
  187.         10.0.0.1   myhost.me.com   myhost
  188. and NOT
  189.         10.0.0.1   myhost
  190. you will also need to define the sendmail $w macro to hold myhost.me.com
  191. add  the Following line to your /etc/sendmail.cf after it is generated 
  192. Dwmyhost.me.com
  193. (or you can use MASQUAREADE_AS(myhost.me.com) in the .mc below)
  194.  
  195. NOTE!!!!! myhost as a domain name is given as an example; you dont
  196. have to use it as is. Pick your own hostname if you dont have one
  197. already.
  198.  
  199.  
  200. --------------------------------------------------------------------------------
  201. 2) Ensure that you have makemap and it is capable of supporting
  202. hash and or the more common dbm format or even btree format 
  203. (The Redhat version does not support dbm). Makemap is normaly distributed with
  204. sendmail.
  205.  
  206.  
  207. SETUP 
  208. --------------------------------------------------------------------------------
  209. 1) create your .mc file using your favorite editor; i'll call this file
  210. my.mc
  211.  
  212. ============== file my.mc =======================
  213. include(`../m4/cf.m4')
  214. VERSIONID(`me.com's setup with uucp created by xxxx')dnl
  215. OSTYPE(linux)
  216. FEATURE(nodns)dnl
  217. FEATURE(nocanonify)dnl
  218. FEATURE(always_add_domain)dnl
  219. FEATURE(mailertable, hash /etc/mailertable)dnl
  220. MAILER(local)dnl
  221. MAILER(smtp)dnl
  222. MAILER(uucp)
  223. define(`SMART_HOST', uucp-dom:mysmarthost)
  224. ===============================================
  225.  
  226. Let's dissect this:
  227.  
  228. include(`../m4/cf.m4')
  229.  
  230. requests for the m4 macro found in ../m4/cf.m4 to be include
  231. to resolve some things
  232.  
  233. VERSIONID(`me.com's setup with uucp created by xxxx'