[net.unix] Mailing articles to oneself for saving

sieg@bocar.UUCP (B A Siegel) (01/22/86)

I would like to after reading an article and wanting to save it ..
 - mail it to myself and retain the SUBJECT line and more importantly
   retain the original path .

I guess i'm saying is there a way I can mail the article to myself yet
make it seem that the article is a "simple piece of mail" mailed directly
to me?
   
In this manner I can then use MAILX (or whatever mailer) and scan which 
messages I want to later. I can simply use the mailers reply feature to 
send mail back to the poster later.

Note: when using the "write to file" feature of VNEWS it does not write 
the header info to the file.

Does anyone have any alternatives or suggestions to accomplish this?

Thanks

Barry Siegel
..ihnp4!bocar!sieg

greid@adobe.UUCP (Glenn Reid) (01/25/86)

The best way to do this is to avoid passing it through sendmail.
The way sendmail delivers mail locally is typically to call /bin/mail
with the undocumented -d flag, meaning "deliver this directly to
/usr/spool/mail/whoever, I guarantee that the header and format of
the message are correct and appropriate."  /bin/mail then sticks it
into the spool file, no questions asked, adding only the Unix "From "
line at the beginning.  It will not add a From: field, a Sender:
field, or whatever, although, again, the Unix "From " field will still
be you.  This is usually not a problem.

So try piping the message from your news reader through the shell
command:

| /bin/mail -d myself

This is probaby pretty 4.2 specific, I don't know.  It seems awfully
non-likely-to-be-portable to me....

Glenn Reid
Adobe Systems (disclaimer)
Palo Alto

ka@hropus.UUCP (Kenneth Almquist) (01/27/86)

> In this manner I can then use MAILX (or whatever mailer) and scan which 
> messages I want to later. I can simply use the mailers reply feature to 
> send mail back to the poster later.
>
> Note: when using the "write to file" feature of VNEWS it does not write 
> the header info to the file.

Use the 's' command rather than the 'w' command.  This will save the
header and will also prepend a from line so that your mail reading
program can find the beginning of it.  After you've saved all the
articles that you want to respond to in the file, you can use the -f
option of mailx to cause mailx to read that file instead of reading
your mailbox.
					Kenneth Almquist
					ihnp4!houxm!hropus!ka
					ihnp4!opus!ka  (shorter)

bobr@zeus.UUCP (Robert Reed) (01/28/86)

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 <stdio.h>

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

earle@smeagol.UUCP (Greg Earle) (02/01/86)

> I would like to after reading an article and wanting to save it ..
>  - mail it to myself and retain the SUBJECT line and more importantly
>    retain the original path .

> Note: when using the "write to file" feature of VNEWS it does not write 
> the header info to the file.

Erm, are you awake when you use vnews? :@)  When I type ?, my list of
commands has "s  save article in file", and "w  save article WITHOUT
HEADER".  Which instantly implies to me that the 's' option saves it
WITH the header.  And when you try this, voila! whaddya know, it works ...

	
	Greg Earle
	JPL Spacecraft Data Systems group
	sdcrdcf!smeagol!earle (UUCP)
	ia-sun2!smeagol!earle@csvax.caltech.edu (ARPA)
-- 

	Greg Earle
	JPL Spacecraft Data Systems group
	sdcrdcf!smeagol!earle (UUCP)
	ia-sun2!smeagol!earle@csvax.caltech.edu (ARPA)