home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume7 / elm_update / part2 / Edit2
Encoding:
Text File  |  1986-11-30  |  36.9 KB  |  1,470 lines

  1. : Use /bin/sh
  2.  
  3. # This is the automatically generated output of the AUTODIFF program after
  4. # being run on the two directories;
  5. #    Old Directory: Elm-Posted
  6. #    New Directory: Elm
  7.  
  8. # Any problems with execution of this script should be reported to the 
  9. #     author of the program, Dave Taylor, at "hplabs!taylor".  Thanks
  10.  
  11. # first off, let's make sure we're running in SH
  12.  
  13. export PATH || (sh $0; exit $$)
  14.  
  15. # next, let's ensure the user has "ed"...
  16.  
  17. if [ ! -f /bin/ed ]
  18. then
  19.   echo I can\'t find /bin/ed\!
  20.   exit 1
  21. fi
  22.  
  23. # finally, let's get this show on the road!!
  24.  
  25. #---------------------------------
  26. # File Elm/src/Makefile.mstr is new!
  27.  
  28. echo File Elm/src/Makefile.mstr is new - extracting...
  29. if [ -f src/Makefile.mstr ]
  30. then
  31.   echo File \'src/Makefile.mstr\' is new, but you already have something called that\!
  32.   echo I\'m going to move your file to \'src/Makefile.mstr.old\'...
  33.   /bin/mv -f src/Makefile.mstr src/Makefile.mstr.old
  34. else
  35.   echo Extracting new file \'src/Makefile.mstr\'
  36. fi
  37.  
  38. cat > src/Makefile.mstr << 'END_OF_FILE'
  39. #
  40. #  Makefile for the ELM mail program.
  41. #
  42. #         (C) Copyright 1986, Dave Taylor
  43. #
  44. #  Last modification: March 7th, 1986
  45.  
  46. SHELL=/bin/sh
  47.  
  48. ##############################
  49. #
  50. # if on a BSD system;
  51. #   DEFINE=-DBSD
  52. #   LIB2  = -lcurses
  53. # else if on a UTS system;
  54. #   DEFINE=-DUTS
  55. #   LIB2  = -la -lq
  56. # else if on a SUN system;
  57. #   DEFINE=-DBSD -DSUN
  58. #   LIB2  = -lcurses
  59. # else if on a Pyramid system;
  60. #   DEFINE=-DBSD -DNO_VAR_ARGS
  61. #   LIB2  = -lcurses
  62. # else
  63.  
  64.     DEFINE= >os-define<
  65.     LIB2  = >lib2<
  66.  
  67. # IF you're on an ACSnet system (Australia) then
  68. # you'll want to uncomment the following;
  69.  
  70. #   DEFINE= ${DEFINE} -DACSNET
  71.  
  72. ##############################
  73.  
  74. CFILES=    addr_utils.c alias.c aliasdb.c aliaslib.c args.c bounceback.c       \
  75.     calendar.c connect_to.c curses.c date.c delete.c domains.c edit.c   \
  76.     encode.c errno.c file.c file_utils.c fileio.c hdrconfg.c help.c     \
  77.     initialize.c input_utils.c leavembox.c mailmsg1.c mailmsg2.c        \
  78.     mailtime.c mkhdrs.c elm.c newmbox.c notesfile.c options.c opt_utils.c \
  79.     output_utils.c pattern.c quit.c read_rc.c remail.c reply.c         \
  80.     return_addr.c savecopy.c screen.c showmsg.c signals.c softkeys.c    \
  81.     sort.c strings.c syscall.c utils.c validname.c getopt.c string2.c   \
  82.     builtin.c pmalloc.c
  83.  
  84. HEADERS=../hdrs/curses.h ../hdrs/defs.h ../hdrs/headers.h ../hdrs/sysdefs.h
  85.  
  86. OBJS=    addr_utils.o alias.o aliasdb.o aliaslib.o args.o bounceback.o       \
  87.     calendar.o connect_to.o curses.o date.o delete.o domains.o edit.o   \
  88.     encode.o errno.o file.o file_utils.o fileio.o hdrconfg.o help.o     \
  89.     initialize.o input_utils.o leavembox.o mailmsg1.o mailmsg2.o        \
  90.     mailtime.o mkhdrs.o elm.o newmbox.o notesfile.o options.o opt_utils.o \
  91.     output_utils.o pattern.o quit.o read_rc.o remail.o reply.o         \
  92.     return_addr.o savecopy.o screen.o showmsg.o signals.o softkeys.o    \
  93.     sort.o strings.o syscall.o utils.o validname.o getopt.o string2.o   \
  94.     builtin.o pmalloc.o
  95.  
  96. BIN=    ../bin
  97. LIBS=   -ltermcap
  98. CFLAGS= -O -I../hdrs
  99. CC=    >cc<
  100. RM=    >rm<
  101.  
  102. ../bin/elm: ${OBJS} ${EXTRA} ${HEADERS} ../hdrs/elm.h
  103.     ${CC} -o ${BIN}/elm -n ${OBJS} ${LIBS} ${LIB2}
  104.  
  105. .c.o:   ${HEADERS}
  106.     ${CC} -c ${CFLAGS} ${DEFINE} $*.c 
  107.  
  108. curses.o: curses.c ../hdrs/curses.h
  109.     ${CC} -c ${CFLAGS} -DRAWMODE ${DEFINE} curses.c
  110.  
  111. # curses.c : curses.q
  112. #     @../bin/quickscreen curses.q
  113. #
  114. # curses.q :
  115. #     @cp curses.c curses.q
  116.  
  117. clean:
  118.     ${RM} ${OBJS} LINT.OUT
  119.  
  120. lint: LINT.OUT
  121.  
  122. LINT.OUT: ${CFILES}
  123.     lint -p -I../hdrs ${CFILES} > LINT.OUT
  124.  
  125. listing: LISTING
  126.  
  127. LISTING: Makefile INDEX ${HEADERS} ${CFILES}
  128.     @echo adding file 'Makefile'...
  129.     @/bin/echo \\f > LISTING
  130.     @cat Makefile >> LISTING
  131.     @echo adding file 'INDEX'...
  132.     @/bin/echo \\f >> LISTING
  133.     @cat INDEX >> LISTING
  134.     @../bin/makelisting ${HEADERS} ${CFILES}
  135.     @echo LISTING generated.
  136.  
  137. index: INDEX
  138.  
  139. INDEX: ${CFILES} ${HEADERS}
  140.     @echo Creating function definition index
  141.     @index *.c | sort > INDEX
  142.     @echo File INDEX generated
  143. END_OF_FILE
  144.  
  145. chars=`cat src/Makefile.mstr | wc -c`
  146.  
  147. if [ $chars -ne 2882 ]
  148. then
  149.   echo File damaged in transit...should be 2882 bytes, is $chars instead
  150.   echo  I suggest you check it closely...
  151. fi
  152.  
  153. #---------------------------------
  154. # File Elm/src/pmalloc.c is new!
  155.  
  156. echo File Elm/src/pmalloc.c is new - extracting...
  157. if [ -f src/pmalloc.c ]
  158. then
  159.   echo File \'src/pmalloc.c\' is new, but you already have something called that\!
  160.   echo I\'m going to move your file to \'src/pmalloc.c.old\'...
  161.   /bin/mv -f src/pmalloc.c src/pmalloc.c.old
  162. else
  163.   echo Extracting new file \'src/pmalloc.c\'
  164. fi
  165.  
  166. cat > src/pmalloc.c << 'END_OF_FILE'
  167. /**            pmalloc.c        **/
  168.  
  169. /** This routine contains a cheap permanent version of the malloc call to 
  170.     speed up the initial allocation of the weedout headers and the uuname 
  171.     data.  
  172.  
  173.       This routine is originally from Jim Davis of HP Labs, with some 
  174.     mods by me.
  175. **/
  176.  
  177. #include <stdio.h>
  178. #include "defs.h"
  179.  
  180. char *pmalloc(size)
  181. int size; 
  182. {
  183.     /** return the address of a specified block **/
  184.  
  185.     static char *our_block = NULL;
  186.     static int   free_mem  = 0;
  187.  
  188.     char   *return_value;
  189.  
  190.     /** if bigger than our threshold, just do the real thing! **/
  191.  
  192.     if (size > PMALLOC_THRESHOLD) 
  193.        return( (char *) malloc(size));
  194.  
  195.     /** if bigger than available space, get more, tossing what's left **/
  196.  
  197.     if (size > free_mem) {
  198.       if ((our_block = (char *) malloc(PMALLOC_BUFFER_SIZE)) == NULL) {
  199.         fprintf(stderr, "\n\r\n\rCouldn't pmalloc %d bytes!!\n\r\n\r",
  200.             PMALLOC_BUFFER_SIZE);
  201.         leave();    
  202.           }
  203.       free_mem = PMALLOC_BUFFER_SIZE;
  204.     }
  205.     
  206.     return_value  = our_block;    /* get the memory */
  207.     our_block += size;        /* use it up      */
  208.     free_mem  -= size;        /*  and decrement */
  209.  
  210.     return( (char *) return_value);
  211. }
  212. END_OF_FILE
  213.  
  214. chars=`cat src/pmalloc.c | wc -c`
  215.  
  216. if [ $chars -ne 1114 ]
  217. then
  218.   echo File damaged in transit...should be 1114 bytes, is $chars instead
  219.   echo  I suggest you check it closely...
  220. fi
  221.  
  222. #-------------------------------------
  223. # File 'hdrs/defs.h' diffs...
  224.  
  225. cat << 'EOF' > hdrs/defs.h.D
  226. 209a
  227.  
  228. #ifdef SHORTNAMES    /* map long names to shorter ones */
  229. # include <shortnames.h>
  230. #endif
  231. .
  232. 144a
  233. /* some stuff for our own malloc call - pmalloc */
  234.  
  235. #define PMALLOC_THRESHOLD    256    /* if greater, then just use malloc */
  236. #define PMALLOC_BUFFER_SIZE    2048    /* internal [memory] buffer size... */
  237.  
  238. .
  239. 12a
  240. #define KLICK        10
  241.  
  242. .
  243. 11c
  244. #define WHAT_STRING    "@(#) Version 1.2a, patch #3 release - August, 1986"
  245. .
  246. 9c
  247. #define VERSION        "1.2a" /* Version number!  WHAT_STRING should agree */
  248. .
  249. w
  250. EOF
  251.  
  252. chars=`cat hdrs/defs.h | wc -c`
  253.  
  254. if [ $chars -ne 6693 ]
  255. then
  256.   echo Your file hdrs/defs.h has been changed\!
  257.   echo diffs saved as \"hdrs/defs.h.D\"
  258. else
  259.   echo applying diffs to file hdrs/defs.h...
  260.   /bin/cat hdrs/defs.h.D | /bin/ed - hdrs/defs.h
  261. fi
  262.  
  263. #-------------------------------------
  264. # File 'hdrs/headers.h' diffs...
  265.  
  266. cat << 'EOF' > hdrs/headers.D
  267. 102c
  268. extern int  max_headers;    /* number of headers currently allocated */
  269.  
  270. extern struct header_rec *header_table;
  271. .
  272. 93c
  273. extern long size_of_pathfd;    /** size of pathfile, 0 if none **/
  274. .
  275. w
  276. EOF
  277.  
  278. chars=`cat hdrs/headers.h | wc -c`
  279.  
  280. if [ $chars -ne 5082 ]
  281. then
  282.   echo Your file hdrs/headers.h has been changed\!
  283.   echo diffs saved as \"hdrs/headers.D\"
  284. else
  285.   echo applying diffs to file hdrs/headers.h...
  286.   /bin/cat hdrs/headers.D | /bin/ed - hdrs/headers.h
  287. fi
  288.  
  289. #-------------------------------------
  290. # File 'hdrs/elm.h' diffs...
  291.  
  292. cat << 'EOF' > hdrs/elm.h.D
  293. 107c
  294. int   max_headers;        /* number of headers allocated */
  295.  
  296. struct header_rec *header_table;
  297. .
  298. 98c
  299. long size_of_pathfd;        /** size of pathfile, 0 if none **/
  300. .
  301. 20a
  302. /******** and another string for the copyright notice            ********/
  303.  
  304. static char copyright[] = { "@(#)          (C) Copyright 1986, Dave Taylor" };
  305.  
  306. .
  307. 17,18d
  308. 15c
  309. /******** static character string containing the version number  *******/
  310. .
  311. 13d
  312. w
  313. EOF
  314.  
  315. chars=`cat hdrs/elm.h | wc -c`
  316.  
  317. if [ $chars -ne 4889 ]
  318. then
  319.   echo Your file hdrs/elm.h has been changed\!
  320.   echo diffs saved as \"hdrs/elm.h.D\"
  321. else
  322.   echo applying diffs to file hdrs/elm.h...
  323.   /bin/cat hdrs/elm.h.D | /bin/ed - hdrs/elm.h
  324. fi
  325.  
  326. #---------------------------------
  327. # File Elm/hdrs/sysdefs.master is new!
  328.  
  329. echo File Elm/hdrs/sysdefs.master is new - extracting...
  330. if [ -f hdrs/sysdefs.master ]
  331. then
  332.   echo File \'hdrs/sysdefs.master\' is new, but you already have something called that\!
  333.   echo I\'m going to move your file to \'hdrs/sysdefs.master.old\'...
  334.   /bin/mv -f hdrs/sysdefs.master hdrs/sysdefs.master.old
  335. else
  336.   echo Extracting new file \'hdrs/sysdefs.master\'
  337. fi
  338.  
  339. cat > hdrs/sysdefs.master << 'END_OF_FILE'
  340. /**            sysdefs.h            **/
  341.  
  342. /**  System level, configurable, defines for the ELM mail system.  **/
  343.  
  344. /**  (C) Copyright 1986 Dave Taylor                                **/
  345.  
  346. /** Define the following if you think that the information in messages
  347.     that have "Reply-To:" and/or "From:" fields with addresses will
  348.     contain valid addressing information.  If this isn't defined, the
  349.     calculated return address will ALWAYS be used instead.  (note that
  350.     this doesn't necessarily preclude the use of G)roup replies).
  351. **/
  352.  
  353. #define USE_EMBEDDED_ADDRESSES    
  354.  
  355.  
  356. #define FIND_DELTA    10        /* byte region where the binary search
  357.                        on the path alias file is fruitless 
  358.                                            (can't be within this boundary)    */
  359.  
  360. #define MAX_HEADERS    >500<    /* max number of messages in one file!   */    
  361. #define MAX_SALIASES    >503<    /* number of system aliases allowed      */
  362. #define MAX_UALIASES    >251<    /* number of user aliases allowed      */
  363. #define MAX_IN_WEEDLIST >150<    /* max headers to weed out               */
  364.  
  365. #define MAX_HOPS    35    /* max hops in return addr to E)veryone  */
  366.  
  367. #define MAX_ATTEMPTS    >6<    /* #times to attempt lock file creation */
  368.  
  369. /** see leavembox.c to determine if this should be defined or not....The 
  370.     default is to NOT have it defined.
  371. **/
  372.  
  373. #define REMOVE_AT_LAST
  374.  
  375. #define DEFAULT_BATCH_SUBJECT  "no subject (file transmission)"
  376.  
  377. /** If you want to have the mailer know about valid mailboxes on the
  378.     host machine (assumes no delivery agent aliases) then you should
  379.     undefine this (the default is to have it defined)...
  380. **/
  381.  
  382. #define NOCHECK_VALIDNAME
  383.  
  384. /** If your machine doesn't have virtual memory (specifically the vfork() 
  385.     command) then you should define the following....        
  386. **/
  387.  
  388. /** #define NO_VM **/
  389.  
  390.  
  391. /** If you want the mailer to check the pathalias database BEFORE it
  392.     looks to see if a specified machine is in the L.sys database (in
  393.     some cases routing is preferable to direct lines) then you should
  394.     define the following...
  395. **/
  396.  
  397. #define LOOK_CLOSE_AFTER_SEARCH
  398.  
  399.  
  400. /** If you'd rather the program automatically used the 'uuname' command
  401.     to figure out what machines it talks to (instead of trying to get
  402.     it from L.sys first) then define the following...
  403. **/
  404.  
  405. #define USE_UUNAME
  406.  
  407.  
  408. /** If you'd like "newmail" to automatically go into background when you
  409.     start it up (instead of the "newmail &" junk with the process id output,
  410.     then define the following...
  411. **/
  412.  
  413. #define AUTO_BACKGROUND
  414.  
  415. /** If you'd rather your mail transport agent (ie sendmail) put the From:
  416.     line into the message, define the following...
  417. **/
  418.  
  419. #define DONT_ADD_FROM
  420.  
  421. /** If your machine prefers the Internet notation of user@host for the
  422.     From: line and addresses, define the following...(the default is to 
  423.     use this rather than the USENET notation - check your pathalias file!)
  424.  
  425. **/
  426.  
  427. #define INTERNET_ADDRESS_FORMAT
  428.  
  429. /** If you're on a machine that prefers UUCP to Internet addresses, then
  430.     define the following (the basic change is that on a machine that
  431.     receives messages of the form <path>!user@<localhost> the displayed
  432.     address will be <path>!user instead of user@<localhost>.
  433.  
  434.     BOGUS_INTERNET is the address that your local system appends to 
  435.     messages occasionally.  The algorithm is simply to REMOVE the
  436.     BOGUS_INTERNET string.  This is horrible.  *sigh*
  437.  
  438. **/
  439.  
  440. #define PREFER_UUCP
  441. #define BOGUS_INTERNET    "@hplabs.HP.COM"
  442.  
  443. /** If you're running ACSNET and/or want to have your domain name
  444.     attached to your hostname on outbound mail then you can define
  445.     the following (default are not defined)
  446. **/
  447.  
  448. #define USE_DOMAIN
  449. #define DOMAIN        "<enter your domain here>"
  450.  
  451. /** If you are going to be running the mailer with setgid mail (or
  452.     something similar) you'll need to define the following to ensure
  453.     that the users mailbox in the spool directory has the correct
  454.     group (NOT the users group)
  455. **/
  456.  
  457. #define SAVE_GROUP_MAILBOX_ID
  458.  
  459. /** If you want a neat feature that enables scanning of the message
  460.     body for entries to add to the users ".calendar" (or whatever)
  461.     file, define this.
  462. **/
  463.  
  464. #define ENABLE_CALENDAR
  465. #define dflt_calendar_file    "calendar"    /* in HOME directory */
  466.  
  467. /** If you want to implement 'site hiding' in the mail, then you'll need to
  468.     uncomment the following lines and set them to reasonable values.  See 
  469.     the configuration guide for more details....
  470. **/
  471.  
  472. /****************************************************************************
  473.  
  474. #undef    DONT_ADD_FROM        
  475.  
  476. #define   SITE_HIDING
  477. #define   HIDDEN_SITE_NAME    "fake-machine-name"
  478. #define   HIDDEN_SITE_USERS    "/usr/mail/lists/hidden_site_users"
  479.  
  480. ****************************************************************************/
  481.  
  482. /** Do we have the 'gethostname()' call?  If not, define the following **/
  483. /** #define NEED_GETHOSTNAME **/
  484.  
  485. /** are you stuck on a machine that has short names?  If so, define the
  486.     following **/
  487.  
  488. /** #define SHORTNAMES **/
  489.  
  490. #define NOTES_HEADER        "/***** "
  491. #define NOTES_FOOTER        "/* ---------- */"
  492.  
  493. #ifdef BSD
  494. # define system_hash_file    "/usr/spool/mail/.alias_hash"
  495. # define system_data_file    "/usr/spool/mail/.alias_data"
  496. #else
  497. # define system_hash_file    "/usr/mail/.alias_hash"
  498. # define system_data_file    "/usr/mail/.alias_data"
  499. #endif
  500.  
  501. #define pathfile        "/usr/lib/nmail.paths"
  502. #define domains            "/usr/lib/domains"
  503.  
  504. #define Lsys            "/usr/lib/uucp/L.sys"
  505.  
  506. /** where to put the output of the elm -d command... (in home dir) **/
  507. #define DEBUG        "ELM:debug.info"
  508.  
  509. #define temp_file    "/tmp/snd."
  510. #define temp_mbox    "/tmp/mbox."
  511. #define temp_print      "/tmp/print."
  512. #define mailtime_file    ".last_read_mail"
  513. #define readmsg_file    ".readmsg"
  514. #define signature_file    ".signature"
  515.  
  516. #ifdef BSD
  517. # define default_editor    "/usr/ucb/vi"
  518. # define mailhome    "/usr/spool/mail/"
  519. #else
  520. # define default_editor    "/usr/bin/vi"
  521. # define mailhome    "/usr/mail/"
  522. #endif
  523.  
  524. # define default_pager    "builtin"
  525.  
  526. #define sendmail    "/usr/lib/sendmail"
  527. #define smflags        "-oi"
  528. #define mailer        "/bin/rmail"
  529. #ifdef BSD
  530. # define mailx        "/usr/ucb/Mail"
  531. #else
  532. # define mailx        "/usr/bin/mailx"
  533. #endif
  534.  
  535. #define helphome    "/usr/local/lib"
  536. #define helpfile    "elm-help.main"
  537.  
  538. #define elmrcfile    "/.elmrc"
  539. #define mailheaders    ".elmheaders"
  540. #define dead_letter    "Cancelled.mail"
  541.  
  542. #define unedited_mail    "emergency.mbox"
  543.  
  544. #define newalias    "newalias -q 1>&2 > /dev/null"
  545. #define readmsg        "readmsg"
  546.  
  547. #define remove        "/bin/rm -f"        /* how to remove a file */
  548. #define cat        "/bin/cat"        /* how to display files */
  549. #define uuname        "uuname"        /* how to get a uuname  */
  550. END_OF_FILE
  551.  
  552. chars=`cat hdrs/sysdefs.master | wc -c`
  553.  
  554. if [ $chars -ne 6490 ]
  555. then
  556.   echo File damaged in transit...should be 6490 bytes, is $chars instead
  557.   echo  I suggest you check it closely...
  558. fi
  559.  
  560. #---------------------------------
  561. # File Elm/hdrs/shortnames.h is new!
  562.  
  563. echo File Elm/hdrs/shortnames.h is new - extracting...
  564. if [ -f hdrs/shortnames.h ]
  565. then
  566.   echo File \'hdrs/shortnames.h\' is new, but you already have something called that\!
  567.   echo I\'m going to move your file to \'hdrs/shortnames.h.old\'...
  568.   /bin/mv -f hdrs/shortnames.h hdrs/shortnames.h.old
  569. else
  570.   echo Extracting new file \'hdrs/shortnames.h\'
  571. fi
  572.  
  573. cat > hdrs/shortnames.h << 'END_OF_FILE'
  574. /**            shortnames.h            **/
  575.  
  576. /** This file is from Geoff Kuenning, and will help those poor users that
  577.     are stuck using C compilers that don't have flexnames.   Too bad.
  578.  
  579.     This file has no explicit copyright.
  580.  
  581. **/
  582.  
  583. #define PutLine0        PLine0
  584. #define PutLine1        PLine1
  585. #define PutLine2        PLine2
  586. #define PutLine3        PLine3
  587.  
  588. #define add_to_table        add_2_table
  589. #define address1        addrs1
  590. #define addressII        addrsII
  591. #define addresses        addr_s
  592. #define alternate_prompt    alt_prompt
  593. #define alternative_addresses    alt_addrs
  594. #define always_leave        alw_leave
  595.  
  596. #define calendar_line        cal_line
  597. #define cancelled_msg        cncld_msg
  598. #define central_message_buffer    cntrl_bfr
  599. #define compare_dates        cmp_dates
  600. #define compare_headers        cmp_hdrs
  601. #define copy_message_across    cpy_msg_across
  602. #define current_record        cur_rec
  603. #define current_time        cur_time
  604.  
  605. #define define_softkeys        def_softkeys
  606. #define display_central_message    displ_cntrl_msg
  607. #define display_error        displ_error
  608. #define display_headers        displ_hdrs
  609. #define display_helpfile    dspl_helpfile
  610. #define display_options        displ_options
  611. #define display_title        displ_titles
  612. #define display_to        displ_to
  613.  
  614. #define encrypted        crypted
  615. #define encrypted_key        crypt_key
  616. #define expanded_cc        xp_cc
  617. #define expanded_to        xp_to
  618. #define expand_address        xp_addr
  619. #define expand_domain        xp_domain
  620. #define expand_env        xp_env
  621. #define expand_filename        xp_filename
  622. #define expand_group        xp_group
  623. #define expand_logname        xp_logname
  624. #define expand_site        xp_site
  625. #define expand_system        xp_system
  626.  
  627. #define filename2        fn2
  628. #define forward            forwrd
  629.  
  630. #define generate_reply_to    gen_reply_to
  631. #define get_return_name        g_ret_name
  632.  
  633. #define header_line        h_line
  634. #define header_page        h_page
  635. #define headers_per_page    h_per_page
  636. #define header_table        h_table
  637.  
  638. #define install_aliases        ins_aliases
  639.  
  640. #define last_line_loc        last_ln_loc
  641.  
  642. #define machine_group        mach_group
  643. #define mailbox_defined        mbox_defined
  644. #define mailfile_size        mfile_size
  645. #define message_count        msg_count
  646. #define message_number        msg_number
  647.  
  648. #define newaliases        nwaliases
  649. #define noptimize_return    noret_opt
  650. #define noptimize_usenet    nousenet_opt
  651.  
  652. #define optimize_and_add    opt_and_add
  653. #define optimize_arpa        opt_arpa
  654. #define optimize_cmplx_arpa    opt_cmplx_arpa
  655. #define optimize_return        opt_return
  656. #define optimize_usenet        opt_usenet
  657. #define optional_arg        opt_arg
  658. #define optionally_enter    opt_enter
  659. #define original_cc        orig_cc
  660. #define original_msg_num    orig_msg_num
  661. #define original_to        orig_to
  662.  
  663. #define parse_arguments        pars_arguments
  664. #define parse_arpa_from        prs_arpa_from
  665. #define password_entry        pw_entry
  666. #define pattern_enter        pat_enter
  667. #define pattern_match        pat_match
  668.  
  669. #define read_alias_files    rd_alias_files
  670. #define read_headers        rd_headers
  671. #define read_notesfile        rd_notesfile
  672. #define read_rc            rd_rc
  673. #define read_rc_file        rd_rc_file
  674. #define received_on_machine    rcvd_on_machine
  675. #define remove_all        rem_all
  676. #define remove_first_word    rem_1st_word
  677. #define remove_domains        rem_domains
  678. #define remove_header        rem_hdr
  679. #define remove_user        rem_user
  680. #define remove_through_ch    rem_thru_ch
  681. #define reply_to_everyone    repl_to_everyone
  682. #define resolve_received    rslv_received
  683.  
  684. #define show_message        shw_message
  685. #define show_msg        showmsg
  686. #define show_msg_tag        sh_msg_tag
  687. #define size_of_pathfd        sz_of_pathfd
  688. #define softkeys_off        soft_off
  689. #define softkeys_on        soft_on
  690. #define subjectbuffer        subjbuff
  691. #define subject_matches        subj_matches
  692. #define system_call        sys_call
  693. #define system_data        sys_data
  694. #define system_files        sys_files
  695. #define system_hash_table    sys_hash_table
  696. #define system_record        sys_record
  697.  
  698. #define tail_of_string        tl_of_string
  699. #define talk_to_sys        tlk_to_sys
  700. #define tempfile        tmpfile
  701. #define termcap_label        tcap_label
  702. #define top_of_screen_left    top_left_of_screen
  703. #define top_of_screen_right    top_right_of_screen
  704. #define translate_return    xlate_return
  705.  
  706. #define update_mailtime        upd_mailtime
  707. #define update_title        upd_title
  708. #define unexpanded_cc        unexp_cc
  709. #define unexpanded_to        unexp_to
  710.  
  711. #define verify_transmission    vfy_xmsn
  712.  
  713. #define weeding_out        wding_out
  714. END_OF_FILE
  715.  
  716. chars=`cat hdrs/shortnames.h | wc -c`
  717.  
  718. if [ $chars -ne 4006 ]
  719. then
  720.   echo File damaged in transit...should be 4006 bytes, is $chars instead
  721.   echo  I suggest you check it closely...
  722. fi
  723.  
  724. #-------------------------------------
  725. # File 'utils/arepdaemon.c' diffs...
  726.  
  727. cat << 'EOF' > utils/arepdaemon.D
  728. 59,60d
  729. 37c
  730.  
  731. #ifdef BSD
  732. # include <sys/time.h>
  733. #else
  734. # include <time.h>
  735. #endif
  736.  
  737. .
  738. w
  739. EOF
  740.  
  741. chars=`cat utils/arepdaemon.c | wc -c`
  742.  
  743. if [ $chars -ne 13380 ]
  744. then
  745.   echo Your file utils/arepdaemon.c has been changed\!
  746.   echo diffs saved as \"utils/arepdaemon.D\"
  747. else
  748.   echo applying diffs to file utils/arepdaemon.c...
  749.   /bin/cat utils/arepdaemon.D | /bin/ed - utils/arepdaemon.c
  750. fi
  751.  
  752. #-------------------------------------
  753. # File 'utils/autoreply.c' diffs...
  754.  
  755. cat << 'EOF' > utils/autoreply.D
  756. 24,25d
  757. w
  758. EOF
  759.  
  760. chars=`cat utils/autoreply.c | wc -c`
  761.  
  762. if [ $chars -ne 4746 ]
  763. then
  764.   echo Your file utils/autoreply.c has been changed\!
  765.   echo diffs saved as \"utils/autoreply.D\"
  766. else
  767.   echo applying diffs to file utils/autoreply.c...
  768.   /bin/cat utils/autoreply.D | /bin/ed - utils/autoreply.c
  769. fi
  770.  
  771. #-------------------------------------
  772. # File 'utils/fastmail.c' diffs...
  773.  
  774. cat << 'EOF' > utils/fastmail.D
  775. 218a
  776. #  endif
  777. .
  778. 217a
  779. #  ifdef BSD4.1
  780.       timezone(loc_time.time_zone, the_time->tz_isdst));
  781. #  else
  782. .
  783. 203a
  784. #  endif
  785. .
  786. 201a
  787. #  ifdef BSD4.1
  788.     junk = (long) time((long *) 0);
  789.     ftime(&loc_time);
  790. #  else
  791. .
  792. 198a
  793. #  endif
  794. .
  795. 196a
  796. #  ifdef BSD4.1
  797.     struct timeb loc_time;    /* of course this is different! */
  798. #  else
  799. .
  800. 32c
  801. # ifdef BSD4.1
  802. #   include <time.h>
  803. #   include <sys/types.h>
  804. #   include <sys/timeb.h>
  805. # else
  806. #   include <sys/time.h>
  807. # endif
  808. .
  809. w
  810. EOF
  811.  
  812. chars=`cat utils/fastmail.c | wc -c`
  813.  
  814. if [ $chars -ne 7799 ]
  815. then
  816.   echo Your file utils/fastmail.c has been changed\!
  817.   echo diffs saved as \"utils/fastmail.D\"
  818. else
  819.   echo applying diffs to file utils/fastmail.c...
  820.   /bin/cat utils/fastmail.D | /bin/ed - utils/fastmail.c
  821. fi
  822.  
  823. #-------------------------------------
  824. # File 'utils/newmail.c' diffs...
  825.  
  826. cat << 'EOF' > utils/newmail.D
  827. 251c
  828.       printf(">> %s mail from %s - %s\n\r", 
  829.         priority? "PRIORITY" : "New", from, subject);
  830. .
  831. 218c
  832. show_header(priority, from, subject)
  833. int   priority;
  834. .
  835. 136c
  836.           show_header(priority, from_whom, subject);
  837. .
  838. 131a
  839.         else if (first_word(buffer,"Priority:")) 
  840.           priority++;
  841. .
  842. 113c
  843.     register int subj = 0, in_header = 1, count = 0, priority=0;
  844. .
  845. 29a
  846. #ifdef AUTO_BACKGROUND
  847. #include <signal.h>    /* background jobs ignore some signals... */
  848. #endif
  849.  
  850. .
  851. 20,23d
  852. w
  853. EOF
  854.  
  855. chars=`cat utils/newmail.c | wc -c`
  856.  
  857. if [ $chars -ne 7761 ]
  858. then
  859.   echo Your file utils/newmail.c has been changed\!
  860.   echo diffs saved as \"utils/newmail.D\"
  861. else
  862.   echo applying diffs to file utils/newmail.c...
  863.   /bin/cat utils/newmail.D | /bin/ed - utils/newmail.c
  864. fi
  865.  
  866. #-------------------------------------
  867. # File 'utils/newalias.c' diffs...
  868.  
  869. cat << 'EOF' > utils/newalias.D
  870. 453a
  871. }
  872.  
  873. extract_comment(comment, buffer, first, last)
  874. char *comment, *buffer;
  875. int first, last;
  876. {
  877.     /** Buffer contains a comment, located between the first and last
  878.         values.  Copy that into 'comment', but remove leading and
  879.         trailing white space.  Note also that it doesn't copy past
  880.         a comma, so `unpublishable' comments can be of the form;
  881.         dave: Dave Taylor, HP Labs : taylor@hplabs
  882.         and the output will be "taylor@hplabs (Dave Taylor)".
  883.     **/
  884.  
  885.     register int loc = 0; 
  886.  
  887.     /** first off, skip the LEADING white space... **/
  888.  
  889.     while (buffer[first] == ' ') first++;
  890.     
  891.     /** now let's backup the 'last' value until we hit a non-space **/
  892.  
  893.     last -= 2;    /* starts at ch AFTER colon.. */
  894.     while (buffer[last] == ' ') last--;
  895.  
  896.     /** now a final check to make sure we're still talking about a 
  897.         reasonable string (rather than a "joe :: joe@dec" type string) **/
  898.  
  899.     if (first < last) {
  900.       /* one more check - let's find the comma, if present... */
  901.       for (loc=first; loc < last; loc++)
  902.         if (buffer[loc] == ',') {
  903.           last = loc-1;
  904.           break;
  905.       }
  906.       loc = 0;
  907.       while (first <= last)
  908.         comment[loc++] = buffer[first++];
  909.       comment[loc] = '\0';
  910.     }
  911. .
  912. 311a
  913.       if (first_colon == -1 && string[i] == ':') {
  914.         first_colon = i;
  915.         for (last_colon=strlen(string);string[last_colon] != ':'; 
  916.         last_colon--) ;
  917.       }
  918.       else if (i > first_colon && i < last_colon)
  919.        if (string[i] == c1 || string[i] == c2)
  920.          buffer[j++] = string[i];
  921.     }
  922.     
  923. .
  924. 308c
  925.     for (i = 0; string[i] != '\0' && i < LONG_STRING; i++) {
  926. .
  927. 306c
  928.     register int i = 0, j = 0, first_colon = -1, last_colon = -1;
  929. .
  930. 304c
  931.     /* Remove all occurances of character 'c1' or 'c2' from the string.
  932.        Hacked (literally) to NOT remove ANY characters from within the
  933.        colon fields.  This will only be used if the line contains TWO
  934.        colons (and comments with colons in them are the kiss of death!)
  935.      */
  936.  
  937. .
  938. 284c
  939.       if (strlen(comment) > 0) {
  940.         fprintf(data, "%s (%s)\n", address, comment);
  941.         additive = (long) (strlen(comment) + 4);
  942.       }
  943.       else
  944.         fprintf(data, "%s\n", address, comment);
  945. .
  946. 267,268c
  947.     /** add address + comment to datafile, incrementing offset count 
  948.         (bytes), then for each alias in the aliases string, add to the
  949. .
  950. 263c
  951. char *aliases, *comment, *address;
  952. .
  953. 261c
  954. add_to_table(data, aliases, comment, address, table, size)
  955. .
  956. 212c
  957.     add_to_table(data, aliases, comment, address, table, size);
  958. .
  959. 209a
  960.     comment[0] = '\0';    /* default to nothing at all... */
  961.  
  962.     if ((first=strlen(aliases)+1) < (last=(strlen(buffer) - j))) {
  963.       extract_comment(comment, buffer, first, last); 
  964.     }
  965.  
  966. .
  967. 198c
  968.     char comment[LONG_STRING];
  969.     int  first, last, i = 0, j = 0;
  970. .
  971. 193,195c
  972.     /** break buffer down into three pieces: aliases, comment, and address.
  973.         Make the appropriate entries in the table (size) 
  974.     **/
  975. .
  976. w
  977. EOF
  978.  
  979. chars=`cat utils/newalias.c | wc -c`
  980.  
  981. if [ $chars -ne 11051 ]
  982. then
  983.   echo Your file utils/newalias.c has been changed\!
  984.   echo diffs saved as \"utils/newalias.D\"
  985. else
  986.   echo applying diffs to file utils/newalias.c...
  987.   /bin/cat utils/newalias.D | /bin/ed - utils/newalias.c
  988. fi
  989.  
  990. #-------------------------------------
  991. # File 'utils/printmail.c' diffs...
  992.  
  993. cat << 'EOF' > utils/printmail.D
  994. 72,73c
  995.       argv++;
  996.       if (argc-1) {
  997. .
  998. 34c
  999.         argv++;
  1000. .
  1001. 28c
  1002.     argv++;                /* get past argv[0] */
  1003. .
  1004. w
  1005. EOF
  1006.  
  1007. chars=`cat utils/printmail.c | wc -c`
  1008.  
  1009. if [ $chars -ne 2472 ]
  1010. then
  1011.   echo Your file utils/printmail.c has been changed\!
  1012.   echo diffs saved as \"utils/printmail.D\"
  1013. else
  1014.   echo applying diffs to file utils/printmail.c...
  1015.   /bin/cat utils/printmail.D | /bin/ed - utils/printmail.c
  1016. fi
  1017.  
  1018. #-------------------------------------
  1019. # File 'utils/readmsg.c' diffs...
  1020.  
  1021. cat << 'EOF' > utils/readmsg.D
  1022. 317a
  1023.     if (strlen(to)      > 0) { printf("%s", to);      displayed_line++;}
  1024. .
  1025. 304a
  1026.       to[0] = '\0';
  1027. .
  1028. 301a
  1029.     else if (strncmp(buffer,"To: ", 3) == 0)
  1030.       strncpy(to, buffer, SLEN);
  1031. .
  1032. 287c
  1033. static char from[SLEN], subject[SLEN], date[SLEN], to[SLEN];
  1034. .
  1035. 200c
  1036.       if (current == read_message[current_in_queue] || list_all_messages)
  1037. .
  1038. 195,196c
  1039.         if ((current == read_message[current_in_queue] || list_all_messages)
  1040.                 && page_breaks && current_in_queue > 0)
  1041. .
  1042. 190,193c
  1043.         if (! list_all_messages) {
  1044.           if (current == read_message[current_in_queue])
  1045.             current_in_queue++;
  1046.           if (current_in_queue >= messages) 
  1047.             exit(0);
  1048.         }
  1049. .
  1050. 124c
  1051.     else if (*argv[0] == STAR)         /* all messages....   */
  1052.       list_all_messages++;
  1053.     else {                       /* list of nums   */
  1054. .
  1055. 117c
  1056.     else if (! isdigit(*argv[0]) && *argv[0] != LAST_CHAR && 
  1057.              *argv[0] != STAR) {  
  1058. .
  1059. 67a
  1060.         list_all_messages = 0,        /* just list 'em all??       */
  1061. .
  1062. 42a
  1063. #define  STAR        '*'        /* char to delimit all messages...  */
  1064. .
  1065. 21a
  1066.     Also added '*' as a flag - indicating ALL messages in the mailbox.
  1067.  
  1068. .
  1069. 18c
  1070.     
  1071. .
  1072. w
  1073. EOF
  1074.  
  1075. chars=`cat utils/readmsg.c | wc -c`
  1076.  
  1077. if [ $chars -ne 9564 ]
  1078. then
  1079.   echo Your file utils/readmsg.c has been changed\!
  1080.   echo diffs saved as \"utils/readmsg.D\"
  1081. else
  1082.   echo applying diffs to file utils/readmsg.c...
  1083.   /bin/cat utils/readmsg.D | /bin/ed - utils/readmsg.c
  1084. fi
  1085.  
  1086. #-------------------------------------
  1087. # File 'utils/wnewmail.c' diffs...
  1088.  
  1089. cat << 'EOF' > utils/wnewmail.D
  1090. 249c
  1091.     /** Try to parse the 'From:' line given... It can be in one of
  1092. .
  1093. 243c
  1094.         printf("%sMail from %s -- %s\n", 
  1095.            priority? "PRIORITY ": "", from, subject);
  1096. .
  1097. 208c
  1098. show_header(priority, from, subject)
  1099. int   priority;
  1100. .
  1101. 126c
  1102.           show_header(priority, from_whom, subject);
  1103. .
  1104. 123a
  1105.         else if (first_word(buffer, "Priority:"))
  1106.           priority++;
  1107. .
  1108. 103c
  1109.     register int subj = 0, in_header = 1, count = 0, priority = 0;
  1110. .
  1111. 17a
  1112. #ifdef AUTO_BACKGROUND
  1113. #include <signal.h>    /* background jobs ignore some signals... */
  1114. #endif
  1115.  
  1116. .
  1117. 8,11d
  1118. w
  1119. EOF
  1120.  
  1121. chars=`cat utils/wnewmail.c | wc -c`
  1122.  
  1123. if [ $chars -ne 7804 ]
  1124. then
  1125.   echo Your file utils/wnewmail.c has been changed\!
  1126.   echo diffs saved as \"utils/wnewmail.D\"
  1127. else
  1128.   echo applying diffs to file utils/wnewmail.c...
  1129.   /bin/cat utils/wnewmail.D | /bin/ed - utils/wnewmail.c
  1130. fi
  1131.  
  1132. #---------------------------------
  1133. # File Elm/utils/trim-headers is new!
  1134.  
  1135. echo File Elm/utils/trim-headers is new - extracting...
  1136. if [ -f utils/trim-headers ]
  1137. then
  1138.   echo File \'utils/trim-headers\' is new, but you already have something called that\!
  1139.   echo I\'m going to move your file to \'utils/trim-headers.old\'...
  1140.   /bin/mv -f utils/trim-headers utils/trim-headers.old
  1141. else
  1142.   echo Extracting new file \'utils/trim-headers\'
  1143. fi
  1144.  
  1145. cat > utils/trim-headers << 'END_OF_FILE'
  1146. : Use /bin/sh
  1147.  
  1148. # This shell script is designed to be used either to trim the 'junk' headers
  1149. # out of an archived/saved mailbox file or to trim the headers off a file 
  1150. # that is being piped to it.  The program considers the following headers
  1151. # to be worth saving - everything else is junked.
  1152. #
  1153. #    From <user> <date>
  1154. #    From: name <address>
  1155. #    Subject:
  1156. #    To: 
  1157. #    Cc:
  1158. #    Date:
  1159. #
  1160. # all others are ignored and trashed.
  1161. #
  1162. # (C) Copyright 1986, Dave Taylor
  1163.  
  1164. # first off, let's make the 'awk' script we'll be using...
  1165.  
  1166. cat << 'END_OF_AWK_SCRIPT' > /tmp/awk.$$
  1167. BEGIN { in_body = 1 }
  1168. {    if (in_body) {
  1169.       if ($1 == "From") in_body = 0;
  1170.       print $0
  1171.     }
  1172.     else if ($1 == "From:" || $1 == "Subject:" || $1 == "To:" || \
  1173.              $1 == "Cc:" || $1 == "Date:")
  1174.       print $0
  1175.     else if (length($0) == 0) {
  1176.       in_body = 1;
  1177.       print $0
  1178.     }
  1179. }
  1180. END_OF_AWK_SCRIPT
  1181.  
  1182. # next let's see if we're being piped to or if we've been handed
  1183. # either a file name or list of file names...
  1184.  
  1185. if [ "$1" = "" ]
  1186. then
  1187.   cat - | awk -f /tmp/awk.$$ | uniq
  1188.   rm -f /tmp/awk.$$
  1189. else
  1190.   for filename in $*
  1191.   do
  1192.     echo filtering file $filename
  1193.     cat $filename | awk -f /tmp/awk.$$ | uniq > OUTFILE
  1194.     mv OUTFILE $filename
  1195.   done
  1196.   echo done
  1197. fi
  1198.   
  1199. exit 0 
  1200. END_OF_FILE
  1201.  
  1202. chars=`cat utils/trim-headers | wc -c`
  1203.  
  1204. if [ $chars -ne 1201 ]
  1205. then
  1206.   echo File damaged in transit...should be 1201 bytes, is $chars instead
  1207.   echo  I suggest you check it closely...
  1208. fi
  1209.  
  1210. #---------------------------------
  1211. # File Elm/utils/Makefile.mstr is new!
  1212.  
  1213. echo File Elm/utils/Makefile.mstr is new - extracting...
  1214. if [ -f utils/Makefile.mstr ]
  1215. then
  1216.   echo File \'utils/Makefile.mstr\' is new, but you already have something called that\!
  1217.   echo I\'m going to move your file to \'utils/Makefile.mstr.old\'...
  1218.   /bin/mv -f utils/Makefile.mstr utils/Makefile.mstr.old
  1219. else
  1220.   echo Extracting new file \'utils/Makefile.mstr\'
  1221. fi
  1222.  
  1223. cat > utils/Makefile.mstr << 'END_OF_FILE'
  1224. #
  1225. #  Makefile for the Elm system utilities
  1226. #
  1227. #         (C) Copyright 1986, Dave Taylor
  1228. #
  1229. #  Last modification: March 5th, 1986
  1230.  
  1231. SHELL=/bin/sh
  1232.  
  1233. ##############################
  1234. #
  1235. # if on a BSD system;
  1236. #   DEFINE=-DBSD
  1237. #   LIB2  = -lcurses
  1238. # else if on a UTS system;
  1239. #   DEFINE=-DUTS
  1240. #   LIB2  = -la
  1241. # else if on a SUN system;
  1242. #   DEFINE=-DBSD -DSUN
  1243. #   LIB2  = -lcurses
  1244. # else if on a Pyramid system;
  1245. #   DEFINE=-DBSD -DNO_VAR_ARGS
  1246. #   LIB2  = -lcurses
  1247. # else
  1248.  
  1249.     DEFINE= >os-define<
  1250.     LIB2  = >lib2<
  1251.  
  1252. ##############################
  1253.  
  1254. CFLAGS= -O -I../hdrs
  1255. CC=    >cc<
  1256. RM=     >rm<
  1257. ECHO=  /bin/echo
  1258.  
  1259. OBJS=    ../bin/newalias ../bin/from ../bin/newmail ../bin/answer       \
  1260.     ../bin/printmail ../bin/fastmail ../bin/readmsg                \
  1261.     ../bin/checkalias ../bin/arepdaemon ../bin/autoreply ../bin/wnewmail \
  1262.     ../bin/messages ../bin/trim-headers
  1263.  
  1264. all: ${OBJS}
  1265.  
  1266. ../bin/newalias:  ../hdrs/defs.h newalias.c ../src/validname.o \
  1267.     ../src/opt_utils.o
  1268.     ${CC} ${CFLAGS} ${DEFINE} newalias.c ../src/validname.o \
  1269.     ../src/opt_utils.o -o ../bin/newalias 
  1270.  
  1271. ../bin/from: from.c ../src/opt_utils.o ../src/string2.o
  1272.     ${CC} ${CFLAGS} ${DEFINE} from.c ../src/opt_utils.o \
  1273.     ../src/string2.o -o ../bin/from
  1274.  
  1275. ../bin/newmail: ../src/opt_utils.c newmail.c ../src/string2.o
  1276.     ${CC} ${CFLAGS} ${DEFINE} newmail.c \
  1277.     ../src/string2.o -o ../bin/newmail
  1278.  
  1279. ../bin/wnewmail: ../src/opt_utils.c wnewmail.c ../src/string2.o
  1280.     ${CC} ${CFLAGS} ${DEFINE} ../src/opt_utils.o \
  1281.     ../src/string2.o wnewmail.c -o ../bin/wnewmail
  1282.  
  1283. ../bin/answer: answer.c ../src/opt_utils.o
  1284.     ${CC} ${CFLAGS} ${DEFINE} answer.c ../src/opt_utils.o -o ../bin/answer
  1285.  
  1286. ../bin/printmail: printmail.c ../src/opt_utils.o
  1287.     ${CC} ${CFLAGS} ${DEFINE} printmail.c ../src/opt_utils.o \
  1288.     -o ../bin/printmail
  1289.  
  1290. ../bin/fastmail: fastmail.c 
  1291.     ${CC} ${CFLAGS} ${DEFINE} fastmail.c ../src/opt_utils.o \
  1292.     -o ../bin/fastmail
  1293.  
  1294. ../bin/readmsg: readmsg.c ../src/getopt.o ../src/opt_utils.o
  1295.     ${CC} ${CFLAGS} ${DEFINE} readmsg.c ../src/getopt.o \
  1296.     ../src/opt_utils.o -o ../bin/readmsg
  1297.  
  1298. ../bin/arepdaemon: arepdaemon.c
  1299.     ${CC} ${CFLAGS} ${DEFINE} arepdaemon.c -o ../bin/arepdaemon
  1300.  
  1301. ../bin/autoreply: autoreply.c ../src/opt_utils.o
  1302.     ${CC} ${CFLAGS} ${DEFINE} autoreply.c ../src/opt_utils.o \
  1303.     -o ../bin/autoreply
  1304.  
  1305. ../bin/checkalias: 
  1306.     @echo ': Use /bin/sh' > ../bin/checkalias
  1307.     @echo 'if [ "$$*" = "" ]; then' >> ../bin/checkalias
  1308.     @echo '  echo Usage: checkalias alias \[or aliases\]' >>  \
  1309.           ../bin/checkalias
  1310.     @echo '  exit 1' >> ../bin/checkalias
  1311.     @echo 'fi' >> ../bin/checkalias
  1312.     @echo ' '  >> ../bin/checkalias
  1313.     @echo 'exec elm -c $$*' >> ../bin/checkalias
  1314.     @chmod +x ../bin/checkalias
  1315.  
  1316. ../bin/messages: 
  1317.     @echo ': Use /bin/sh'                  > ../bin/messages
  1318.     @echo 'if [ "$$2" != "" ]; then'         >> ../bin/messages
  1319.     @echo '  echo Usage: messages \{folder-name\}'  >> ../bin/messages
  1320.     @echo '  exit 1'                 >> ../bin/messages
  1321.     @echo 'fi'                     >> ../bin/messages
  1322.     @echo ' '                      >> ../bin/messages
  1323.     @echo 'if [ "$$1" = "" ]; then'         >> ../bin/messages
  1324.     @echo '  fname=$$MAIL'                 >> ../bin/messages
  1325.     @echo '  optional="in your mailbox"'          >> ../bin/messages
  1326.     @echo 'else'                     >> ../bin/messages
  1327.     @echo '  fname=$$1'                >> ../bin/messages
  1328.     @echo '  optional="in folder $$1"'         >> ../bin/messages
  1329.     @echo 'fi'                           >> ../bin/messages
  1330.     @echo ' '                    >> ../bin/messages
  1331.     @echo 'mcount=`egrep "^From " $$fname | wc -l`' >> ../bin/messages
  1332.     @echo ' '                    >> ../bin/messages
  1333.     @echo 'if [ $$mcount = 1 ];then'        >> ../bin/messages
  1334.     @echo '  echo There is $$mcount message $$optional' >> ../bin/messages
  1335.     @echo 'else'                    >> ../bin/messages
  1336.     @echo '  echo There are $$mcount messages $$optional' >> ../bin/messages
  1337.     @echo 'fi'                    >> ../bin/messages
  1338.     @echo ' '                    >> ../bin/messages
  1339.     @echo 'exit 0'                    >> ../bin/messages
  1340.     @chmod +x ../bin/messages
  1341.  
  1342. ../bin/trim-headers:
  1343.     @cp trim-headers ../bin/trim-headers
  1344.     @chmod +x ../bin/trim-headers
  1345.  
  1346. ../src/validname.o: ../src/validname.c ../hdrs/defs.h
  1347.     @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} validname.c; cd ../utils)
  1348.  
  1349. ../src/opt_utils.o: ../src/opt_utils.c ../hdrs/defs.h
  1350.     @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} opt_utils.c; cd ../utils)
  1351.  
  1352. ../src/getopt.o: ../src/getopt.c ../hdrs/defs.h
  1353.     @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} getopt.c; cd ../utils)
  1354.  
  1355. ../src/string2.o: ../src/string2.c ../hdrs/defs.h
  1356.     @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} string2.c; cd ../utils)
  1357.  
  1358. clean:
  1359.     ${RM} *.o ${OBJS}
  1360.  
  1361. lint:
  1362.     lint -p -I../hdrs *.c > LINT.OUT
  1363. END_OF_FILE
  1364.  
  1365. chars=`cat utils/Makefile.mstr | wc -c`
  1366.  
  1367. if [ $chars -ne 4391 ]
  1368. then
  1369.   echo File damaged in transit...should be 4391 bytes, is $chars instead
  1370.   echo  I suggest you check it closely...
  1371. fi
  1372.  
  1373. #-------------------------------------
  1374. # File 'bin/mail.elm' diffs...
  1375.  
  1376. cat << 'EOF' > bin/mail.elm.D
  1377. 16c
  1378.   sleep 1800
  1379. .
  1380. w
  1381. EOF
  1382.  
  1383. chars=`cat bin/mail.elm | wc -c`
  1384.  
  1385. if [ $chars -ne 363 ]
  1386. then
  1387.   echo Your file bin/mail.elm has been changed\!
  1388.   echo diffs saved as \"bin/mail.elm.D\"
  1389. else
  1390.   echo applying diffs to file bin/mail.elm...
  1391.   /bin/cat bin/mail.elm.D | /bin/ed - bin/mail.elm
  1392. fi
  1393.  
  1394. #-------------------------------------
  1395. # File 'Instructions' diffs...
  1396.  
  1397. cat << 'EOF' > Instructions.D
  1398. 84c
  1399. should say "no mail" if nothing's in your incoming mailbox, and
  1400. .
  1401. 75c
  1402. Note: the mailer runs as setgid mail to have the ability to WRITE
  1403. .
  1404. 63,73c
  1405.     $ make -i install
  1406. .
  1407. 59,61c
  1408. next, you can install all the software on your system by;
  1409. .
  1410. 56,57c
  1411.     "answer", "arepdaemon", "autoreply", "fastmail", "from", 
  1412.     "elm", "newalias", "newmail", "printmail", and "readmsg".
  1413. .
  1414. 40,47d
  1415. 36,38c
  1416.     (if you're in "sh", you can use "> MAKELOG 2>&1" instead of ">& MAKELOG")
  1417. .
  1418. 34c
  1419.     $ (make -i all >& MAKELOG) &
  1420.     $ tail -f MAKELOG
  1421. .
  1422. 32c
  1423.     When that's done, or even if it fails (don't worry too much about it)
  1424. .
  1425. 29,30c
  1426.     $ make documentation
  1427. .
  1428. 27c
  1429.     $
  1430. .
  1431. 25c
  1432.     Once you're happy with the localized files, you then need to create
  1433. the documentation (so there's a bit of a catch-22 that you need to format the
  1434. Configuration guide before you are happy with the localization but can't do
  1435. that until you're happy with the localization...oh well).
  1436. .
  1437. 23c
  1438.     Answer the questions of that program,, then let it create the localized
  1439. Makefiles and system definition files for you.  When it's done you can double
  1440. check the configuration (or customize it further) by reading the Configuration
  1441. Guide + editing the file "hdrs/sysdefs.h".  There are lots of neat features
  1442. that are unique to this mailer - it's worth a quick perusal at least!
  1443. .
  1444. 19,21c
  1445.     $ sh Configure.sh
  1446. .
  1447. 17c
  1448.     $ cd <where-ever you're keeping the Elm sources>
  1449. .
  1450. 13,15c
  1451.     There is actually really one step needed - unpack all the shar
  1452. files and then;
  1453. .
  1454. 5c
  1455.             Last Update: July 17th, 1986
  1456. .
  1457. w
  1458. EOF
  1459.  
  1460. chars=`cat Instructions | wc -c`
  1461.  
  1462. if [ $chars -ne 5058 ]
  1463. then
  1464.   echo Your file Instructions has been changed\!
  1465.   echo diffs saved as \"Instructions.D\"
  1466. else
  1467.   echo applying diffs to file Instructions...
  1468.   /bin/cat Instructions.D | /bin/ed - Instructions
  1469. fi
  1470.