home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / internet / sendmai1.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  6.1 KB  |  160 lines

  1. [ netinfo/sendmail-cf-doc.txt ]
  2.  
  3. From:  Erik Fair
  4.  
  5. There are two generic sendmail configuration files that I've created:
  6.  
  7.     internet-generic.cf    - for Internet-only hosts
  8.     generic.cf        - for hosts using both Internet and UUCP
  9.  
  10. NOTE:   The NIC's filenames are:
  11.  
  12.         netinfo/sendmail-internet-generic.txt
  13.         netinfo/sendmail-generic.txt
  14.  
  15. The basic assumptions are:
  16.  
  17.     If you're an internet host, you're registered (i.e. in
  18.     hosts.txt from the NIC. If you're not, you need to be "hidden"
  19.     behind the name of a host that is registered, in the form:
  20.     user%un
  21.     do that).
  22.  
  23.     If you're an internet host, you're not using the domain name
  24.     server (if you are, why are you bothering with these config
  25.     files?).
  26.  
  27.     The gethostname(2) system call returns your unqualified
  28.     official hostname (e.g. "ucbvax", instead of "ucbvax.berkeley.edu").
  29.     This is set by hostname(1), usually in /etc/rc.local at boot
  30.     time, but this can be overridden for the purposes of Email by a
  31.     config file definition.
  32.  
  33.     If you use UUCP, the gethostname(2) system call returns your
  34.     UUCP name (i.e.  your UUCP name is the last component of your
  35.     fully qualified hostname). This also can be overridden.
  36.  
  37. OK, the nitty-gritty. The NIC is about to, or already has, issued a
  38. HOSTS.TXT that no longer has any of the non-domainist aliases (e.g.
  39. ucbvax.berkeley.edu doesn't have "berkeley" or "ucbvax" its aliases any
  40. more). As such, you must be prepared to use fully qualified domain
  41. names in all your correspondence. Unfortunately, the sendmail
  42. configuration file distributed with 4.2 BSD (but NOT 4.3 BSD) is
  43. incapable of handling this right. Thus the distribution of my config
  44. files.
  45.  
  46. To use these, you have to pick one of the generic files, add your
  47. local information to it (all your hostnames & aliases, UUCP sites you
  48. speak to, etc), and install it as /usr/lib/sendmail.cf.
  49.  
  50. So, here is the stuff you need to change to use these sendmail
  51. configuration files:
  52.  
  53.         internet-generic.cf
  54.  
  55. There are two configuration items here: macro "w" and class "w".
  56. Case of a macro or class name is significant. A macro is a string.
  57. A class is an array of strings.
  58.  
  59. Macro "w" is usually defined by whatever comes back from the
  60. gethostname(2) system call. You can look at this by using the
  61. "hostname" program. When you add ".arpa" to what "hostname" prints, you
  62. should get your official host name. For example, for site lll-tis-b.arpa,
  63.  
  64. % hostname
  65. lll-tis-b
  66.  
  67. is correct. If, for whatever reason, "hostname" returns something OTHER
  68. than the first component of your official Internet host name, then you
  69. need to add to the configuration file, (for example)
  70.  
  71. Dwlll-tis-b
  72.  
  73. This defines macro "w" to be "lll-tis-b" which will have the desired
  74. effect.
  75.  
  76. Class "w" is a list of all the names that your host is known by.
  77. This should contain your hostname, and all aliases for your host.
  78. Using the same example as above:
  79.  
  80. Cwlll-tis-b lll-tis-gw tis-b tis-styx styx
  81.  
  82. If you need more than one line, use as many lines as you need,
  83. beginning each line in "Cw"
  84.  
  85. If by some misfortune you run System V UNIX instead of 4BSD, but you
  86. still have sendmail, it is still possible for you to use these
  87. configuration files, but you will have to find the local mailer
  88. definition (this is what sendmail will call to actually stuff a letter
  89. in a local mailbox) which is a line which matches the "^Mlocal"
  90. regular expression, and read the comment surrounding it.
  91.  
  92.         generic.cf
  93.  
  94. This configuration file needs the same information as internet-generic.cf,
  95. but also some stuff about UUCP: macro "U" and class "U". Note that it
  96. is also important for your UUCP name to be in class "w" along with your
  97. internet names.
  98.  
  99. Macro "U" should be defined to be your UUCP name. If your UUCP name is
  100. not the same as what gets returned from gethostname(2) (i.e. it's not
  101. the first component of your official internet host name), then you
  102. have to change the definition of macro "U" in the config file from
  103.  
  104. DU$w
  105.  
  106. to
  107.  
  108. DUyour-uucp-name-here
  109.  
  110. In the case of "lll-tis-b.arpa", whose UUCP name is "styx", this would
  111. read:
  112.  
  113. DUstyx
  114.  
  115. Class "U" is the list of all the UUCP sites that you speak to. This
  116. will have to be updated each time you change the L.sys file in order
  117. for UUCP mail to get through. Use as many lines as you need, beginning
  118. each line with "CU", and separating the names with spaces.
  119.  
  120.         I N S T A L L A T I O N
  121.  
  122. Having made the required changes to reflect your local names, you need
  123. to install this. So, how?
  124.  
  125. First, copy the old sendmail config file to a backup file, just in
  126. case.
  127.  
  128. Second, copy the new, improved sendmail config that you've just
  129. edited to /usr/lib/sendmail.cf
  130.  
  131. Third, if you're using the frozen config file stuff (this is something
  132. that saves time on sendmail start up, look for a non-zero length file
  133. name /usr/lib/sendmail.fc), run /usr/lib/sendmail -bz (to re-freeze the
  134. new config file; note that if you use frozen config files, when ever
  135. you make a change to your config file you have to do this)
  136.  
  137. Forth, kill the sendmail daemon that is offering SMTP service to the
  138. network (look for a sendmail process with a PID typically less than
  139. 200, and kill it), and restart it with the same arguments as in
  140. /etc/rc.local (usually, -bd -q30m, which means "run in daemon mode,
  141. offer SMTP service to the network, and do a queue run every 30
  142. minutes). The reason that you have to do this is that sendmail reads
  143. its configuration file once upon start up, and so the daemon offering
  144. SMTP service is still using the old config file, despite the fact that
  145. you've installed a new one.
  146.  
  147. You're done. You have a new sendmail configuration file installed and
  148. operating which will handle fully qualified domain names in /etc/hosts.
  149.  
  150. If you have problems with this configuration file, please drop a note
  151. to me, Erik Fair, at <fair@ucbarpa.berkeley.edu>, and be sure to
  152. include headers of errant messages in your problem report. I give no
  153. guarantee of merchantability, fitness for particular purpose or
  154. warrantee, but I will *try* to help if you have a problem.
  155.  
  156.     Erik E. Fair    ucbvax!fair    fair@ucbarpa.berkeley.edu
  157.  
  158.     April 3, 1987
  159.  
  160.