🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #6534

Re: Q: Default organization in file or environment?

#6534
From: Alex Martelli
Date: Sat, 15 Oct 1994 08:06
97 lines
3691 bytes
peto@kar1.wmdata.se (Peer Torngren) writes:
	...
>Can't see any way to set a system wide default ORGANIZATION for 'nn'
>in a way that allows all news readers (posters:-) to share the data.
	...
>Something similar to $NNTPSERVER would do just fine, or a way to have 
>.../lib/setup or .../lib/init read the organization name from a file or
>an environment variable (e.g. /etc/organization, $ORGANIZATION, etc).
	...
>Anybody out there willing to spread some light?
>I guess it's not the end of the world, I'll manage with the 
>'set-news-header' way of doing it, but I'd prefer to have all
>system-related configuration info in one place.

I've done it by patching the mini-inews sources from the version
supplied with nn; if your other newsnreaders can be set up to use
that...  Anyway, here's the diff, just 68 lines, and you should
be able to apply it directly with Larry Wall's "patch" program.

Output of: "diff inews.c inews.c.orig"

16,17d15
<  *
<  * AM 940612: added "Organization:" line... alex@cirfid.unibo.it
33,34c31
< #define	MAX_SIGNATURE	6
< #define ORGANIZA_FILE   "/home3/news/nn/nnorgan"
---
> #define	MAX_SIGNATURE	4
45c42
< 	int	seen_fromline, in_header, seen_header, seen_orgaline;
---
> 	int	seen_fromline, in_header, seen_header;
109d105
< 	seen_orgaline = 0;
120,126d115
< 		if (in_header && strneql(s, "Organization:", sizeof("Organization:")-1)) {
< 	                seen_header = 1;
< 			seen_orgaline = 1;
< #if DEBUG
< 	fprintf(stderr,"Organization line (%s)\n", s);
< #endif
< 		}
132,137d120
< #if DEBUG
< 	fprintf(stderr,"Seen fromline=%d orgaline=%d\n",
< 		seen_fromline, seen_orgaline);
< #endif
< 			        if (!seen_orgaline)
< 				        gen_orgapath();
414,451d396
< }
< 
< /*
<  * gen_orgapath -- generate Organization: line, in the form
<  *
<  *	Organization: ...
<  *
<  * This routine should only be called if the message doesn't have
<  * a Organization: line in it.
<  */
< 
< gen_orgapath()
< {
<     char *orgapath, buf[80];
< #ifdef ORGANIZA_FILE
<     FILE *it;
< 
<     it = fopen(ORGANIZA_FILE, "r");
<     if(it && fgets(buf,80,it)) {
< 	orgapath=buf;
< 	while(*orgapath && *orgapath!='\n' && (orgapath-buf)<79)
< 	    orgapath++;
< 	*orgapath = 0;
< 	orgapath = strdup(buf);
<     } else {
< 	orgapath = strdup("none in sight");
<     }
<     if(it) fclose(it);
< #else
<     orgapath = strdup("none in sight");
< #endif
<     
< #if DEBUG
<     fprintf(stderr,"Org: (%s)\n", orgapath);
< #endif
< 
<     fprintf(ser_wr_fp, "Organization: %s\r\n", orgapath);
<     free(orgapath);


Alex
--
 ____    Alex Martelli, Bologna, Italia
 \SM/___ Not-a-Blake-quote-department: I apologize for delays in answering
  \/\bi/ email but I'm utterly swamped -- I always enjoy _reading_ mail but
     \/  please be patient if I take a long time answering yours!  Thanks.
Technical Details
Message-ID: <alex.782208396@cirfid.unibo.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!bga.com!news.sprintlink.net!hookup!news.kei.com!uhog.mit.edu!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!ghost.dsi.unimi.it!dm.unibo.it!alex
References: <peto.781973198@charles>

Show Full Headers
Complete Article Headers
Message-ID: <alex.782208396@cirfid.unibo.it>
Subject: Re: Q: Default organization in file or environment?
Date: Sat, 15 Oct 1994 08:06:36 GMT
From: alex@uqbar.cirfid.unibo.it (Alex Martelli)
References: <peto.781973198@charles>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!bga.com!news.sprintlink.net!hookup!news.kei.com!uhog.mit.edu!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!ghost.dsi.unimi.it!dm.unibo.it!alex
Newsgroups: news.software.nn
Sender: news@dm.unibo.it
Organization: Wisdom & Folly, Inc.
X-Newsreader: NN version 6.5.0 #3
Lines: 97