Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site zeus.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!pyramid!hplabs!tektronix!teklds!zeus!bobr From: bobr@zeus.UUCP (Robert Reed) Newsgroups: net.unix Subject: Re: Mailing articles to oneself for saving Message-ID: <304@zeus.UUCP> Date: Tue, 28-Jan-86 01:50:52 EST Article-I.D.: zeus.304 Posted: Tue Jan 28 01:50:52 1986 Date-Received: Sat, 1-Feb-86 01:02:45 EST References: <257@bocar.UUCP> <1081@adobe.UUCP> Reply-To: bobr@zeus.UUCP (Robert Reed) Organization: Tektronix, Beaverton OR Lines: 42 Keywords: binmail I wrote a program a year or more ago which serves this specific function under 4.2BSD. I make no claims for it working anywhere else, but it's very cheap and fast, and short enough to include here. It works as a data sink, receiving a stream piped from vnews or rn, and dumps the result with no additions into the user's mail spool file: /* mbox - add delimiters to news article and dump in mail queue */ #include main(argc,argv) int argc; char **argv; { char spool[60]; FILE *fd; char line[200]; /* Open this user's spool file */ sprintf(spool, "/usr/spool/mail/%s", getenv("USER")); if ((fd = fopen(spool, "a")) == NULL) { fprintf(stderr, "mbox: Could not open spool file"); exit(1); } /* Stream the standard input through, preceding and following with mail delimiters */ fprintf(fd, "\n"); while (gets(line) != NULL) fprintf(fd, "%s\n", line); fprintf(fd, "\n"); /* Done */ fclose(fd); } -------- When I was little, we had a a quicksand box. I was an only child... ...eventually. --Steve Wright -------- Robert Reed, CAE Systems Division, tektronix!teklds!bobr