allan@cs.strath.ac.uk (Allan Black) (05/05/89)
I send these patches to Phil Lapsley @ Berkley and he suggested I post them to the net, for those who may be interested in the meantime .... The mini-inews as shipped with 1.5 NNTP caused some problems for us, since it insisted on prepending the host name to our domain. The only registered name we have in the UK NRS is cs.strath.ac.uk, the same as our local domain. the resulting "login@localhost.cs.strath.ac.uk" confused a few mailers! I put in a mod to the mini-inews to make it do something like the netnews HIDDENNET header generation, and here it is, if you're interested. The patches are to four files (fairly trivial): common/conf.h new define/undefine HIDDENNET inews/inews.c new ifdef'd code common/README inews/README Allan -------- Cut Here -------- *** common/README.orig Tue Apr 18 11:33:56 1989 --- common/README Wed May 3 12:31:01 1989 *************** *** 205,210 If your hostname system call does return a fully-qualified name, simply undef DOMAIN. SERVER_FILE ("/usr/local/lib/rn/server") --- 205,218 ----- If your hostname system call does return a fully-qualified name, simply undef DOMAIN. + HIDDENNET (defined) + + If HIDDENNET is defined, it forces inews to interpret DOMAIN as + a complete host name, i.e. the local host is not prepended in the From: + header. The Path: header is generated with only the login name, allowing + inews on the nntp server to fill in the UUCP path. This has the effect of + making all machines on a local network look, to the outside world, as a + single host. SERVER_FILE ("/usr/local/lib/rn/server") *** common/conf.h.orig Wed May 3 12:32:51 1989 --- common/conf.h Wed May 3 12:11:13 1989 *************** *** 146,151 * Suggestions are .UUCP if you don't belong to the Internet. * If your hostname returns the fully-qualified domain name * as some 4.3 BSD systems do, simply undefine DOMAIN. * * e.g. #define DOMAIN "berkeley.edu" */ --- 146,153 ----- * Suggestions are .UUCP if you don't belong to the Internet. * If your hostname returns the fully-qualified domain name * as some 4.3 BSD systems do, simply undefine DOMAIN. + * Define HIDDENNET if you want to make a local network look + * like a single host. * * e.g. #define DOMAIN "berkeley.edu" */ *************** *** 151,156 */ #define DOMAIN "cs.strath.ac.uk" /* * A file containing the name of the host which is running --- 153,159 ----- */ #define DOMAIN "cs.strath.ac.uk" + #define HIDDENNET /* * A file containing the name of the host which is running *** inews/README.orig Tue Apr 18 11:34:14 1989 --- inews/README Wed May 3 12:25:03 1989 *************** *** 14,20 Path: hostname!login where DOMAIN is a #define in ../common/conf.h, and should be changed ! to reflect your system. A good choice is .UUCP if you are not a member of the Internet. "Full_name" understands the & hack in password files. --- 14,20 ----- Path: hostname!login where DOMAIN is a #define in ../common/conf.h, and should be changed ! to reflect your system. A good choice is "UUCP" if you are not a member of the Internet. "Full_name" understands the & hack in password files. If "HIDDENNET" is defined in ../common/conf.h, DOMAIN is used as the complete host name, and the format used is *************** *** 16,22 where DOMAIN is a #define in ../common/conf.h, and should be changed to reflect your system. A good choice is .UUCP if you are not a member of the Internet. "Full_name" understands the & hack in ! password files. "hostname" is figured out by what you've #defined in ../common/conf.h. If you have defined GHNAME, it uses the gethostname() call. --- 16,26 ----- where DOMAIN is a #define in ../common/conf.h, and should be changed to reflect your system. A good choice is "UUCP" if you are not a member of the Internet. "Full_name" understands the & hack in ! password files. If "HIDDENNET" is defined in ../common/conf.h, ! DOMAIN is used as the complete host name, and the format used is ! ! From: login@DOMAIN (Full_name) ! Path: login "hostname" is figured out by what you've #defined in ../common/conf.h. If you have defined GHNAME, it uses the gethostname() call. *** inews/inews.c.orig Tue Apr 18 11:34:14 1989 --- inews/inews.c Wed May 3 13:14:57 1989 *************** *** 217,222 } #ifdef DOMAIN /* A heuristic to see if we should tack on a domain */ --- 217,227 ----- } #ifdef DOMAIN + #ifdef HIDDENNET + fprintf(ser_wr_fp, "From: %s@%s (", + passwd->pw_name, + DOMAIN); + #else /* HIDDENNET */ /* A heuristic to see if we should tack on a domain */ *************** *** 230,235 passwd->pw_name, host_name, DOMAIN); #else fprintf(ser_wr_fp, "From: %s@%s (", passwd->pw_name, --- 235,241 ----- passwd->pw_name, host_name, DOMAIN); + #endif /* HIDDENNET */ #else fprintf(ser_wr_fp, "From: %s@%s (", passwd->pw_name, *************** *** 246,251 fprintf(ser_wr_fp, ")\r\n"); fprintf(ser_wr_fp, "Path: %s!%s\r\n", host_name, passwd->pw_name); } --- 252,261 ----- fprintf(ser_wr_fp, ")\r\n"); + #ifdef HIDDENNET + /* Only the login name - nntp server will add uucp name */ + fprintf(ser_wr_fp, "Path: %s\r\n", passwd->pw_name); + #else /* HIDDENNET */ fprintf(ser_wr_fp, "Path: %s!%s\r\n", host_name, passwd->pw_name); #endif /* HIDDENNET */ } *************** *** 247,252 fprintf(ser_wr_fp, ")\r\n"); fprintf(ser_wr_fp, "Path: %s!%s\r\n", host_name, passwd->pw_name); } --- 257,263 ----- fprintf(ser_wr_fp, "Path: %s\r\n", passwd->pw_name); #else /* HIDDENNET */ fprintf(ser_wr_fp, "Path: %s!%s\r\n", host_name, passwd->pw_name); + #endif /* HIDDENNET */ } -------- Cut Here --------