[news.newusers.questions] Fetching msgs by their IDs

packer@chrpuser.gsfc.nasa.gov (11/28/89)

I have noticed people make free use of the Message ID in 
referring to previous messages. For example, in an E-mail
reply to my recent test message here, someone wrote

In article <564@dftsrv.gsfc.nasa.gov> you write:
=>Could someone from outside Goddard Space Flight Center

Suppose I wanted to read the original message <564@dftsrv.....
There doesn't seem to be a way to fetch it directly using
this ID.  Am I right in supposing that I would just have to do
a pattern search for its earliest occurence in the newsgroup?

merlyn@iwarp.intel.com (Randal Schwartz) (11/30/89)

In article <566@dftsrv.gsfc.nasa.gov>, packer@chrpuser writes:
| I have noticed people make free use of the Message ID in 
| referring to previous messages. For example, in an E-mail
| reply to my recent test message here, someone wrote
| 
| In article <564@dftsrv.gsfc.nasa.gov> you write:
| =>Could someone from outside Goddard Space Flight Center
| 
| Suppose I wanted to read the original message <564@dftsrv.....
| There doesn't seem to be a way to fetch it directly using
| this ID.  Am I right in supposing that I would just have to do
| a pattern search for its earliest occurence in the newsgroup?

This depends on your newsreader.  In Gnews, I just point somewhere
near the message-ID in the text, and hit "@".  RN would take something
like "?Message-ID: <564@....>?hr" at the correct prompt.

See the manual on your particular newsreader.

Just another news-reader :-),
-- 
/== Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ====\
| on contract to Intel's iWarp project, Hillsboro, Oregon, USA, Sol III  |
| merlyn@iwarp.intel.com ...!uunet!iwarp.intel.com!merlyn	         |
\== Cute Quote: "Welcome to Oregon... Home of the California Raisins!" ==/

eps@toaster.SFSU.EDU (Eric P. Scott) (12/02/89)

This is a quick late-night "10-minute hack" to look up message IDs.
It works on my system, it may need a little work on yours.  It's
faster than searching in rn, and will work even if the referenced
article was in a different newsgroup, and redirected followups.
(It has to be executed on the machine that keeps the history, so
it's not really useful if you are using client NFS or NNTP).

					-=EPS=-
-------
/*
 * Print B News history record for specified message-ids
 * Eric P. Scott, SFSU, December 1989
 */
#include <stdio.h>
#include <dbm.h>
#ifndef HIST
#define HIST "/usr/lib/news/history"
#endif

main(argc, argv)
int argc;
char *argv[];
{
	register int i, c;
	register FILE *f;
	datum k, d;

#ifdef USG
	char *malloc();
	setbuf(stdout, malloc(BUFSIZ));
#endif
	if (argc<2) {
		fprintf(stderr, "Usage: %s \"<message-id>\" ...\n\
\t(note that message-ids are normally folded to lowercase in history)\n", *argv);
		exit(1);
	}
	if (dbminit(HIST)<0) {
		perror("can't open history database");
		exit(1);
	}
	f=(FILE *)NULL;
	i=1; do {
		k.dsize=strlen(k.dptr=argv[i++])+1;
		d=fetch(k);
		if (d.dptr&&(d.dsize==sizeof (long))) {
			if (!f&&!(f=fopen(HIST, "r"))) {
				perror(HIST);
				exit(1);
			}
			(void)fseek(f, *(long *)d.dptr, 0);
			while ((c=getc(f))>=' '||c=='\t') putchar(c);
			putchar('\n');
		}
		else printf("%s not found\n", k.dptr);
	} while (i<argc);
	if (f) fclose(f);
#ifdef DBZ
	dbmclose();
#endif
	exit(0);
}

tale@cs.rpi.edu (Dave Lawrence) (12/03/89)

In article <172@toaster.SFSU.EDU> eps@toaster.SFSU.EDU (Eric P. Scott) writes:

   This is a quick late-night "10-minute hack" to look up message IDs.
   It works on my system, it may need a little work on yours.  It's
   faster than searching in rn, and will work even if the referenced
   article was in a different newsgroup, and redirected followups.
   (It has to be executed on the machine that keeps the history, so
   it's not really useful if you are using client NFS or NNTP).

Note that C News has "newshist" in $NEWSBIN/maint.  It will even work
over NFS mounted file systems (how come your's doesn't?):

netserv2:tale (1) /usenet/bin.server/maint/newshist 172@toaster.SFSU.EDU
<172@toaster.SFSU.EDU>	628603751-~	news.newusers.questions/1009

Note that NNTP already has a mechanism for directly accessing articles
by Message-ID.  GNUS has a couple of features which take advantage of
this; I don't know whether other NNTP readers are similarly equipped.

Dave
-- 
   (setq mail '("tale@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))

eps@toaster.SFSU.EDU (Eric P. Scott) (12/03/89)

In article <25781205.734E@rpi.edu> tale@cs.rpi.edu (Dave Lawrence) writes:
>Note that C News has "newshist" in $NEWSBIN/maint.  It will even work
>over NFS mounted file systems (how come your's doesn't?)

Simple.  We don't export /usr/lib/news, and don't keep history on
the spool partition.  C News can't claim any superiority here, it
just needs more debugging tools.  :-)  Given that I have NNTP, I'd
rather use that than have to know how history is actually maintained.

					-=EPS=-