home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume1 / 8711 / 21 < prev    next >
Internet Message Format  |  1990-07-13  |  11KB

  1. Path: uunet!husc6!rutgers!clyde!cbosgd!mandrill!hal!ncoast!allbery
  2. From: chip@vector.UUCP (Chip Rosenthal)
  3. Newsgroups: comp.sources.misc
  4. Subject: smail 2.5 installation under SCO XENIX
  5. Message-ID: <6298@ncoast.UUCP>
  6. Date: 29 Nov 87 02:44:15 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Lines: 322
  9. Approved: allbery@ncoast.UUCP
  10. X-Archive: comp.sources.misc/8711/21
  11.  
  12. {{{ Daniel - I have received over a dozen requests for the following    }}}
  13. {{{ package, so I though it might be best to post to comp.sources.misc.    }}}
  14. {{{ It is used to install smail V2.5 under SCO XENIX.            }}}
  15. {{{  -chip                                }}}
  16.  
  17. #! /bin/sh
  18. # this is a 'shar' archive - run through sh(C) to extract:
  19. # -rw-r--r--   1 root     root        2837 Nov 25 13:03 Makefile.sco
  20. # -rw-r--r--   1 root     root        4386 Nov 25 13:44 README.sco
  21. # -rw-r--r--   1 root     root        2095 Nov 25 13:42 execmail.c
  22. # 3 files total
  23. echo "x - README.sco (file 1 of 3)"
  24. sed -e 's/.//' << 'END_OF_FILE_README.sco' > README.sco
  25. #
  26. #This package implements the stock "smail V2.5" distribution under SCO XENIX.
  27. #
  28. #The main problem with using "smail" under XENIX is that the installation
  29. #really doesn't correspond to the standard BSD or SYSV installation,
  30. #although it is closest to the "SYSV without sendmail" installation.  Some
  31. #of the issues are:
  32. #
  33. #    - there is neither "binmail" nor "mailx" under SCO XENIX
  34. #    - the mail executables are mostly in "/usr/bin", not "/bin"
  35. #    - "rmail" is a seperate program, not just a link to "mail"
  36. #    - the standard mail interface barfs on internet (user@site) addresses
  37. #
  38. #Aside from the installation issues, there are a couple of other things
  39. #you need to watch for:
  40. #
  41. #1)    SCO XENIX is distributed with an empty "nodename" entry in the
  42. #        kernal's "uname" structure.  If you haven't placed your system's
  43. #        name there, you will either need to do so or define your system
  44. #        name in the "defs.h" file (the HOSTNAME definiton).
  45. #
  46. #2)    There are several places in the source where NULL is used to
  47. #        terminate a string.  Since NULL is defined as "(char *)0" in the
  48. #        SCO XENIX "stdio.h" file, compiler warnings are generated by
  49. #        this.  Although "smail" will work in spite of these errors, you
  50. #        might want to clean them up by changing NULL to '\0' in the
  51. #        following places:
  52. #
  53. #        file    line(s)
  54. #        =======    =======
  55. #        alias.c    461
  56. #        deliver.c    284
  57. #        nptx.c    128,165
  58. #
  59. #3)    You need to compile "smail" as a pure executable (-i) and extend
  60. #        the stack size.  This has been done in the attached "Makefile".
  61. #
  62. #In regards to the internet address (user@site) problem -- this is a
  63. #limitation of /usr/bin/mail.  If it does the mailing, it complains about
  64. #the "@" character.  The solution is to force /usr/bin/mail to let
  65. #/usr/lib/mail/execmail do the mailing.  This is done by placing a "set
  66. #execmail" line in the /usr/lib/mail/mailrc file.  The included "execmail"
  67. #program replaces the standard execmail.  It forces all mail to go through
  68. #"smail" to handle the internet addresses.
  69. #
  70. #The "Flow.Diagram" file shows how mail works in various situations -- none
  71. #of which correspond to how mail works with SCO XENIX.  The following
  72. #diagrams show the mail flow for SCO XENIX:
  73. #
  74. #========================================================================
  75. #
  76. #vanilla SCO XENIX mail flow
  77. #
  78. #    mail     is /usr/bin/mail
  79. #    rmail     is /usr/bin/rmail
  80. #    execmail     is /usr/lib/mail/execmail
  81. #
  82. #LOCAL    mail  ---------\        /--------------------- LOCAL
  83. #            +-- execmail --+
  84. #REMOTE    rmail ---------/        \------- uux --------- REMOTE
  85. #
  86. #Note that there is no "mailx" in XENIX.  Also note that "rmail" is
  87. #a seperate program, not just a link to "mail".  This flow is the
  88. #case only if "set execmail" is defined in /usr/lib/mail/mailrc.
  89. #
  90. #========================================================================
  91. #
  92. #Modified SCO XENIX mail flow
  93. #
  94. #    /usr/bin/rmail is renamed to /usr/bin/rmail.old and is ignored
  95. #    /usr/lib/mail/execmail is renamed to /usr/lib/mail/execmail.old and ignored
  96. #
  97. #    mail     is still /usr/bin/mail
  98. #
  99. #    smail     is smail copied to /bin/smail
  100. #    rmail     is a link from /bin/smail to /bin/rmail
  101. #    lmail     is a link from /usr/lib/mail/mail.local to /bin/lmail
  102. #    execmail     is execmail copied to /usr/lib/mail/execmail
  103. #
  104. #LOCAL   mail --- execmail --- smail ---\     /--- lmail -------- LOCAL
  105. #                    +-------+
  106. #REMOTE  rmail -------------------------/     \--- uux ---------- REMOTE
  107. #
  108. #========================================================================
  109. #
  110. #To install smail under SCO XENIX, do the following:
  111. #
  112. #(1)    Ensure "smail" can find out your host name (see note 1 near the
  113. #    beginning of this message).
  114. #
  115. #(2)    Make sure "defs.h" contains what you want.  (The only change I
  116. #    made was to redefine ALIASES to "/usr/lib/mail/aliases".)
  117. #
  118. #(3)    See if the makefile definitions look reasonable to you.
  119. #
  120. #(4)    Type "make" to compile the sources.
  121. #
  122. #(5)    Type "make install" to put everything in its place.
  123. #
  124. #There is a "make remove" option which deinstalls "smail" and returns
  125. #you to a stock SCO XENIX mail configuration.
  126. #
  127. #If you want to make you setup more System V-ish, you could rename
  128. #"/usr/bin/mail" to "/usr/bin/mailx" and install the "svbinmail" included
  129. #in the smail package as "/bin/mail".  You would, however, have to change
  130. #READER to "/usr/bin/mailx" in "svbinmail.c".
  131. #
  132. #I'd be interested in any suggestions or comments you might have.
  133. #
  134. #Chip Rosenthal
  135. #chip@vector.UUCP
  136. #25 Nov 87
  137. #
  138. END_OF_FILE_README.sco
  139. echo "original file size:      113    632   4386 README.sco"
  140. echo "extracted file size: `wc README.sco`"
  141. echo "x - Makefile.sco (file 2 of 3)"
  142. sed -e 's/.//' << 'END_OF_FILE_Makefile.sco' > Makefile.sco
  143. ## Makefile for smail under SCO XENIX
  144. ##
  145. ## Wed Nov 25 13:02:54 CST 1987 - C. Rosenthal
  146. ##    Documented for net distribution.
  147. #
  148. ## @(#)Makefile    2.5 (smail) 9/15/87
  149. #
  150. ## Things to do:
  151. ##    make            make executables
  152. ##    make all         "       "
  153. ##    make install        perform XENIX installation
  154. ##    make remove        de-install smail
  155. ##    make clean        cleanup this directory
  156. ##    make clobber        ...and remove executables from this dir
  157. #
  158. #SHELL=        /bin/sh
  159. #CFLAGS    =    -i -O
  160. ##LIBS    =    -lmalloc    ** don't use -lmalloc!! it causes core dumps **
  161. #
  162. #OBJECTS =    main.o map.o resolve.o deliver.o misc.o alias.o pw.o headers.o getpath.o str.o getopt.o
  163. #
  164. #all:        smail execmail
  165. ##all:        smail svbinmail lcasep pathproc mkfnames nptx
  166. #
  167. #smail:        $(OBJECTS)
  168. #        cc -F 5000 $(CFLAGS) $(OBJECTS) -o smail $(LIBS)
  169. #
  170. #$(OBJECTS):    defs.h
  171. #        cc $(CFLAGS) -c $<
  172. #
  173. #svbinmail:    svbinmail.c defs.h
  174. #        cc $(CFLAGS) svbinmail.c -o $@
  175. #
  176. #lcasep:        lcasep.c
  177. #        cc $(CFLAGS) lcasep.c -o lcasep
  178. #
  179. #pathproc:    pathproc.sh
  180. #        cp pathproc.sh pathproc
  181. #        chmod 755 pathproc
  182. #
  183. #mkfnames:    mkfnames.sh
  184. #        cp mkfnames.sh mkfnames
  185. #        chmod 755 mkfnames
  186. #
  187. #nptx:        nptx.o pw.o str.o
  188. #        cc $(CFLAGS) nptx.o pw.o str.o -o nptx $(LIBS)
  189. #
  190. #nptx.o:        nptx.c
  191. #        cc $(CFLAGS) -c nptx.c
  192. #
  193. #execmail:    execmail.c
  194. #        cc $(CFLAGS) execmail.c -o execmail
  195. #
  196. #clean:
  197. #        rm -f *.o *.ln a.out core
  198. #
  199. #clobber:    clean
  200. #        rm -f smail rmail lcasep pathproc mkfnames svbinmail nptx execmail
  201. #
  202. ###########################
  203. ## SCO XENIX Installation #
  204. ###########################
  205. #
  206. #INSTALL=    /bin/lmail /bin/rmail /bin/smail /usr/lib/mail/execmail
  207. #CHANGE=        /usr/bin/rmail.old /usr/lib/mail/execmail.old
  208. #MANDIR=        /usr/man/local/man8
  209. #MANSUF=        8L
  210. #MANPAGES=    $(MANDIR)/aliases.$(MANSUF)    \
  211. #        $(MANDIR)/lcasep.$(MANSUF)    \
  212. #        $(MANDIR)/mkfnames.$(MANSUF)    \
  213. #        $(MANDIR)/nptx.$(MANSUF)    \
  214. #        $(MANDIR)/pathproc.$(MANSUF)    \
  215. #        $(MANDIR)/paths.$(MANSUF)    \
  216. #        $(MANDIR)/smail.$(MANSUF)
  217. #
  218. #install:    all $(CHANGE) $(INSTALL) $(MANPAGES)
  219. #        @echo "=== Your global mailrc needs to contain 'set execmail'."
  220. #        @echo "=== I'll check and add it if required..."
  221. #        grep 'set execmail' /usr/lib/mail/mailrc > /dev/null || \
  222. #            echo 'set execmail' >> /usr/lib/mail/mailrc
  223. #
  224. #remove:        
  225. #        -rm $(INSTALL)
  226. #        -rm $(MANPAGES)
  227. #        -mv /usr/bin/rmail.old /usr/bin/rmail
  228. #        -mv /usr/lib/mail/execmail.old /usr/lib/mail/execmail
  229. #
  230. #/usr/bin/rmail.old:                ; mv /usr/bin/rmail $@
  231. #/usr/lib/mail/execmail.old:            ; mv /usr/lib/mail/execmail $@
  232. #
  233. #/bin/smail:        smail                ; cp $? $@
  234. #/bin/rmail:        /bin/smail            ; -ln $? $@
  235. #/bin/lmail:        /usr/lib/mail/mail.local    ; ln $? $@
  236. #/usr/lib/mail/execmail:    execmail            ; cp $? $@
  237. #
  238. #$(MANDIR)/aliases.$(MANSUF):    aliases.8        ; cp $? $@
  239. #$(MANDIR)/lcasep.$(MANSUF):    lcasep.8        ; cp $? $@
  240. #$(MANDIR)/mkfnames.$(MANSUF):    mkfnames.8        ; cp $? $@
  241. #$(MANDIR)/nptx.$(MANSUF):    nptx.8            ; cp $? $@
  242. #$(MANDIR)/pathproc.$(MANSUF):    pathproc.8        ; cp $? $@
  243. #$(MANDIR)/paths.$(MANSUF):    paths.8            ; cp $? $@
  244. #$(MANDIR)/smail.$(MANSUF):    smail.8            ; cp $? $@
  245. #
  246. END_OF_FILE_Makefile.sco
  247. echo "original file size:      103    356   2837 Makefile.sco"
  248. echo "extracted file size: `wc Makefile.sco`"
  249. echo "x - execmail.c (file 3 of 3)"
  250. sed -e 's/.//' << 'END_OF_FILE_execmail.c' > execmail.c
  251. #/*
  252. # * execmail - Replacement for execmail for smail under SCO XENIX
  253. # *
  254. # * This program is derived from an article from Chip Salzenberg (chip@ateng).
  255. # * Below is his news article and the program.  Note that his article suggests
  256. # * that "/usr/lib/mail/execmail" (the original one--not the replacement)
  257. # * be used as the local delivery agent.  Unfortunately, this munges up
  258. # * the "From" line in the mail header.  Instead, "/usr/lib/mail/mail.local"
  259. # * should be used.
  260. # *
  261. # * Wed Nov 25 13:41:01 CST 1987 - C. Rosenthal
  262. # *    Commented for net distribution.
  263. # */
  264. #
  265. #/*
  266. # * From: chip@ateng.UUCP (Chip Salzenberg)
  267. # * Newsgroups: comp.unix.xenix
  268. # * Subject: RFC822 addresses and Xenix `mail'
  269. # * Message-ID: <92@ateng.UUCP>
  270. # * Date: 2 Nov 87 15:19:09 GMT
  271. # * Organization: A.T. Engineering, Tampa, FL
  272. # * Lines: 96
  273. # * 
  274. # * In article <536@bms-at.UUCP> stuart@bms-at.UUCP (Stuart D. Gathman) writes:
  275. # * >
  276. # * >Unfortunately, SCO mail screens addresses for garbage characters
  277. # * >(e.g. '@' & '.') before passing mail to /bin/rmail.  As I say on
  278. # * >many occasions, "Gee, they sure went to a lot of trouble to make
  279. # * >it not work!"
  280. # * 
  281. # * This `feature' is easy to defeat.
  282. # * 
  283. # * In the /usr/lib/news/mailrc file, add this line:
  284. # * 
  285. # *     set execmail
  286. # * 
  287. # * This causes the mail program to hand all mail to /usr/lib/mail/execmail.
  288. # * (This gem is courtesy of Tom Walsh <uunet!foobar!tw> -- thanks, Tom.)
  289. # * 
  290. # * It is then necessary to rename the existing /usr/lib/mail/execmail to
  291. # * something else, say execmail.x, and then have smail use execmail.x as the
  292. # * local delivery agent.
  293. # * 
  294. # * And of course, you need to install a replacement for execmail.  This is
  295. # * my execmail replacement:
  296. # *
  297. # */
  298. #
  299. ##include <stdio.h>
  300. ##define SMAIL    "/bin/smail"
  301. #
  302. #main(argc, argv)
  303. #int     argc;
  304. #char    **argv;
  305. #{
  306. #    char *progname = argv[0];
  307. #
  308. #    /*
  309. #     * Drop the execmail options.
  310. #     */
  311. #    while (argv[1][0] == '-') {
  312. #        switch (argv[1][1]) {
  313. #        case 'f':
  314. #        case 'h':
  315. #            argv += 2;
  316. #            break;
  317. #        default:
  318. #            ++argv;
  319. #            break;
  320. #        }
  321. #    }
  322. #
  323. #    argv[0] = progname;
  324. #    execv(SMAIL, argv);
  325. #    fprintf(stderr, "%s: can't execute smail!\n", progname);
  326. #    exit(1);
  327. #}
  328. #
  329. END_OF_FILE_execmail.c
  330. echo "original file size:       78    331   2095 execmail.c"
  331. echo "extracted file size: `wc execmail.c`"
  332. echo "extracted 3 files"
  333. exit 0
  334.