Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator) (02/04/90)
Submitted-by: overload!dillon (Matt Dillon) Posting-number: Volume 90, Issue 050 Archive-name: unix/uucp-1.03d/part06 #!/bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 6 (of 16)." # Contents: Disk2.contents man/Domains man/Tar # src/News060/Anews/anews.c src/dmail/commands.c # src/dmail/sendmail.c # Wrapped by tadguy@xanth on Sat Feb 3 20:51:10 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Disk2.contents' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Disk2.contents'\" else echo shar: Extracting \"'Disk2.contents'\" \(9104 characters\) sed "s/^X//" >'Disk2.contents' <<'END_OF_FILE' X XArchive ../uucp1.03D.zoo.2: XLength CF Size Now Date Time X-------- --- -------- --------- -------- X 44056 49% 22470 29 Dec 89 20:13:44 uucp1/man/dme.doc X 193 13% 168 10 Jan 90 12:43:06 uucp1/man/expandm X 403 21% 317 8 Jan 90 17:21:06 uucp1/man/TrimFile X 1492 29% 1065 23 Oct 89 15:50:50 uucp1/man/UUSer X 18172 45% 10071 14 Oct 89 15:36:50 uucp1/man/MAPS X 1441 45% 790 14 Oct 89 15:36:24 uucp1/man/UPDATES X 49150 57% 21032 14 Oct 89 15:36:32 uucp1/man/how2usenet X 89791 53% 42431 3 Nov 89 15:44:36 uucp1/man/Standards X 6833 55% 3109 14 Oct 89 15:36:46 uucp1/man/NewsGroups X 1960 39% 1195 5 Jan 90 16:48:12 uucp1/man/Aliases X 749 18% 616 14 Oct 89 15:36:46 uucp1/man/MapExample X 12488 48% 6505 25 Jan 90 22:28:16 uucp1/man/GNU-LICENSE X 320 14% 276 10 Jan 90 19:00:32 uucp1/man/PhoneBook X 1990 35% 1294 10 Jan 90 10:53:20 uucp1/man/Assigns X 5912 43% 3369 8 Jan 90 23:21:56 uucp1/man/dmail X 5367 46% 2898 3 Nov 89 16:13:56 uucp1/man/Compress X 2893 34% 1898 10 Jan 90 15:40:36 uucp1/man/UUCico X 6005 44% 3343 27 Oct 89 22:27:32 uucp1/man/Getty X 4580 40% 2763 27 Oct 89 22:32:12 uucp1/man/DCron X 1736 43% 984 14 Oct 89 15:38:24 uucp1/man/UUdecode X 1592 45% 871 14 Oct 89 15:38:26 uucp1/man/UUClean X 3569 49% 1837 14 Oct 89 15:38:26 uucp1/man/Grep X 2919 45% 1594 14 Oct 89 15:38:28 uucp1/man/UUlog X 1168 34% 772 27 Oct 89 22:33:42 uucp1/man/man X 2919 45% 1594 14 Oct 89 15:38:30 uucp1/man/UUCP X 1736 43% 984 14 Oct 89 15:38:32 uucp1/man/UUencode X 8139 53% 3832 14 Oct 89 15:38:20 uucp1/man/Tar X 380 25% 286 27 Oct 89 22:24:08 uucp1/man/From X 314 24% 240 14 Oct 89 15:38:20 uucp1/man/Rmail X 9043 49% 4593 8 Jan 90 23:33:20 uucp1/man/Domains X 2130 34% 1411 27 Oct 89 22:26:52 uucp1/man/Passwd X 572 22% 447 27 Oct 89 22:31:18 uucp1/man/NULL X 2380 38% 1479 7 Nov 89 16:46:26 uucp1/man/L.sys X 1178 31% 817 3 Nov 89 14:13:54 uucp1/man/Security X 22 0% 22 3 Nov 89 14:21:56 uucp1/man/.Distfiles X 62 0% 62 3 Nov 89 16:01:58 uucp1/man/Config X 559 32% 380 10 Jan 90 15:30:52 uucp1/src/TODO X 56681 0% 56681 14 Jan 90 19:13:36 uucp1/src/dmail.zoo X 496 23% 384 10 Jan 90 16:38:00 uucp1/src/sendmail/DMakefile X 22055 53% 10259 25 Jan 90 12:51:56 uucp1/src/sendmail/sendmail.c X 1232 37% 780 10 Jan 90 16:38:20 uucp1/src/sendmail/parse.c X 4164 44% 2317 25 Jan 90 12:41:10 uucp1/src/sendmail/domain.c X 40885 50% 20582 3 Nov 89 11:29:48 uucp1/src/compress/compress.c X 3856 40% 2321 3 Nov 89 11:30:10 uucp1/src/compress/tarsplit.c X 938 40% 565 3 Nov 89 16:08:56 uucp1/src/compress/DMakefile X 6648 47% 3544 3 Nov 89 11:30:36 uucp1/src/compress/unshar.c X 3204 40% 1923 3 Nov 89 11:30:50 uucp1/src/compress/uudecode.c X 2000 35% 1294 3 Nov 89 11:31:26 uucp1/src/compress/uuencode.c X 9 0% 9 31 Oct 89 14:23:22 uucp1/src/.Distfiles X 3865 41% 2266 10 Jan 90 16:39:30 uucp1/src/GUtil/uuserdump.c X 925 27% 677 10 Jan 90 16:38:54 uucp1/src/GUtil/uident.c X 3220 43% 1850 10 Jan 90 16:39:20 uucp1/src/GUtil/gnote.c X 676 30% 474 10 Jan 90 16:39:42 uucp1/src/GUtil/DMakefile X 1801 37% 1140 10 Jan 90 16:39:46 uucp1/src/MUtil/trimfile.c X 2388 41% 1410 10 Jan 90 16:40:00 uucp1/src/MUtil/from.c X 1032 35% 670 3 Nov 89 11:26:34 uucp1/src/MUtil/man.c X 579 32% 392 8 Jan 90 15:17:24 uucp1/src/MUtil/DMakefile X 432 21% 341 10 Jan 90 16:40:12 uucp1/src/MUtil/expandm.c X 811 29% 572 10 Jan 90 15:45:22 uucp1/src/ReadMe X 1459 31% 1006 25 Jan 90 14:18:26 uucp1/src/uucico/version.doc X 11298 47% 5942 10 Jan 90 15:31:28 uucp1/src/uucico/sysdep.c X 32949 50% 16420 25 Jan 90 14:10:38 uucp1/src/uucico/uucico.c X 974 41% 576 10 Jan 90 15:34:06 uucp1/src/uucico/DMakefile X 854 32% 582 14 Oct 89 15:39:52 uucp1/src/uucico/modem.h X 2378 39% 1440 25 Jan 90 14:12:44 uucp1/src/uucico/uuxqt.c X 939 23% 727 25 Jan 90 14:17:18 uucp1/src/uucico/uupoll.c X 3441 45% 1903 25 Jan 90 14:12:30 uucp1/src/uucico/uux.c X 16481 53% 7796 10 Jan 90 15:40:00 uucp1/src/uucico/gio.c X 1876 39% 1150 10 Jan 90 15:13:56 uucp1/src/uucico/sysdep.h X 675 18% 551 25 Jan 90 14:15:24 uucp1/src/uucico/uuname.c X 2821 42% 1627 23 Oct 89 17:41:24 uucp1/src/uucico/includes.h X 672 18% 549 25 Jan 90 14:12:24 uucp1/src/uucico/uuhosts.c X 3907 47% 2070 25 Jan 90 12:51:14 uucp1/src/uucico/uucp.c X 1358 27% 986 25 Oct 89 16:40:56 uucp1/src/uucico/uucp.h X 3471 39% 2106 10 Jan 90 16:41:24 uucp1/src/uucico/modem.c X 126 3% 122 10 Jan 90 16:41:46 uucp1/src/include/tmpfile.h X 330 25% 249 10 Jan 90 16:41:38 uucp1/src/include/log.h X 1625 34% 1080 10 Jan 90 16:42:08 uucp1/src/include/config.h X 540 35% 351 10 Jan 90 16:42:14 uucp1/src/include/pwd.h X 239 15% 203 10 Jan 90 16:42:38 uucp1/src/include/sys/stat.h X 125 3% 121 10 Jan 90 16:42:58 uucp1/src/include/sys/types.h X 136 17% 113 10 Jan 90 16:43:16 uucp1/src/include/sys/file.h X 107 10% 96 10 Jan 90 16:43:26 uucp1/src/include/sys/time.h X 19742 52% 9486 8 Jan 90 02:20:58 uucp1/src/getty/getty.c X 195 5% 185 10 Jan 90 16:43:56 uucp1/src/getty/syms.c X 1689 33% 1135 10 Jan 90 16:44:04 uucp1/src/getty/passwd.c X 369 23% 283 26 Oct 89 18:13:06 uucp1/src/getty/DMakefile X 834 34% 551 10 Jan 90 16:44:26 uucp1/src/lib/getenv.c X 156 1% 155 10 Jan 90 16:44:30 uucp1/src/lib/sleep.c X 519 26% 382 10 Jan 90 16:44:46 uucp1/src/lib/mntreq.c X 589 33% 394 10 Jan 90 16:44:18 uucp1/src/lib/string.c X 376 20% 302 10 Jan 90 16:44:54 uucp1/src/lib/tmpfile.c X 1505 39% 914 10 Jan 90 16:45:04 uucp1/src/lib/config.c X 815 28% 587 10 Jan 90 16:45:08 uucp1/src/lib/setstdin.c X 2562 39% 1551 10 Jan 90 16:45:24 uucp1/src/lib/serialport.c X 615 27% 449 6 Jan 90 00:27:02 uucp1/src/lib/DMakefile X 1815 42% 1052 14 Jan 90 19:05:52 uucp1/src/lib/getpwnam.c X 2345 41% 1380 10 Jan 90 16:45:36 uucp1/src/lib/lockfile.c X 49 0% 49 21 Oct 89 19:29:16 uucp1/src/lib/syms.c X 4268 45% 2353 10 Jan 90 16:45:48 uucp1/src/lib/alias.c X 643 31% 446 14 Jan 90 19:04:58 uucp1/src/lib/seq.c X 2279 40% 1358 14 Jan 90 19:06:06 uucp1/src/lib/security.c X 621 22% 485 14 Jan 90 19:06:16 uucp1/src/lib/lsys.c X 1273 34% 841 14 Jan 90 19:06:26 uucp1/src/lib/log.c X 338 24% 256 10 Jan 90 16:46:02 uucp1/src/lib/validuser.c X 705 23% 540 25 Jan 90 11:18:18 uucp1/src/version.h X 17361 48% 9096 10 Jan 90 16:24:30 uucp1/src/News060/rnews.c X 9639 49% 4887 10 Jan 90 18:47:40 uucp1/src/News060/Anews/anews.c X 2055 37% 1287 10 Jan 90 11:21:54 uucp1/src/News060/Anews/sendpacket.c X 2229 36% 1419 10 Jan 90 16:27:04 uucp1/src/News060/Anews/raw.c X 1607 33% 1069 10 Jan 90 16:27:36 uucp1/src/News060/Anews/mscan.c X 477 21% 376 10 Jan 90 16:27:42 uucp1/src/News060/Anews/DMakefile X 4092 45% 2239 25 Jan 90 13:56:46 uucp1/src/News060/postnews.c X 567 26% 420 10 Jan 90 16:28:06 uucp1/src/News060/DMakefile X 2039 36% 1303 10 Jan 90 16:28:20 uucp1/src/uuser/uuser.doc X 1880 39% 1154 10 Jan 90 16:29:12 uucp1/src/uuser/misc.c X 506 23% 391 10 Jan 90 16:29:34 uucp1/src/uuser/DMakefile X 100 7% 93 22 Oct 89 17:27:12 uucp1/src/uuser/mountlist X 13243 53% 6286 10 Jan 90 16:29:56 uucp1/src/uuser/uuser.c X 16308 25% 12188 25 Jan 90 23:03:22 uucp1/c/compress X 9284 23% 7183 25 Jan 90 23:03:14 uucp1/c/uuencode X 11000 23% 8449 25 Jan 90 23:03:16 uucp1/c/uudecode X 10720 23% 8215 25 Jan 90 23:03:16 uucp1/c/tarsplit X 26580 29% 18783 25 Jan 90 23:03:18 uucp1/c/tar X 10100 22% 7835 25 Jan 90 23:03:18 uucp1/c/man X 8048 22% 6283 25 Jan 90 23:03:20 uucp1/c/uident X 10828 23% 8345 25 Jan 90 23:03:20 uucp1/c/unshar X 10248 23% 7866 25 Jan 90 23:03:20 uucp1/c/from X-------- --- -------- --------- -------- X 754104 41% 446333 128 files END_OF_FILE if test 9104 -ne `wc -c <'Disk2.contents'`; then echo shar: \"'Disk2.contents'\" unpacked with wrong size! fi # end of 'Disk2.contents' fi if test -f 'man/Domains' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/Domains'\" else echo shar: Extracting \"'man/Domains'\" \(9043 characters\) sed "s/^X//" >'man/Domains' <<'END_OF_FILE' X XNAME X UULIB:Domain X XSYNOPSIS X - X XDESCRIPTION X X The UULIB:Domain file holds routing information for addresses X you send USENET mail to. This file is normally required ONLY if X your machine can talk to MORE THAN ONE USENET host. X X For machines that can talk to ONLY ONE USENET host, you need X only set the 'DefaultNode' entry in UULIB:Config to the name X of the one host. X X A domain is something like 'CTS.COM' or 'BERKELEY.EDU'. Lets X say you have direct USENET connections to UCBVAX.Berkeley.EDU and X FUBAR.CTS.COM. X X Now, you want to send an email message to CHARLIE.Berkeley.EDU X and another email message to GALAXY.CTS.COM ... obviously you will X want the first message to be routed through UCBVAX and the second X routed through FUBAR. The appropriate domain entries would be: X X *.berkeley.edu MF UU ucbvax.UUCP X *.cts.com MF UU fubar.UUCP X X You will also want a default of some sort ... say you send mail X to PHOTON.CSNET, you want unknown domains to be routed to somewhere X that knows how to deal with them. So you would also have another X entry in UULIB:Domain: X X * MF UU ucbvax.UUCP X X That specifies the machine to route mail through to reach an X unknown address. X X *** NOTE *** UUCP sites that you directly connect to need not be listed X in UULIB:Domain, the UULIB:L.Sys file is automatically scanned for such X sites. For said machines any additional domain information is ignored X (such as .UUCP). In case the name of an immediately adjacent UUCP site X conflicts with another site you can enter that other site into the domain X list explicitly using the MD Type described below. X X FORMAT OF DOMAIN FILE X X Each line in the domain file may be blank, contain a '#' and then X a comment, or contain a domain record. Each domain record is broken X up into four fields: X X Domain Type Class Address-Info X X Domain = domain in question, you may use '*' instead of a domain X name to match ONE OR MORE SUBDOMAINS or the machine name. X Case is ignored. X X For example: *.COM X *.Berkeley.EDU X * X X Type = MF or MD. MF stands for mail forwarder, MD stands for X mail destination. The difference can be shown with an X example: X X ucbvax.berkeley.edu MD UU ucbvax.UUCP X *.berkeley.edu MF UU ucbvax.UUCP X X In the first case the domain is actually a complete machine X name which we can directly talk to, thus MD is used telling X the mail system that we REPLACE the address with this address. X X In the second case the machine is what we must go THROUGH to X reach machines with the given domain (note that more explicitly X specified domains always have priority of less explicitly X specified domains). The mail system will PREPEND the address X field with the forwarding machine address. X X Class = UU X Currently only UU, meaning USENET class, is supported. This X field is reserved to allow specification of different types X of low level mailers so the mail system is not necessarily X limited to using the USENET as the transport layer. X X AddrInfo X for the UU class AddrInfo contains a ! separated UUCP path X where the first machine MUST be an immediately adjacent node. X The remainder of the path is tagged onto the rmail line along X with the original path specification. X X NOTE: For any machine in the bang (!) path of the AddrInfo X field which is directly connected to the previous machine X (the first machine is always directly connected to your X machine), the domain is optional. That is, the machine may X be listed with or without a domain separated by dots. The X examples below show parts of paths both with and without X domain names. X X when you route through the INTERNET, however, you must be X more careful. Only known USENET paths may be addressed X without worrying about the domain part of the machine name. X X REGISTERED DOMAINS X X We will eventually have our own domain that is registered with the X network community. When this occurs we will probably set up an X automated system that keeps everybody's UULIB:Domain file consistant. X Each UULIB:Domain file will then have an entry for all machines in X our domain. Thus, while UULIB:Domain is not being used so much at X the moment I expect it will be used in a major way in the future. X X XADDRESSES IN A SMALL ISOLATED NETWORK X X Using the UULIB:Domain file in local networks drastically X simplifies most other parts of the UUCP mail system. The X greatest advantage of using a Domain file is that you can X refer to machines in your local net by name rather than by X path and can refer to them by name in any groups you might X have constructed in UULIB:Aliases. you can also use the Domain X file to re-route email to machines that may have moved to X somewhere else in your local network (say a buddy moves back X east) without bouncing the email. Which we can't do anyway yet.. X automatic bouncing will be in a future release. X X Lets say you have a group of people all running UUCP connected X like this: X d X / f X / / X a---b---c---h X / \ \ X / \ g X x e X X If your machine is b.UUCP and you want to email to user@h.UUCP, X then the appropriate path is: X X To: c!h!user X X If your machine is d.UUCP and you want to email to g.UUCP, X then the appropriate path is: X X To: b!c!g!user X X There is another alternative. You can setup your UULIB:Domain X file with all of these paths and just say: X X To: user@g.UUCP X X The Domain file would be different for each node but you have X removed the complexity one step. The Domain file for a.UUCP X would look like this: X X * MF UU b.UUCP X X This assumes that b.UUCP also implements Domains. The Domain X file for b.UUCP would look like this: X X * MF UU c.UUCP X x.UUCP MF UU a.UUCP X X Because, apart from x.UUCP, the only nodes b.UUCP cannot reach X directly are reachable via c.UUCP. X X The Domain file for c.UUCP would be: X X * MF UU b.UUCP X X Because the only nodes c.UUCP cannot reach go through b.UUCP, X so we set the default route for unknown nodes to go through X b.UUCP. Here we assume that b.UUCP uses UULIB:Domains as X well and knows how to get to x.UUCP which is not immediately X adjacent to it. X X The Domain file for c.UUCP assuming the b.UUCP does NOT use X a Domains file (which is safest actually) is: X X * MF UU b.UUCP X x.UUCP MF UU b.UUCP!a.UUCP X X Alternately you can use MD (mail destination): X X * MF UU b.UUCP X x.UUCP MD UU b.UUCP!a.UUCP!x.UUCP X XADDRESSES IN A SMALL NETWORK WITH A SINGLE CONNECTION TO THE OUTSIDE WORLD: X X d X / f X / / X a---b---c---h---ucbvax.berkeley.edu X / \ \ X / \ g X x e X X This is another possible configuration... one person in your X little Amiga network has a connection to the outside world. X In this case everyone in your network should have UULIB:Domain X entries to properly route email back and forth. Specifically, if X you are giving somebody your email address and your machine is X x.UUCP, you want to be able to give them: X X ucbvax.berkeley.edu!h!x!user X X As your address rather than X X ucbvax.berkeley.edu!h!c!b!a!x!user X X In otherwords, you want to HIDE your local network from the X outside world. This would require h.UUCP to have the X following UULIB:Domain file: X X * MF UU ucbvax.berkeley.edu X a.UUCP MF UU c!b X b.UUCP MF UU c X d.UUCP MF UU c!b X e.UUCP MF UU c!b X f.UUCP MF UU c X g.UUCP MF UU c X x.UUCP MF UU c!b!a X X Each of the other nodes in the network would have a similar X Domain file. Note that when you have a connection to the X outside world the default, '*', should point to the outside X world. The '*' entry for a.UUCP, for example, would be: X X * MF UU b!c!h!ucbvax X X If everyone in your local net implemented '*' properly it X would suffice to redirect '*' to, say, just b.UUCP, and b.UUCP X would direct it to c.UUCP, etc... The cleanest way to deal X with it is actually to redirect it to the last node in your X local net that talks to the outside world: X X * MF UU b!c!h X X This allows the sysop at h.UUCP the latitude to do further X routing. For example, what if h.UUCP was able to connect to X two machines on the outside world! X X ucbvax.berkeley.edu X / X ----h X \ X pacbell.pacbell.com X X In this case you want to give h.UUCP the latitude to redirect X email to the .pacbell.com domain to pacbell.pacbell.com X instead of going the long path through ucbvax.berkeley.edu ... X X * MF UU ucbvax X *.PacBell.COM MF UU pacbell X X Thus, all the other nodes in your local network should direct X unknown addresses through h.UUCP rather than bypass h.UUCP's X domain system by giving an explicit route through it. X END_OF_FILE if test 9043 -ne `wc -c <'man/Domains'`; then echo shar: \"'man/Domains'\" unpacked with wrong size! fi # end of 'man/Domains' fi if test -f 'man/Tar' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/Tar'\" else echo shar: Extracting \"'man/Tar'\" \(8139 characters\) sed "s/^X//" >'man/Tar' <<'END_OF_FILE' X XNAME X tar - media file archiver X XSYNOPSIS X tar -[BcDhikmopstvxzZ] [-b N] [-f F] [-T F] [ filename ... ] X XDESCRIPTION X tar provides a way to store many files into a single X archive, which can be kept in another file, stored on X an I/O device such as tape, floppy, cartridge, or disk, or X piped to another program. It is useful for making backup X copies, or for packaging up a set of files to move them to X another system. X X When reading an archive, this version of tar continues after X finding an error. Previous versions required the `i' option X to ignore checksum errors. X XOPTIONS X tar options can be specified in either of two ways. The X usual Unix conventions can be used: each option is preceded X by `-'; arguments directly follow each option; multiple X options can be combined behind one `-' as long as they take X no arguments. For compatability with the Unix tar program, X the options may also be specified as ``keyletters,'' wherein X all the option letters occur in the first argument to tar, X with no `-', and their arguments, if any, occur in the X second, third, ... arguments. Examples: X X Normal: tar -f arcname -cv file1 file2 X X Old: tar fcv arcname file1 file2 X X At least one of the -c, -t, or -x options must be included. X The rest are optional. X X Files to be operated upon are specified by a list of file X names, which follows the option specifications (or can be X read from a file by the -T option). Specifying a directory X name causes that directory and all the files it contains to X be (recursively) processed. In general, specifying full X path names when creating an archive is a bad idea, since X when the files are extracted, they will have to be extracted X into exactly where they were dumped from. Instead, cd to X the root directory and use relative file names. X X -b N Specify a blocking factor for the archive. The block X size will be N x 512 bytes. Larger blocks typically X run faster and let you fit more data on a tape. The X default blocking factor is set when tar is compiled, X and is typically 20. There is no limit to the maximum X block size, as long as enough memory can be allocated X for it, and as long as the device containing the X archive can read or write that block size. X X -B When reading an archive, reblock it as we read it. X Normally, tar reads each block with a single read(2) X system call. This does not work when reading from a X pipe or network socket under Berkeley Unix. With this X option, it will do multiple read(2)s until it gets X enough data to fill the specified block size. -B can X also be used to speed up the reading of tapes that were X written with small blocking factors, by specifying a X large blocking factor with -b and having tar read many X small blocks into memory before it tries to process X them. X X -c Create an archive from a list of files. X X -D With each message that tar produces, print the record X number within the archive where the message occurred. X This option is especially useful when reading damaged X archives, since it helps to pinpoint the damaged sec- X tion. X X -f F Specify the filename of the archive. If the specified X filename is ``-'', the archive is read from the stan- X dard input or written to the standard output. If this X option is not used, a default archive name (which was X picked when tar was compiled) is used. The default is X normally set to the ``first'' tape drive or other tran- X sportable I/O medium on the system. X X -h When creating an archive, if a symbolic link is encoun- X tered, dump the file or directory to which it points, X rather than dumping it as a symbolic link. X X -i When reading an archive, ignore blocks of zeros in the X archive. Normally a block of zeros indicates the end X of the archive, but in a damaged archive, or one which X was created by appending several archives, this option X allows tar to continue. It is not on by default X because there is garbage written after the zeroed X blocks by the Unix tar program. X X -k When extracting files from an archive, keep existing X files, rather than overwriting them with the version X from the archive. X X -m When extracting files from an archive, set each file's X modified timestamp to the current time, rather than X extracting each file's modified timestamp from the X archive. X X -o When creating an archive, write an old format archive, X which does not include information about directories, X pipes, or device files, and specifies file ownership by X uid's and gid's rather than by user names and group X names. In most cases, a ``new'' format archive can be X read by an ``old'' tar program without serious trouble, X so this option should seldom be needed. X X -p When extracting files from an archive, restore them to X the same permissions that they had in the archive. If X -p is not specified, the current umask limits the per- X missions of the extracted files. See umask(2). X X -t List a table of contents of an existing archive. If X file names are specified, just list files matching the X specified names. X X -s When specifying a list of filenames to be listed or X extracted from an archive, the -s flag specifies that X the list is sorted into the same order as the tape. X This allows a large list to be used, even on small X machines, because the entire list need not be read into X memory at once. Such a sorted list can easily be X created by running ``tar -t'' on the archive and edit- X ing its output. X X -T F Rather than specifying the file names to operate on as X arguments to the tar command, this option specifies X that the file names should be read from the file F, one X per line. If the file name specified is ``-'', the X list is read from the standard input. This option, in X conjunction with the -s option, allows an arbitrarily X large list of files to be processed, and allows the X list to be piped to tar. X X -v Be verbose about the files that are being processed or X listed. Normally, archive creation or file extraction X are silent, and archive listing just gives file names. X The -v option causes an ``ls -l''-like listing to be X produced. X X -x Extract files from an existing archive. If file name X are specified, just extract files matching the speci- X fied names, otherwise extract all the files in the X archive. X X -z or -Z X When extracting or listing an archive, these options X specify that the archive should be decompressed while X it is read, using the -d option of the compress(1) pro- X gram. The archive itself is not modified. X XBUGS X The r, u, w, X, l, F, C, and digit options of Unix tar are X not supported. X X It should be possible to create a compressed archive with X the -z option. X X XNOTES ON AMIGA VERSION: X XAddendum for Version 1.1: X X The -p option for extracting files with their dates X preserved is now supported (under AmigaDos 1.2 only; do not X try to use this option under AmigaDos 1.1). X XAddendum for Version 1.2: X X The -p option now works on floppies as well as ram:. Various X internal hacking has been done, and things are slightly X different than before. The date conversion is now aware that X it's summertime, and not wintertime (a change noticble only X to people who've been porting tar archives back and forth X between Unix and the Amiga). X END_OF_FILE if test 8139 -ne `wc -c <'man/Tar'`; then echo shar: \"'man/Tar'\" unpacked with wrong size! fi # end of 'man/Tar' fi if test -f 'src/News060/Anews/anews.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/News060/Anews/anews.c'\" else echo shar: Extracting \"'src/News060/Anews/anews.c'\" \(9663 characters\) sed "s/^X//" >'src/News060/Anews/anews.c' <<'END_OF_FILE' X X/* X * ANEWS.C X * X * Copyright 1988 by William Loftus. All rights reserved. X * X * From William P. Loftus's UUCP0.60 distribution. X */ X X#include <dos.h> X#include <stdio.h> X#include <stdlib.h> X#include <ctype.h> X#include "log.h" X#include "/version.h" X X#define YES 1 X#define NO 0 X#define ON scr_inverse_on() X#define OFF scr_inverse_off() X#define UL_On printf("\x1b[4m") X#define UL_Off printf("\x1b[0m") X#define Clear_eol printf("\x9bK") X#define Clear_Screen printf("\x9bH\x9bJ") X#define Cr printf("\xd") X#define PROG_NAME "Anews" X X#define MAXGROUPS 512 X XIDENT(".00"); X Xint PageSize; Xint current = 0; Xint countgroups; Xint last[MAXGROUPS]; /* Last read articles */ Xchar **ng; Xchar *get_next_file(); Xchar fg,bg; Xchar homedir[128]; Xchar *pager; X Xvoid init(); Xvoid scan_subjects(); Xvoid do_quit(); Xvoid do_help1(); Xvoid do_help2(); Xvoid scr_inverse_on(); Xvoid scr_inverse_off(); Xvoid InitNewsrc(); X Xchar ** XGetNewsgroups_Lastread() X{ X FILE *fp; X char buf[BUFSIZ]; X static char *ng[MAXGROUPS]; X int i; X X if(!(fp=fopen("UUNEWS:newsrc","r"))) { X printf("Anews: Error.. could not open UUNEWS:newsrc\n"); X printf("Creating file UUNEWS:newsrc from UUCP:Lib/newsgroups.\n"); X InitNewsrc(); X fp=fopen("UUNEWS:newsrc","r"); X } X X for(i=0; i < MAXGROUPS; i++) { X if (fscanf(fp,"%s %d",&buf,&last[i])==EOF) X break; X ng[i] = malloc(strlen(buf)); X strcpy(ng[i],buf); X } X fclose(fp); X countgroups=i; X return(ng); X} X X Xvoid XInitNewsrc() X{ X char buffer[80]; X FILE *fp_in, *fp_out; X X if(!(fp_in=fopen("UULIB:newsgroups","r"))) { X printf("Error: Cannot open UULIB:newsgroups.\n"); X exit(0); X } X X if(!(fp_out=fopen("UUNEWS:newsrc","w"))) { X printf("Error: Cannot create newsrc file.\n"); X fclose(fp_in); X exit(0); X } X X while(fscanf(fp_in,"%s",&buffer)!=EOF) { X fprintf(fp_out,"%s %d\n",buffer,0); X strset(buffer,NULL); X } X X fclose(fp_in); fclose(fp_out); X} X Xvoid Xmain(argc,argv) Xint argc; Xchar **argv; X{ X int ch; X X LogProgram = "ANews"; X init(); X ng = GetNewsgroups_Lastread(); X raw(stdin); X for (;;) { X chdir("UUNEWS:"); X do { X chdir(ng[current]); X if (read_directory() != NULL) { X ON; X printf("Read %s? [y/n]",ng[current]); X OFF; X } else { X if (ng[++current] == NULL) X do_quit(); X ch = NULL; X break; X } X putchar(' '); X ch = getchar(); X printf("\n"); X } while ((ch == '\n') || (ch == '\r')); X X switch (ch) { X case 'Y': /* Force the newsgroup to be read from the start.. X * We don't want to reset the last message read, so discard X * the return X */ X (void)readgroup(ng[current],last[current],1); X break; X case 'y': X last[current] = readgroup(ng[current],last[current],0); X break; X case 'n': X case 'N': X if (ng[++current] == NULL) X do_quit(); X break; X case 'h': X case 'H': X case '?': X do_help1(); X break; X case 'q': X case 'Q': X do_quit(); X case '=': X read_directory(NULL); X scan_subjects(); X break; X default: X break; X } X } X} X Xchar * XGet_Env(envar, def) Xchar *envar, *def; X{ X char *p,*eptr,*getenv(); X X if ((p=getenv(envar)) != NULL) { X eptr =(char *) malloc(strlen(p)+1); X strcpy(eptr,p); X } else X eptr=def; X X return(eptr); X} X Xvoid Xinit() X{ X getcwd(homedir, 128); X chdir("UUNEWS:"); X pager = Get_Env("PAGER", "Sys:Utilities/More"); X fg = *Get_Env("FG","8"); X bg = *Get_Env("BG","0"); X PageSize = atoi(Get_Env("PAGESIZE", "20")); X} X Xchar * Xsubs(newsfile) Xchar *newsfile; X{ X FILE *fp; X int j = 0; X static char buf[BUFSIZ]; X X if ((fp = fopen(newsfile,"r")) == NULL) { X printf(" Couldn't open %s\x1b[K\n",newsfile); X return(NULL); X } X while ((j++ < 50) && fgets(buf,BUFSIZ,fp)) { X if (strncmp("Subject:", buf, 8) == 0) { X buf[strlen(buf)-1] = '\0'; X fclose(fp); X return buf; X } X } X X fclose(fp); X return NULL; X} X Xvoid Xscan_subjects() X{ X char *ptr,ch,*s; X int i,pos; X extern int file_pointer; X X pos = file_pointer; X X i = 0; X while (ptr = get_next_file()) { X if (atoi(ptr) == 0) X continue; X if ((++i % PageSize) == 0) { X ON; X printf("(Hit any key to continue)"); X OFF; X ch=getchar(); X Cr; X Clear_eol; X if (ch == 'q') X break; X } X if (s = subs(ptr)) X printf("%s: %s\n",ptr,s); X else X printf("Error: No Subject line in %s\n",ptr); X } X file_pointer = pos; X} X Xvoid Xdo_quit() X{ X FILE *fp; X int j; X X X if(!(fp=fopen("UUNEWS:newsrc","w"))) { X printf("Error, could not open UUNEWS:newsrc for writing.\n"); X } else { X for(j = 0; j < countgroups; j++) { X fprintf(fp,"%s %d\n",ng[j],last[j]); X } X } X fclose(fp); X X chdir(homedir); X cooked(stdin); X exit(0); X} X Xvoid Xdo_help1() X{ X printf("\x1b[0;1;33;40m"); X printf("Y Read this newsgroup\n"); X printf("y Read only new articles in this newsgroup\n"); X printf("n/N Skip this newsgroup\n"); X printf("= List article subjects in this newsgroup\n"); X printf("h/H/? Display help\n"); X printf("q/Q Quit to DOS\n"); X printf("\x1b[0;31;40m"); X} X Xvoid Xdo_help2() X{ X printf("\x1b[0;1;33;40m"); X printf("\n(space) Display next page of current article\n"); X printf("(return) Same as (space)\n"); X printf("n/N Goto the next article\n"); X printf("= List article subjects for the remaining articles\n"); X printf("d/D Delete this article\n"); X printf("- Backup to previous article\n"); X printf("^ Goto the first article (sorry no $)\n"); X printf("(number) Goto the given article number\n"); X printf("./> Scan subject of next article, hit return to read it\n"); X printf(",/< Backup one article, displaying its subject\n"); X printf("w/W Write the current article to a file\n"); X printf("h/H/? Display help\n"); X printf("q/Q Quit this group and return to the main menu\n"); X printf("\x1b[0;31;40m"); X} X Xreadgroup(group,lastread,force) Xchar *group; Xint lastread, force; X{ X char *name; X FILE *fp; X char buf[BUFSIZ], newname[40], temp[BUFSIZ]; X int i,done,ch,delete,last2; /* Can't think of a different way to do it */ X extern int file_pointer; X X if (force==1) { X file_pointer=0; X goto Forced; X } X X while ((atoi(name = get_next_file()) <= lastread) && name); X X if (name == NULL) { X Clear_Screen; X printf("\nNo new news articles..\n"); X return (lastread); X } else X goto skipit; X X /* X * we exit from that pointing to the last file we read.. this gets the X * first one we haven't read, Falling Through CAN be fun ya know? X */ X X XForced: X while(name=get_next_file()) { Xskipit: X /* A necessary little kludge to remember the article number we are on */ X last2=atoi(name); X Xnamed_file: X Clear_Screen; X if ( (fp = fopen(name,"r")) == NULL) { X printf("Article %s unavailable.\n",name); X ON; X printf("(Hit any key to continue)"); X OFF; X getchar(); X continue; X } X X delete = done = NO; X while (fgets(buf, BUFSIZ, fp) && (*buf != '\n')) { X if ((strncmp(buf, "Subject",7) == 0)) { X fputs("Subject: ", stdout); X UL_On; X fputs(buf+9, stdout); X UL_Off; X } else { X fputs(buf,stdout); X } X } X do { X ON; X printf("%s [%s]?",group,name); X OFF; X putchar(' '); X ch = getchar(); X X /* Erase the prompt */ X Cr; X Clear_eol; X X switch (ch) { X case ' ': X case '\n': X case '\r': X case '\t': X i = 0; X do { X fputs(buf,stdout); X } while ((fgets(buf,BUFSIZ,fp) != NULL) && ( i++ <PageSize) ); X break; X X case '?': X case 'h': X case 'H': X ON; X printf("%s [%s]?",group,name); X OFF; X do_help2(); X break; X X case 'w': X case 'W': X ON; X printf("Write Article %s as ??", name); X OFF; X printf(" "); X strcpy(temp,"copy "); X strcat(temp,name); X strcat(temp," to "); X cooked(stdin); X gets(newname); X raw(stdin); X if (!*newname) X break; X strcat(temp,newname); X if (system(temp)) X break; X printf("%s Saved to %s\n",name,newname); X break; X X case '=': X scan_subjects(); X break; X case 'q': X case 'Q': X fclose(fp); X return(last2>lastread?last2:lastread); X break; X X case '-': if (file_pointer != 1) X file_pointer -= 2;; X done = YES; X break; X X case '^': X file_pointer = 0; X done = YES; X break; X X case '0': X case '1': X case '2': X case '3': X case '4': X case '5': X case '6': X case '7': X case '8': X case '9': X cooked(stdin); X newname[0] = ch; X ON; X printf("Goto Article"); X OFF; X printf(" #%c",ch); X gets(newname+1); X raw(stdin); X fclose(fp); X name = newname; X goto named_file; X X case '.': X case '>': X case ',': X case '<': X for(;;) { X char *strng; X strng=subs(name); X strng[strlen(strng)>49?50:strlen(strng)] = NULL; X printf("\r #%-s\t%-50s\x1b[K",name,strng); X ON; X printf("\rGoto Article"); X OFF; X switch (getchar()) { X case ',': X case '<': X file_pointer -= 2; X if (file_pointer <0) X file_pointer=0; X case '>': X case '.': X name=get_next_file(); X break; X default: X goto named_file; X } X } X X case 'd': X case 'D': X delete = YES; X X case 'n': X case 'N': X done = YES; X X default: X break; X } X } while (done == NO); X X fclose(fp); X if (delete == YES) { X if (remove(name)) { X printf("Error deleting %s\n",name); X ulog(-1, "Error deleting %s", name); X } X } X } X return((last2 > lastread) ? last2 : lastread); X} X Xvoid Xscr_inverse_on() X{ X printf("\x9b\x37;3%c;4%cm",fg,bg); X} X Xvoid Xscr_inverse_off() X{ X printf("\x9b\x30;33;40m\033[0m"); X} END_OF_FILE if test 9663 -ne `wc -c <'src/News060/Anews/anews.c'`; then echo shar: \"'src/News060/Anews/anews.c'\" unpacked with wrong size! fi # end of 'src/News060/Anews/anews.c' fi if test -f 'src/dmail/commands.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/dmail/commands.c'\" else echo shar: Extracting \"'src/dmail/commands.c'\" \(10361 characters\) sed "s/^X//" >'src/dmail/commands.c' <<'END_OF_FILE' X X/* X * COMMANDS.C X * X * (C) Copyright 1985-1990 by Matthew Dillon, All Rights Reserved. X * X * Global Routines: DO_QUIT() X * DO_EXIT() X * DO_CD() X * DO_ECHO() X * DO_GO() X * DO_SOURCE() X * DO_SHELL() X * DO_WRITE() X * DO_DELNEXT() X * DO_NUMBER() X * DO_NEXT() X * DO_HEADER() X * DO_TYPE() X * DO_DELETE() X * DO_UNDELETE() X * DO_MARK() X * DO_BREAK() X * X * Static Routines: None. X * X */ X X#include <stdio.h> X#include <sys/file.h> X#include "dmail.h" X X#define LAST_TYPE 0 X#define LAST_HEADER 1 X Xstatic int Last_operation; Xstatic int Last_deleted = -1; Xstatic char ScrBuf[1024]; X Xvoid Xdo_quit(garbage, com) Xchar *garbage; X{ X int fd, r, back; X char *str; X X push_break(); X if (get_inode (mail_file) == get_inode (output_file)) { X back = save_file (0, 0, ST_DELETED | ST_STORED); X } else { X r = write_file (output_file, O_CREAT, ST_READ, ST_DELETED | ST_STORED); X if (r < 0) { X printf ("Unable to write to %s\n", output_file); X back = save_file (0, 0, ST_DELETED | ST_STORED); X } else { X back = save_file (0, 0, ST_READ | ST_DELETED | ST_STORED); X } X } X if (back < 0) X printf ("Unable to update %s\n", mail_file); X if (back > 0) X printf ("%d kept in %s\n", back, mail_file); X sleep (1); X if ((fd = open (mail_file, O_RDONLY, 0)) >= 0) { X read (fd, Buf, 1); X close (fd); X } X if (!com) X done (0); X free_entry(); X if (av[1] == 0) { X if (!Silence) X puts ("NO FROM FILE SPECIFIED"); X av[1] = mail_file; X av[2] = NULL; X } X Did_cd = 0; X mail_file = realloc (mail_file, strlen(av[1]) + 1); X strcpy (mail_file, av[1]); X str = (av[2]) ? av[2] : mail_file; X output_file = realloc (output_file, strlen(str) + 1); X strcpy (output_file, str); X initial_load_mail(); X m_select (Nulav, M_RESET); X pop_break(); X if (!Silence) X printf ("\nRF %-20s WF %-20s\n", mail_file, output_file); X} X Xvoid Xdo_exit(garbage, com) Xchar *garbage; X{ X char *str; X X if (!com) X done (0); X push_break(); X free_entry(); X if (av[1] == 0) { X if (!Silence) X puts ("NO FROM FILE SPECIFIED"); X av[1] = mail_file; X av[2] = NULL; X } X mail_file = realloc (mail_file, strlen(av[1]) + 1); X strcpy (mail_file, av[1]); X str = (av[2]) ? av[2] : mail_file; X output_file = realloc (output_file, strlen(str) + 1); X strcpy (output_file, str); X initial_load_mail(); X m_select (Nulav, M_RESET); X pop_break(); X if (!Silence) X printf ("\nRF %-20s WF %-20s\n", mail_file, output_file); X} X X Xdo_cd() X{ X char *dir = (ac < 2) ? home_dir : av[1]; X X if (chdir(dir) < 0) { X printf ("Cannot CD to %s\n", dir); X return (-1); X } X ++Did_cd; X return (1); X} X X Xdo_echo(str) Xchar *str; X{ X puts (next_word(str)); X fflush(stdout); X return (1); X} X X Xdo_go() X{ X int i; X X if (ac < 2) { X puts ("go to which article?"); X } X rewind_range (1); X i = get_range(); X if (i < 0) { X if (!Silence) X printf ("Message #%d does not exist\n", i); X return (-1); X } X if (i == 0) { X if (!Silence) X puts ("No Message"); X return (-1); X } X Current = indexof(i); X return (1); X} X X Xdo_source(scratch, overide) Xchar *scratch; X{ X char *comline = malloc(1024); X FILE *fi = NULL; X X if (ac < 2) { X puts ("No file argument to source"); X free(comline); X return (-1); X } X if (push_base()) { X push_break(); X pop_base(); X if (fi != NULL) X fclose (fi); X pop_break(); X free(comline); X return (-1); X } X push_break(); X fi = fopen (av[1], "r"); X pop_break(); X if (fi == NULL) { X if (!overide) X printf ("Cannot open %s\n", av[1]); X free(comline); X return (-1); X } X while (fgets (comline, 1024, fi) != NULL) { X comline[strlen(comline) - 1] = '\0'; X if (comline[0] != '#') X exec_command (comline); X } X push_break(); X fclose (fi); X fi = NULL; X free(comline); X pop_break(); X pop_base(); X return (1); X} X X Xdo_shell(str) Xchar *str; X{ X#ifdef UNIX X int pid, ret; X#endif X char *shell, *ptr; X char *args; X X#ifdef AMIGA X shell = ""; X#else X shell = getenv("SHELL"); X#endif X if (shell == NULL) X shell = "/bin/sh"; X ptr = shell + strlen(shell) - 1; X while (ptr > shell && *ptr && *ptr != '/') X --ptr; X args = (strcmp(ptr, "/sh"))? "-fc" : "-c"; X push_break(); X str = next_word (str); X#ifdef UNIX X if (strlen (str)) { X if ((pid = vfork()) == 0) { X execl (shell, shell, args, str, NULL); X _exit (1); X } X } else { X if ((pid = vfork()) == 0) { X execl (shell, shell, NULL); X _exit (1); X } X } X while ((ret = wait(0)) > 0) { X if (ret == pid) X break; X } X#endif X#ifdef AMIGA X Execute(str, NULL, NULL); X#endif X pop_break(); X return (1); X} X X Xdo_write() X{ X char *file; X int r, count = 0; X register int i, j; X X if (ac < 2) { X puts ("You must specify at least a file-name"); X return (-1); X } X file = av[1]; X rewind_range (2); X push_break(); X while (i = get_range()) { X j = indexof (i); X if (j >= 0 && !(Entry[j].status & ST_DELETED)) { X Entry[j].status |= ST_STORED | ST_SCR; X ++count; X } X } X r = write_file (file, O_CREAT, ST_SCR, 0); X rewind_range (2); X if (r > 0) { X while (i = get_range()) { X j = indexof (i); X if (j >= 0) X Entry[j].status &= ~ST_SCR; X } X if (!Silence) X printf ("%d Items written\n", count); X } else { X while (i = get_range()) { X j = indexof (i); X if (j >= 0) X Entry[j].status &= ~(ST_SCR | ST_STORED); X } X printf ("Could not write to file %s\n", file); X } X pop_break(); X return (1); X} X X/* X * DB, added 3 Oct 1988 X */ X Xdo_delprev() X{ X do_mark("", ST_DELETED); X if (Current) X return(do_next("", -1)); X return(-1); X} X Xdo_delnext() X{ X static int warning; X X if (!warning && Last_operation == LAST_HEADER) { X ++warning; X puts ("Note that the next command is displaying headers only at"); X puts ("this point. (one-time warning, NOTHING deleted"); X return (-1); X } X if (do_mark("", ST_DELETED) > 0) X return (do_next("", 1)); X return (-1); X} X X Xdo_number(str, com) Xchar *str; Xint com; X{ X int x; X X x = indexof (atoi(str)); X if (x < 0) { X puts ("Non existant message"); X return (-1); X } X Current = x; X switch (Last_operation) { X case LAST_TYPE: X return (do_type()); X case LAST_HEADER: X return (do_header()); X default: X puts ("Internal Error NEXT"); X return (-1); X } X} X X Xdo_next(str, com) Xchar *str; X{ X int ok; X X push_break(); X if (com > 0) { X if (++Current > Entries) X Current = Entries; X if (fix() < 0) { X puts ("End of file"); X pop_break(); X return (-1); X } X --com; X } X if (com < 0) { X ++com; X ok = 0; X while (--Current >= 0) { X if (Entry[Current].no && !(Entry[Current].status & ST_DELETED)) { X ok = 1; X break; X } X } X if (!ok) { X puts ("Start of file"); X Current = 0; X fix(); X pop_break(); X return (-1); X } X } X pop_break(); X if (!com) { X switch (Last_operation) { X case LAST_TYPE: X return (do_type()); X case LAST_HEADER: X return (do_header()); X } X } X return (1); X} X X Xdo_header() X{ X Last_operation = LAST_HEADER; X if (push_base()) { X push_break(); X pop_base(); X PAGER (-1); X fseek (m_fi, 0, 0); X fflush (stdout); X pop_break(); X return (-1); X } X if (single_position() < 0) X return (-1); X if (Current < 0) { X puts("Software error #commands.0"); X exit(1); X } X PAGER (0); X sprintf (Puf, "MESSAGE HEADER #%d (%d) %s\n", X Entry[Current].no, X Current + 1, X (Entry[Current].status & ST_DELETED) ? " DELETED" : ""); X PAGER (Puf); X sprintf (Puf, "From %s\n", Entry[Current].from); X PAGER (Puf); X while (fgets (ScrBuf, 1024, m_fi) != NULL) { X FPAGER (ScrBuf); X if (*ScrBuf == '\n') { X PAGER (-1); X pop_base(); X return (1); X } X } X PAGER ("END OF FILE ENCOUNTERED"); X PAGER (-1); X pop_base(); X return (-1); X} X Xdo_type() X{ X int i; X X Last_operation = LAST_TYPE; X if (push_base()) { X push_break(); X pop_base(); X PAGER (-1); X fseek (m_fi, 0, 0); X fflush (stdout); X pop_break(); X return (-1); X } X if (single_position() < 0) X return (-1); X if (Current < 0) { X puts("Software Error #commands.1"); X exit(1); X } X if (skip_to_data (m_fi) < 0) { X printf ("Cannot find data for message %d\n", Entry[Current].no); X return (-1); X } X PAGER (0); X sprintf (Puf, "MESSAGE TEXT #%d (%d) %s\n", X Entry[Current].no, X Current + 1, X (Entry[Current].status & ST_DELETED) ? " DELETED" : ""); X PAGER (Puf); X for (i = 0; i < Listsize; ++i) { X if (*Entry[Current].fields[header[i]]) { X sprintf (Puf, "%-10s %s", X Find[header[i]].search, X Entry[Current].fields[header[i]]); X PAGER (Puf); X } X } X PAGER (""); X while ((fgets (ScrBuf, 1024, m_fi) != NULL) && strncmp (ScrBuf, "From ", 5)) X FPAGER (ScrBuf); X Entry[Current].status |= ST_READ; X PAGER (-1); X pop_base(); X return (1); X} X X Xdo_mark(garbage, mask) Xchar *garbage; X{ X int count = 0; X register int i, j; X X rewind_range (1); X push_break(); X while (i = get_range()) { X j = indexof (i); X if (j >= 0) { X if (mask & ST_DELETED) X Last_deleted = j; X if ((Entry[j].status & mask) != mask) { X Entry[j].status |= mask; X if (Entry[j].status & ST_DELETED) X Entry[j].status &= ~(ST_STORED | ST_READ | ST_TAG); X ++count; X } X } X } X if (!Silence) X printf ("%d Items\n", count); X pop_break(); X return (1); X} X X Xdo_unmark(garbage, mask) Xchar *garbage; X{ X int count = 0; X register int i, j; X register struct ENTRY *en; X X push_break(); X if (ac == 1 && (mask & ST_DELETED) && Last_deleted != -1) { X en = &Entry[Last_deleted]; X if (en->no) { X en->status &= ~mask; X printf ("Undeleted last deleted message (# %d)\n", en->no); X Current = Last_deleted; X Last_deleted = -1; X } else { X puts ("Last deleted message not within current select bounds"); X pop_break(); X return (-1); X } X pop_break(); X return (1); X } X rewind_range (1); X while (i = get_range()) { X j = indexof (i); X if (j >= 0) { X if (Entry[j].status & mask) { X Entry[j].status &= ~mask; X ++count; X } X } X } X if (!Silence) X printf ("%d Items\n", count); X pop_break(); X return ((count) ? 1 : -1); X} X Xdo_break(garbage, mask) Xchar *garbage; X{ X if (mask) X pop_break(); X else X push_break(); X return (1); X} X Xvoid Xdo_ver() X{ X puts (DVERSION); X} X END_OF_FILE if test 10361 -ne `wc -c <'src/dmail/commands.c'`; then echo shar: \"'src/dmail/commands.c'\" unpacked with wrong size! fi # end of 'src/dmail/commands.c' fi if test -f 'src/dmail/sendmail.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/dmail/sendmail.c'\" else echo shar: Extracting \"'src/dmail/sendmail.c'\" \(9206 characters\) sed "s/^X//" >'src/dmail/sendmail.c' <<'END_OF_FILE' X X/* X * SENDMAIL.C X * X * (C) Copyright 1985-1990 by Matthew Dillon, All Rights Reserved. X * X * Global Routines: DO_REPLY() X * DO_MAIL() X * X * Static Routines: WORD_SIZE() X * FOPEN_SCRATCH() X * FREOPEN_SCRATCH() X * FCLOSE_SCRATCH() X * FTERMINATE_SCRATCH() X * DELETE_SCRATCH() X * RUN_VI() X * SEND_MAIL() X * X * X */ X X#include <stdio.h> X#include <sys/types.h> X#include <sys/stat.h> X#include <sys/file.h> X#ifdef UNIX X#include <sys/ioctl.h> X#endif X#include <sys/time.h> X#include <signal.h> X#include "dmail.h" X X#ifdef AMIGA X#include <dos.h> X Xstruct XFORKENV { X long env_priority; X long env_stack; X long env_stdin; X long env_stdout; X long env_console; X long env_msgport; X}; X X#endif X XFILE *fi; Xchar file[64]; X Xvoid fclose_scratch(); Xvoid fopen_scratch(); Xvoid copy_header(); Xvoid send_mail(); X Xdo_reply(garbage, itext) Xchar *garbage; X{ X int i, j; X int anyargs = 0; X int to_field, cc_field; X int len; X char *ptr; X static char buf[1024]; X char scr; X char *istr; X X if (!(istr = get_var(LEVEL_SET, "_headchar"))) X istr = ">"; X if (push_base()) { X push_break(); X pop_base(); X fclose_scratch(); X puts ("ABORTED, no mail sent"); X unlink(file); X pop_break(); X return (-1); X } X fopen_scratch(); X strcpy (buf, "To: "); X for (i = 1; i < ac; ++i) { X if (*av[i] >= '0' && *av[i] <= '9') { X if ((j = indexof(atoi(av[i]))) < 0) { X puts ("No such message"); X fclose_scratch(); X unlink(file); X pop_break(); X return (-1); X } X Current = j; X } else { X if (anyargs) X strcat (buf, ", "); X anyargs = 1; X strcat (buf, av[i]); X } X } X len = strlen(buf); X switch (itext) { X case R_FORWARD: X strcat (buf, "\n"); X fputs (buf, fi); X fputs ("Subject: \n", fi); X break; X case R_INCLUDE: X case R_REPLY: X if (anyargs) { X strcat (buf, ", "); X len = strlen(buf); X } X buf[len] = 0; X if (Current >= 0) { X char *rf = get_var(LEVEL_SET, "replyfields"); X if (rf == NULL) X rf = ""; X while (*rf) { /* attempt to find the fields listed */ X char *re; X char *ptr; X char c; X for (re = rf; *re && *re != ' ' && *re != 9; ++re); X c = *re; X *re = 0; X ptr = get_field(rf); X if (*ptr) { X *re = c; X sprintf (buf + len, "%s\n", ptr); X break; X } X *re = c; X while (*re == ' ' || *re == 9) X ++re; X rf = re; X } X if (*rf == 0) { X sprintf (buf + len, "%.*s\n", X word_size(Entry[Current].from), Entry[Current].from); X } X } X fputs (buf, fi); X fputs ("Cc: ", fi); X ptr = get_field ("To:"); X to_field = (*ptr) ? 1 : 0; X fputs (ptr, fi); X scr = *(ptr + strlen(ptr) - 1); X ptr = get_field ("Cc:"); X cc_field = (*ptr) ? 1 : 0; X if (cc_field) { X if (scr == '\n') { X fputs (" ", fi); X } X if (to_field) X fputs (", ", fi); X fputs (ptr, fi); X } X fputs ("\nSubject: Re: ", fi); X fputs (get_field ("Subject:"), fi); X fputs ("\n", fi); X break; X case R_MAIL: X fputs (buf, fi); X fputs ("\n", fi); X fputs ("Cc: \n", fi); X fputs ("Bcc: \n", fi); X fputs ("Subject: \n", fi); X break; X default: X puts ("INTERNAL STUPID MAIL ERROR: REPLY"); X break; X } X copy_header (fi); X fputs ("\n\n", fi); X if (itext == R_FORWARD || itext == R_INCLUDE) { X position_current(); X if (itext == R_FORWARD) { X if (Current >= 0) X fprintf (fi, "ORIGINALLY From %s\n", Entry[Current].from); X } else { X skip_to_data (m_fi); X } X while ((fgets (Buf, MAXFIELDSIZE, m_fi) != NULL) && !isfrom(Buf)) { X if (itext == R_INCLUDE) X fputs(istr, fi); X fputs (Buf, fi); X } X fputs ("\n", fi); X } X fclose_scratch(); X if (itext != R_MAIL) { X push_break(); X if (Current >= 0) { X Entry[Current].status |= ST_SCR; X write_file("tmp:Original", O_CREAT | O_TRUNC, ST_SCR, 0); X Entry[Current].status &= ~ST_SCR; X } X pop_break(); X } X j = -1; Xloop: X ++j; X if (run_vi() || j) { X push_break(); X switch (do_ask()) { X case 1: X puts ("SENDING.. wait"); X send_mail(); X { X FILE *li = fopen(file, "r"); X char buf[128], *ptr = NULL; X X if (li) { X while (fgets(buf, 128, li) && buf[0] != '\n') { X if (strncmp(buf, "Farchive:", 9) == 0) { X buf[strlen(buf)-1] = '\0'; X for (ptr = buf + 9; *ptr == ' '; ++ptr); X if (ptr[0] == '$') X ptr = get_var(LEVEL_SET, ptr+1); X break; X } X } X fclose(li); X } X archive_mail(ptr); X } X unlink(file); X break; X case 2: X pop_break(); X goto loop; X default: X unlink (file); X break; X } X pop_base(); X pop_break(); X } else { X puts ("File not modified or ABORTED, no mail sent"); X unlink(file); X pop_base(); X } X unlink ("#"); X} X Xdo_ask() X{ X char in[256]; X X if (!S_ask) X return (1); X fputs ("\n(Send, Vi, Quit) ?", stdout); X fflush(stdout); X gets (in); X switch (in[0]) { X case 's': X case 'S': X return (1); X case 'q': X case 'Q': X puts ("ABORT, no mail sent"); X return (3); X case 'v': X case 'V': X default: X return (2); X } X} X X X Xstatic void Xcopy_header(fi) XFILE *fi; X{ X FILE *fs; X char *ptr; X X if (ptr = get_var (LEVEL_SET, "header")) { X push_break(); X if ((fs = fopen (ptr, "r")) != NULL) { X while (fgets (Buf, MAXFIELDSIZE, fs) != NULL) X fputs (Buf, fi); X fclose (fs); X } else { X printf ("Cannot open header file %d %s\n", strlen(ptr), ptr); X perror ("fopen"); X } X pop_break(); X } X} X X Xstatic void Xfopen_scratch() X{ X static int c; X int fd; X X sprintf(file, "tmp:dmt%d%d", getpid(), c++); X fd = open(file, O_RDWR|O_CREAT|O_TRUNC, 0700); X if (fd < 0) { X perror ("Dmail, cannot open scratch file"); X done (1); X } X#ifdef AMIGA /* fix bug in Lattice C fdopen */ X fi = fopen("nil:", "w"); X fclose(fi); X#endif X fi = fdopen(fd, "w+"); X} X Xstatic void Xfclose_scratch() X{ X if (fi != NULL) { X fflush (fi); X fclose (fi); X fi = NULL; X } X} X X Xstatic Xword_size(str) Xregister char *str; X{ X register int size = 0; X X while (*str) { X if (*str == ' ') X return (size); X ++str; X ++size; X } X return (size); X} X X Xstatic Xrun_vi() X{ X#ifdef UNIX X char buf[64]; X int ret, pid = 0; X#endif X struct stat stat1, stat2; X char *argv[3]; X X argv[0] = visual; X argv[1] = file; X argv[2] = NULL; X if (push_base()) { X push_break(); X pop_base(); X#ifdef UNIX X if (pid) { X kill (pid, SIGKILL); X sprintf (buf, "tmp:Ex%d", pid); unlink (buf); X sprintf (buf, "tmp:Rx%d", pid); unlink (buf); X wait(0); X system ("clear; reset ; clear"); X pid = 0; X } X#endif X pop_break(); X return (0); X } X stat1.st_mtime = stat2.st_mtime = stat1.st_ctime = stat2.st_ctime = 0; X stat (file, &stat1); X if (S_novibreak) X push_break(); X X#ifdef UNIX X pid = vfork(); X if (!pid) { X execv (visual, argv); X printf ("Cannot exec visual: %s\n", visual); X _exit (1); X } X while ((ret = wait(0)) > 0) { X if (ret == pid) X break; X } X#endif X#ifdef AMIGA X { X short i; X static char buf[128]; X X strcpy(buf, argv[0]); X for (i = 1; argv[i]; ++i) { X strcat(buf, " "); X strcat(buf, argv[i]); X } X Execute(buf, NULL, NULL); X } X#endif X if (S_novibreak) X pop_break(); X stat (file, &stat2); X pop_base(); X return (!(stat1.st_mtime==stat2.st_mtime)); X} X X X#ifdef UNIX X Xstatic void Xsend_mail() X{ X int fd, stdin_fd; X char *argv[6]; X X push_break(); X argv[0] = S_sendmail; X argv[1] = "-t"; X argv[2] = "-oem"; X argv[3] = "-i"; X if (S_verbose) { X argv[4] = "-v"; X argv[5] = NULL; X } else { X argv[4] = NULL; X } X X fd = open (file, O_RDONLY, 0); X if (fd < 0) { X perror ("Dmail, Cannot open scratch file"); X done (1); X } X lseek(fd, 0, 0); X X stdin_fd = dup (0); X dup2 (fd, 0); /* STDIN = message file */ X close(fd); /* don't need message file anymore */ X if (!fork()) { X int fd = open("/dev/tty", O_RDWR, 0); X if (fd >= 0) { X ioctl(fd, TIOCNOTTY, 0); X close(fd); X freopen("/dev/null", "w", stdout); X freopen("/dev/null", "w", stderr); X } X execv (S_sendmail, argv); X printf ("Unable to exec sendmail: %s\n", S_sendmail); X _exit (1); X } X dup2 (stdin_fd, 0); /* restore STDIN */ X close(stdin_fd); X if (S_verbose) { X puts ("Waiting for sendmail..."); X wait (0); X puts ("Sendmail done"); X } X pop_break(); X} X X#endif X#ifdef AMIGA X Xstatic void Xsend_mail() X{ X static char Buf[256]; X X push_break(); X sprintf(Buf, "%s < %s%s -f %s", S_sendmail, file, (S_verbose ? " -v" : ""), user_name); X X printf("Sending\n"); X if (Execute(Buf, NULL, NULL) == 0) X printf("Unable to run: %s\n", Buf); X X pop_break(); X} X X#endif X X X X X Xstatic Xarchive_mail(ptr) Xchar *ptr; X{ X FILE *ifi, *ofi; X long tim = time(NULL); X X if (!ptr) X ptr = get_var(LEVEL_SET, "archive"); X if (ptr == NULL || *ptr == '\0') X return(-1); X ifi = fopen(file, "r"); X if (ifi == NULL) { X puts ("Cannot open scratch file"); X return(-1); X } X ofi = fopen(ptr, "a"); X if (ofi == NULL) { X puts ("Cannot open archive file"); X fclose(ifi); X return(-1); X } X sprintf (Buf, "\nFrom %s (ARCHIVE)\n", user_name); X fputs (Buf, ofi); X sprintf (Buf, "Date: %s", ctime(&tim)); X fputs (Buf, ofi); X while (fgets (Buf, MAXFIELDSIZE, ifi)) X fputs (Buf, ofi); X fclose(ofi); X fclose(ifi); X return (1); X} X X END_OF_FILE if test 9206 -ne `wc -c <'src/dmail/sendmail.c'`; then echo shar: \"'src/dmail/sendmail.c'\" unpacked with wrong size! fi # end of 'src/dmail/sendmail.c' fi echo shar: End of archive 6 \(of 16\). cp /dev/null ark6isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 16 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 -- Submissions to comp.sources.amiga and comp.binaries.amiga should be sent to: amiga@cs.odu.edu or amiga@xanth.cs.odu.edu ( obsolescent mailers may need this address ) or ...!uunet!xanth!amiga ( very obsolescent mailers need this address ) Comments, questions, and suggestions should be addressed to ``amiga-request'' (please only use ``amiga'' for actual submissions) at the above addresses.