🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nn
2 messages
2 total messages Started by Peer Torngren Wed, 12 Oct 1994 14:46
Q: Default organization in file or environment?
#6519
Author: Peer Torngren
Date: Wed, 12 Oct 1994 14:46
35 lines
2064 bytes
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.

I HAVE
read then man page and found the 'set mail-header' entry.
read the FAQ and found the 'set-news-header' entry.
used 'set-news-header Organization: xxxx' in .../lib/nn/setup
done 'grep -i Organization *' in  the source directory 

I AM
running nn-6.4.18 over NNTP using local nnmaster database.
running 'tin' over NNTP
planning to run X-based readers over NNTP
in a different organization than the NNTP server

I WANT
*one* default organization name configured in my host 
all news posting software using the same name information

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.

Any suggestions would be severely appreciated!
--
Peer Toerngren, WM-data Konsult AB, S Kyrkogatan 4, S-652 24 Karlstad (Sweden)
Tel:   +46-(0)54/18 04 25		Fax:   +46-(0)54/15 67 85
Email: peer.torngren@kar1.wmdata.se
"Proper disclaimer applies wherever applicable."
Re: Q: Default organization in file or environment?
#6534
Author: 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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads