simpson@usc.edu (Scott Simpson) (06/14/89)
We are a project using a Sun file server and a bunch of Sun clients and
all of our machines NNTP to read news from a separate machine called
wiley. We are not an ARPAnet site. We don't store news at all. Our
configuration looks like
________ minotaur
/
wiley - - - - - - - - - - - trwarcadia--------- bonodea (the clients)
\________ hermes
We also set up aliases in /usr/lib/aliases to forward all our mail to
the appropriate client. I have made a few changes to NNTP and rrn to
fake posted addresses so they always look like they were posted from
the file server. This means that if someone replies to your message,
it will always get to you even if you switch workstations, provided
that you update the alias file. Also, some of our client names clash
with other names in the UUCP map database, so we don't register them.
We only register the server. If an outgoing article has the client
name in it, a user cannot use "uuhosts" to find a path to us. This solves
this problem also. Here is how I did it:
1) To get posted articles to work (not followups to articles), I had to
modify "Pnews.header" in the rrn source directory. Change the line
fullname=`$sed < /etc/passwd -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\[
^,:;]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"`
to
fullname=`ypcat passwd | $sed -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\[
^,:;]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"`
so it uses the yellow pages. If not, your name won't show up in comments
in the posted line because most people are in the yellow pages database but
not a client's local password file. Next, change the article header lines
in the script so it generates a correct return address for your site. I
changed ours to
$cat > $tmpart <<EOHeader
From: `ypwhich`!$logname@usc.edu ($fullname)
Path: `ypwhich`!$logname
Newsgroups: $ng
Subject: $title
Expires:
References:
Sender:
Reply-To: `ypwhich`!$logname@usc.edu ($fullname)
Followup-To: $follow
Distribution: $dist
Organization: $orgname
Keywords:
EOHeader
The "ypwhich" command returns the name of our file server, which is also the
yellow pages server. So our return addresses look like
trwarcadia!simpson@usc.edu
since we are a UUCP site that hangs off of USC. This is all that is needed
to make Pnews work correctly. Now for followups to existing articles...
2) To get followups to work correctly, go to the rrn source directory and
modify the file config.h. Change the appropriate lines to
#undef GETHOSTNAME /* do we have a gethostname function? */
#undef DOUNAME /* do we have a uname function? */
#define PHOSTNAME "ypwhich" /* how to get host name with popen */
That is, we just fake rn out by telling it that ypwhich is our hostname
command. Followups will not generate correct Reply-To: headers.
3) The Reply-To: header in a followup will be generated correctly, but
the Path: and From: headers won't. To fake this, we need to modify NNTP.
Go the NNTP source directory and change directory to the "common"
directory. In the file "conf.h", change the lines
#define GHNAME /* Define if you have gethostname() */
#undef UUNAME /* Define to use /etc/uucpname */
/* If none of these are defined, */
/* inews will use the contents of */
/* /usr/include/whoami.h */
to
#undef GHNAME /* Define if you have gethostname() */
#undef UUNAME /* or define to use /etc/uucpname */
#define HNAMEPROGRAM "ypwhich"
/* or define the name of a program which gives */
/* the hostname */
/* If none of these are defined, */
/* inews will use the contents of */
/* /usr/include/whoami.h */
Yes, add a new define called HNAMEPROGRAM. This will be the name of the
program that gives us the hostname. We could created a /usr/include/whoami.h
file or a /etc/uucpname file on every system but this approach seemed unclean
to me since my system didn't have whoami.h to begin with and I didn't want
to create an /etc/uucpname file in every client's root partition. Now
change directory to the "inews" directory, which is on the same level as
this "common" directory. Edit the file "uname.c" and add the lines
#ifdef HNAMEPROGRAM
uname(uptr)
char *uptr;
{
FILE *popen();
FILE *pipefp = popen(HNAMEPROGRAM, "r");
if (pipefp == NULL) {
fprintf(stderr, "Cannot execute %s\n", HNAMEPROGRAM);
exit(1);
}
fgets(uptr, 80 /*?*/, pipefp);
uptr[strlen(uptr)-1] = '\0'; /* wipe out newline */
pclose(pipefp);
}
#define DONE
#endif /* HNAMEPROGRAM */
after the line
#endif /* UUNAME */
Your done! Recompile and reinstall NNTP and rn.
Scott Simpson
TRW Space and Defense Sector
oberon!trwarcadia!simpson (UUCP)
trwarcadia!simpson@usc.edu (Internet)