From: jstine@logiconultra.com (Jim Stine)
Subject: Re: In-coming mail to news question - solutions sent
Organization: Logicon_Ultrasystems
Date: Tue, 12 Jan 1993 19:28:09 GMT

These are all the responses that I've gotten as to how to get e-mail  
injected
into news.

The system that news is running on is an HP 400 running HP/UX V8.  This  
meant
that I didn't feel like spending the time trying to convert some Sun  
solution
again.  Somewhere down there is a program that Bill Kennedy submitted to  
me that he called fmplus.  All it does is take standard input as an e-mail  
message and formats it to standard output as a news article.  It sticks  
alot of canned stuff in there like the news category but it transfers the  
important stuff like the subject.  I followed his suggestion and added an  
alias to my usr/lib/aliases file to pipe the e-mail message to the fmplus  
program and then pipe the output directly to relaynews.  In that case, the  
aliases line looks like this:

pronext-news: "|/usr/local/bin/fmplus_pn |  
/usr/lib/newsbin/relay/relaynews"

The way this is now, I would have to have a different version of the  
program for each news category.  I suppose that sometime, I will modify  
the program to accept command line input specifying the news category.

Anyway it works....Here's the responses:


jim

jstine@logiconultra.com


Date: Thu, 7 Jan 1993 16:00:32 -0600
From: Steve Hanson <hanson@pogo.fnal.gov>
To: jstine@logiconultra.com
Subject: Re: In-coming mail to news question
Newsgroups: news.software.b
Reply-To: hanson@pogo.fnal.gov
Organization: FERMILAB, Batavia, IL

Rich Salz wrote such a package a long time ago.  It's called
newsgate and is what most people use.  The docs are a little
less than complete, but you should be able to figure it out.
You should be able to find newsgate on most archive sites.
-- 
Steve Hanson - FERMILAB, Batavia, Il.
hanson@pogo.fnal.gov or hanson@fnal.fnal.gov


Date: 	Thu, 7 Jan 1993 16:43:30 -0500
From: news@geovision.gvc.com (News Administrator)
To: jstine@logiconultra.com
Subject: Re: In-coming mail to news question
Newsgroups: news.software.b
Reply-To: PTomblin@gvc.com
Organization: Mailed from, but not for, GeoVision Systems Inc., Ottawa,  
Ontario
X-Registered: 

[This is some stuff I sent somebody after I'd set up a local.onet  
newsgroup
to gateway a mailing list called `orienteering@graphics.cornell.edu'.
 
Well - I use C News, but I think it will work with INN and other news
transport software as well, as long as you have:
a) A program called inews to inject the news, probably in /usr/local/bin  
or
/bin or /usr/bin.
b) Some way of controlling where the mail to the moderators goes.  In C
news, there is a file called $NEWSCTL/mailpaths that controls this.
 
What I did:
o   Installed the program perl2news (which I'll attach to this message)
    somewhere easily accessible (I choose /usr/local/bin) and made it
    globablly executable.  [Probably requires root priviledges]
 
o   Modified perl2news so that it knows where inews is, and set SIGDIR to
    the name of a directory where there is NOT a .signature file
 
o   Added a line in the mailpaths before the 'all ...' line that said
    'local.onet pt@geovison.gvc.com' - once this whole thing worked I
    changed that to 'local.onet orienteering@graphics.cornell.edu'.
    [Requires News Administrator priviledges]

o   Created a moderated newsgroup called local.onet.  In C News the  
command
    was '$NEWSBIN/maint/addgroup local.onet m'.  (This means that any
    postings, instead of posting to the group, gets mailed to the mailing
    list instead).
    [Requires News Administrator priviledges]
 
o   Added a mail alias in the /etc/aliases file that looked like:
    onet:   "|/usr/local/bin/perl2news local.onet"
    and ran newaliases.  This causes any mail to onet@geovision.gvc.com to
    be run through the perl2news script, which posts it to the newsgroup
    (with the 'Approved:' header, as if a moderator had approved it)
    [Requires Root priviledges]
 
At this point, I used the 'bounce' command in elm to send some stuff to
onet@geovision.gvc.com, and verified that it appeared in the group.  I  
then
tried posting, replying and followups, and verified that posts and  
followups
were sent to the designated moderator (me), and replys went to the actual
person who posted the original message on the mailing list.  I then  
changed
the moderators address to the mailing list address, and asked the mailing
list administrator to subscribe onet@geovision.gvc.com to the mailing list
directly.

I've had one complaint from somebody on the mailing list who said that the
stuff that has been sent to the mailing list from my news system has had
some headers (Newsgroups, Organization, Lines, References, and Path) that
are not valid for mail.  He doesn't say that _his_ mailer is having  
trouble,
just that ``some'' may.  I'm going to look into stripping some of them -  
but
I really want to leave the 'References' one in so that `trn' can thread
things.  I think I'll just take a ``quick'' poll, and see if I have to  
strip
anything, because personally, I've seen a _lot_ on non-standard headers on
mail messages I've recieved from other sources, so I doubt that any mail
readers could choke on them.
 
--perl2news---
#!/usr/bin/perl
 
# LOCAL CONFIGURATION:
#   INEWSPLACE == Where to find the program `inews' - usually  
/usr/local/bin
$INEWSPLACE = "/usr/local/bin/inews";
#   SIGDIR == A directory where to find a .signature file (or somewhere
#       where there _isn't_ a signature file
$SIGDIR = "/usr/new/lib/news/onet";
#   MODNAME == A name for the `automatic moderator' - I use the name of  
the
#   mailing list administrator
$MODNAME = "mkc@graphics.cornell.edu";
 
($program = $0) =~ s%.*/%%;
 
($version) = $] =~ /(\d+\.\d+).*\nPatch level/;
die "$program:  require at least version 3 of perl\n"
    if $version < 3;
 
$inews = $INEWSPLACE;
$inews = "/usr/lib/news/inews" unless -x $inews;
$inews = "/usr/lib/news/bin/inews" unless -x $inews;
die "$program: can't find inews\n" unless -x $inews;
$iopts = "-h";
 
if ($#ARGV < 0) {
    # $newsgroup = test";
    # We'll expect the newsgroup line in the body
} elsif ($#ARGV == 0) {
    $newsgroup = $ARGV[0];
} else {
    die "usage: $program [newsgroup]\n";
}
 
# in case inews dumps core or something crazy
$SIG{'PIPE'} = "plumber";
sub plumber { die "$program: \"$inews=\" died prematurely!\n"; }
 
$ENV{'HOME'} = $SIGDIR;
 
open(INEWS, "| $inews $iopts") ||
    die "$program: can't run $inews\n";
 
# Header munging loop
while (<STDIN>) {
    last if /^$/;
 
    # Transform real from: line back to icky style
    s/^From: \s+(.*) <(.*)>/From: $2 ($1)/;
 
    # Transform from_ line to path header; also works locally
    s/^From\s+(\S)@(\S+).*/Path: $2!$1/
        || s/^From\s+(\S+)[^@]*$/Path: $1\n/;
 
    print INEWS
      if
/^(From|Subject|Date|Path|Newsgroups|Organization|Message-ID|References
): /i;
 
    $saw_subject |= ($+ eq 'Subject');
    $saw_newsgroup |= ($+ eq 'Newsgroups');
    $saw_org |= ($+ eq 'Organization');
}
 
warn "$program: didn't expect newsgroup in both headers and ARGV\n"
    if $newsgroup && $saw_newsgroup;
die "$program: didn't get newsgroup from either headers or ARGV\n"
    unless $newsgroup || $saw_newsgroup;
 
printf INEWS "Newsgroups: %s\n", $newsgroup if $newsgroup;
print INEWS "Subject: Untitled\n" unless $saw_subject;
print INEWS "Organization: None\n" unless $saw_org;
printf INEWS "Approved: %s\n", $MODNAME;
print INEWS "\n";
 
print INEWS while <STDIN>;  # gobble rest of message
 
close INEWS;
exit $?;
--end--

Hope this helps.
Paul Tomblin (pt@compass.gvc.com)

-- 
I'm the News Administrator at this site, and you're not!
I just administer the news, I don't make or state policy.


To: jstine@logiconultra.com
Subject: Re: In-coming mail to news question
Newsgroups: news.software.b
Date: Thu, 7 Jan 93 17:16:00 EST
From: gedwards@ncratl.atlantaga.ncr.com

I do it here to have mailling lists gatewayed to newsgroups...

Basically you need to have the incoming mail message piped into the
program named recnews which will post it for you.

On my system (System V with smail and B News) I do the following... I'll
use the Falcon3.0 mailing list as an example since I just set it up
today...

In /usr/lib/mail/aliases I add an entry to tell smail to take mail
messages sent to the address falcon3-list and pipe them to a program
(which is defined in mailcmd.cf).  Here's the line from  
/usr/lib/mail/aliases:

falcon3-list	via-mailcmd:falcon3-list

In /etc/mailcmd.cf I have:

falcon3-list::uucp::::/usr/lib/news/recnews local.mailing-list.falcon3

Which tells smail/mailcmd to execute recnews to post the mail message
in the group local.mailing-list.falcon3 (which I created beforehand).

The only problem is that if a user followsup to an article in the  
newsgroup
the articles is posted locally but is not mailed back to the address 
where mailing-list articles are to be sent.

I'm sure the same setup can be done using sendmail to.  If I remember
correctly you can use it's aliases file to tell it to invoke programs
(like recnews) when mail is sent to certain addresses... or you could
put

|recnews local.mailing-list.falcon3

in the .forward file for the account for the mail address (but this
means you have to create an account for the address receiving mail).
The aliases method doesn't require the account.

-- Gordon

---
========================================================================== 
===
Gordon Edwards, N4VPH              |         "Nothing Unreal Exists"
NCR Engineering & Manufacturing    |
gedwards@ncratl.atlantaga.ncr.com  |  Kiri-Kin-Tha's First Law of  
Metaphysics


To: jstine@logiconultra.com
Subject: Re: In-coming mail to news question
Newsgroups: news.software.b
Date: Thu, 7 Jan 93 17:16:00 EST
From: gedwards@ncratl.atlantaga.ncr.com

In news.software.b you write:
>Is there any way to cause in-coming e-mail to be posted as news articles?   
>I would like to post any e-mail coming to a particular address to a a  
>particular news-group.  Optimally, I would like to have the e-mail  
subject  
>transferred to the news article subject as well.

I do it here to have mailling lists gatewayed to newsgroups...

Basically you need to have the incoming mail message piped into the
program named recnews which will post it for you.

On my system (System V with smail and B News) I do the following... I'll
use the Falcon3.0 mailing list as an example since I just set it up
today...

In /usr/lib/mail/aliases I add an entry to tell smail to take mail
messages sent to the address falcon3-list and pipe them to a program
(which is defined in mailcmd.cf).  Here's the line from  
/usr/lib/mail/aliases:

falcon3-list	via-mailcmd:falcon3-list

In /etc/mailcmd.cf I have:

falcon3-list::uucp::::/usr/lib/news/recnews local.mailing-list.falcon3

Which tells smail/mailcmd to execute recnews to post the mail message
in the group local.mailing-list.falcon3 (which I created beforehand).

The only problem is that if a user followsup to an article in the  
newsgroup
the articles is posted locally but is not mailed back to the address 
where mailing-list articles are to be sent.

I'm sure the same setup can be done using sendmail to.  If I remember
correctly you can use it's aliases file to tell it to invoke programs
(like recnews) when mail is sent to certain addresses... or you could
put

|recnews local.mailing-list.falcon3

in the .forward file for the account for the mail address (but this
means you have to create an account for the address receiving mail).
The aliases method doesn't require the account.

-- Gordon

---
========================================================================== 
===
Gordon Edwards, N4VPH              |         "Nothing Unreal Exists"
NCR Engineering & Manufacturing    |
gedwards@ncratl.atlantaga.ncr.com  |  Kiri-Kin-Tha's First Law of  
Metaphysics

Date: Fri, 8 Jan 1993 13:31:23 +1100
From: giles@promed.com.au
To: jstine@logiconultra.com
Subject: Re: In-coming mail to news question
Newsgroups: news.software.nn

Jim,

	Here I pass mail to our 'support' user to a local newsgroup.
For this one address, one newsgroup problem I used a .maildelivery file
to give the mail to inews.  (Sendmail would use a .forward file, with
different syntax.)

*	-	| A	/usr/local/bin/inews -h -d local -n promed.support

	This adds the 'Newsgroup:' and 'Distribution:' headers and gives
to C News.  The subject and sender are preserved.

	Later I made the command a script which munged the From address
(since _all_ postings were from 'Superuser', and I wanted the originating
machine).  It should be fairly simple to tweak this to a more general
solution which only provided default newsgroup and distribution for
example.

Regards,

Giles


Date: Fri, 8 Jan 1993 08:52:39 -0700
From: bware@slate.mines.colorado.edu (Bob Ware)
To: jstine@logiconultra.com


To: jstine@logiconultra.com (Jim Stine)
Subject: Re: In-coming mail to news question
Newsgroups:  
news.sysadmin,news.admin,news.misc,news.newsanswers.questionsnews.software 
nnnews.software.b
Organization: Colorado School of Mines


I just now did that with the following line in our /etc/aliases file.

nnet-mlist:|"/usr/local/bin/inews -n csm.cris.nnet-mlists -t nnet-mlist"

I did not find an easy way to transfer the subject line to the news
article.  If you find an easy way to do that, please let me know.

--
Bob Ware, System Administrator 
Computing and Networking, Colorado School of Mines, Golden, Co 80401, USA
(303) 273-3987
bware@mines.colorado.edu


Date: Fri, 8 Jan 93 14:14:38 EST
From: bochner@das.harvard.edu
To: jstine@logiconultra.com (Jim Stine)
Subject: Re: In-coming mail to news question

You don't mention your operating system, so it's hard to say.
Under SunOS (and probably other BSD based unixes) it isn't hard.
All you have to do is alias the address so that the mail is piped to
a script that manipulates the headers a little, and then pipes the result  
to
"inews". Here's a simplified version of the perl script I use:

#!/usr/local/bin/perl

# read mail header
while (<>) {
    last if /^\s*$/;
    push(@mailhdr, $_);
}

# read body of msg
while (<>) {
    push(@body, $_);
}

# copy select items from mail header to article header
@hdr = grep(/^(from|reply-to|subject|date):/i, @mailhdr);

# news requires a space after the field-name:
# make sure it's there
grep(s/^([-\w])+:(\S)/\1: \2/, @hdr);

# supply canned fields
push(@hdr,
     "Newsgroups: newsgroupname\n",
     "Path: glan-news-gateway\n");

# Subject field is required; add one if needed
push(@hdr, "Subject: article forwarded from mail\n")
    unless grep(/subject/i, @hdr);

$tmpfile = "/tmp/glan$$";
open(TMP, ">$tmpfile");
print TMP @hdr, "\n", @body;
close(TMP);

$tmpout = "/tmp/inews$$";
$status = 0;
if (system("/usr/local/bin/inews $tmpfile >$tmpout") != 0) {
    # posting failed; try to include the error message in the returned  
mail
    open(IN, "<$tmpout");
    print <IN>;
    # exitting with nonzero status will make sendmail return the mail
    $status = 1;
}

unlink $tmpfile, $tmpout;
exit $status;


-- 
Harry Bochner
bochner@das.harvard.edu


Date: Fri, 8 Jan 93 15:09:37 -0800
From: Michael Ross <antigone!mross@netcom.com>
To: jstine@logiconultra.com
Subject: Re: In-coming mail to news question
Reply-To: antigone!mross@netcom.com


Unix-listserv has a feature to "connect" a mailing list to a newsgroup, so  
that all postings to the list get also sent to the newsgroup. I have not  
used this feature yet so I can't tell you if it works smoothly, but I will  
be soon...

It can be ftp'ed from cs.bu.edu.

Michael


To: jstine@logiconultra.com
Subject: Re: In-coming mail to news question
Newsgroups:  
news.sysadmin,news.admin,news.misc,news.newsanswers.questionsnews.software 
nnnews.software.b
Organization: XeniTec Consulting, Kitchener, Ontario, CANADA
Date: Mon, 11 Jan 93 0:40:00 EST
From: Ed Hew <eah@xenitec.on.ca>


The following psuedo-doc, created in a moment of hacker weariness,
might help you.  While I've made some minor changes since I wrote
this up, the principles still apply.

		--ed
----
Ok, here you go.  Some caveats:
- this is pretty raw as a doc goes.  I won't submit myself to
  crucifixtion if there are any inaccuracies, although I'll
  help you if I can.
- Some of the code may have likely changed, sometimes for the
  better, since I wrote this up.  If anything gives you grief,
  ask me about it.  I'll reply, but I wear way to many hats, so
  it might take a while, especially at times when I'm offsite
  for a couple of weeks.
- you are welcome to give me credit for the parts that work
  for you. :-)

		--ed
-----
: Date: Wed, 29 Jan 1992 00:00:18 -0500

I've put off documenting this for long enough, so ....

We assume you have the following at a decent patchlevel:
	C News
	mmdfII (preferrably level43)
	perl
If you are missing any of the above, many public archive sites
have source for these available.  If you can't find anyone closer,
email me and I'll send you current nuucp info for xenitec.on.ca.

Your mileage may vary and require a hackers toolkit in the trunk.
All my comments rely on the presence of the above.  You can do
this in many ways with other methods and packages.  The examples
are pulled from a working (almost 2 years) bi-gated gateway on
our box (SCO UNIX 3.2v2).  Only the names are modified to protect
the innocent.

To make installation a modicum simpler, you'll note that simply
replacing "mylist" in all alias, file, and instruction occurances
will give you something specific to your intentions.  The will be
some hand-tweaking involved.

Let's take the two parts and separate them to avoid confusion.

Part 1:  Mail=>News
-------------------
Mail Aliases:
You will require an alias in your local alias file.
	- log in (or su to) mmdf
	- add your aliases to /usr/mmdf/table/alias.ali
	  # where add/delete request messages go:
	mylist-request: edhew, gws
	  # where admin requests go:
	mylist-admin:	edhew, gws
	  # the news=>mail injector director (more on this later)
	mylist:		news|/usr/local/bin/bexec  
/usr/local/bin/mylist-inj
	  # how we snarf mailing list addresses from a file.
	mylist-local:	< /usr/local/lib/mylist-list

Change the location of the actual alias file if you must.
I keep it in:		/usr/local/lists/mylist-list

The format is simply one address per line.  You can optionaly
include the person's real name in parens () if you wish. eg.

(Local User) localu@mysite.domain
(Joe Well-Connected) joewc@downstream.com
(Barny Bangpath-Only) our-forwarder!upstream!upstream!...!barnbox!barnybo
(Nancy Needs-Forwarder) nancynf%hard-to-get-to@uunet.uu.net

Remember, thou shalt not mix "!" and "@".

Mail => News injector:
---------------------
Place your mail=>news injector (modify the one below) in
/usr/local/bin (note perms, uid, gid).
-rwx------   1 news     news     317 Oct 23 22:39  
/usr/local/bin/mylist-inj

If you need to customize your news article headers, do it here.
You will have to modify those below to correspond to your local
information.

This takes stdin, prepends it with your customized headers, and
feeds it to inews (comes with your news package).  Note that the
"print" lines only take effect if the header is not already
present in stdin.

==============================  snippity snip  
============================== 

#!/usr/local/bin/perl

open(NEWSOUT, '|/usr/local/bin/inews -h') ||
	die("Can't open inews process\n");

select(NEWSOUT);
print("Newsgroups: local.news.group\n");
print("Resent-By: mmdf@mysite.domain\n");
print("Submit-to: mylist@mysite.domain\n");
print("Organization: [resent by] The MYLIST gateway and Propagation  
Society\n");
print("Precedence: bulk\n");
while (<STDIN>) {

	if (/^To:/) { next; }
	if (/X-/) { next; }

	print;

}

==============================  snippity snip  
============================== 

We call the perl mail=>news injector using "bexec".  You just
installed an alias that does this, remember?  :-)

-rwx--x--x   1 sys      sys        14080 Nov 18 1989 /usr/local/bin/bexec

The "bexec" copy I have has no copyright notice; if whoever the
author might be speaks up, I'll be happy to comply on notification.

I'm told "bexec" was a comp.sources.misc utility for use with
C-shell (which allows you to set shell = <shell to get non 386
executables>, such that anything that is not a binary is passed
to it), which processes the #! first line startup shell syntax.
It is what allows us to say #!/usr/bin/perl in the first line
of scripts and have perl execute them without calling perl directly.

The source is below, compile and install it.

==============================  snippity snip  
============================== 

#include <stdio.h>

#define SHELL		"/bin/sh"

extern void exit();
extern FILE *fopen();
extern void perror();
extern int fclose();
extern char *fgets();
extern int fprintf();
extern char *malloc();
extern int execve();

main(argc, argv, envp)
    char **argv, **envp;
{
    FILE *fp;
    char hashbang[1024];
    register char *cp;
    int nargc;
    char **nargv;

    if (argc < 2)
	exit(-1);
    if (!(nargv = (char **) malloc((argc + 2) * sizeof *nargv)))
    {
	perror(argv[1]);
	exit(-1);
    }
    if (!(fp = fopen(argv[1], "r")))
    {
	perror(argv[1]);
	exit(-1);
    }
    if (!fgets(hashbang, sizeof hashbang, fp))
    {
	(void) fclose(fp);
	(void) fprintf(stderr, "%s: cannot read\n", argv[1]);
	exit(-1);
    }
    (void) fclose(fp);
    if (hashbang[0] != '#' || hashbang[1] != '!')
    {
	argv[0] = SHELL;
	(void) execve(SHELL, argv, envp);
	perror(SHELL);
	exit(-1);
    }
    for (cp = hashbang + 2; *cp && *cp == ' '; cp++)
	;
    if (!*cp)
    {
	(void) fprintf(stderr, "%s: malformed #! line\n", argv[1]);
	exit(-1);
    }
    nargc = 1;
    for (nargv[0] = cp; *cp && *cp != ' ' && *cp != '\n'; cp++)
	;
    if (*cp)
	*cp++ = '\0';
    while (*cp == ' ')
	cp++;
    if (*cp && *cp != '\n')
    {
	nargv[nargc++] = cp;
	while (*cp && *cp != '\n')
	    cp++;
	*cp = '\0';
    }
    for (; argc; argc--)
	nargv[nargc + argc - 1] = argv[argc];
    (void) execve(nargv[0], nargv, envp);
    perror(nargv[0]);
    exit(-1);
}

==============================  snippity snip  
============================== 

Part 2:  News -> Mail Injection
-------------------------------
Of course, we have to get news articles back to the mlist.
Insert the following line into /usr/local/lib/news/sys

## syntax for inj[45]*:
## mlist:newsgroup/dist::/usr/local/bin/inj5 local_addr admin_addr  
sub_addr
##
mylist:local.news.group/all::/usr/local/bin/inj5  
mylist-local@mysite.domain mylist-admin@mysite.domain mylist@mysite.domain
##

This calls your news=mail injector, which in this example is named
"inj5".  A simplified rev is in the works to do much the same thing
with about 1/2 the code.  I'll revise this posting when it stops
arguing with me.

==============================  snippity snip  
============================== 

:
#	list.inj  2.3.5	 Ed Hew, Xenitec Consulting Services 
#	news => mlist injector
#	Thu Feb 14 02:03:31 EST 1991
#	Wed Jan 15 00:26:47 EST 1992
ORIG=/tmp/inj$$
# snarf articles from stdin
cat > $ORIG
MLIST=$1
RTO=$2
HFrm="From $RTO"
HRsf="Resent-From: "$3
HTo="To: distribution@mysite.domain"
(	echo "$HFrm"
	echo "$HRsf"
	echo "$HTo"
	egrep -v "(|^Lines: |^Resent-From: |^Resent-By: |^From  
|^Return-Receipt-To: )" $ORIG
) | /usr/lib/mail/execmail $MLIST
rm $ORIG
exit 0

==============================  snippity snip  
============================== 

It will take stdin, add the headers you've specified in your news
'sys' file entry, strip out the old ones you can't tolerate (not
to mention any bleed of the control A's some mailers use), stick it
all back together and feed it to "execmail".  If you're not running
mmdfII, you'll have to hack something appropriate.  Some SysVs may
have a useful "rmail", you'll have to check that out on your own box.

Troubleshooting:
---------------
Send something to mylist (your mailing-list submissions address).
It should wind up in your mailbox (if you are on the local list),
and once news runs, injected to the newsgroup.

Post to your "local.news.group".
It should appear in that newsgroup and also be sent to all
addresses in	/usr/local/lists/mylist-list

If not, check the names, perms, ownership, gid, and syntax of the
various files.

Acknowledgements and Comments:
-----------------------------
Although you can't blame any of the above on them, this psuedo-package
requires my thanks to my partner, Geoff Scully, and the many sco.pals
and net.friends who have fed me useful information over the years.

I'm thinking about providing a somewhat more automated installation,
but holding your breath might be detrimental to your health.

Please consider the potentially large adverse impact on bandwidth
useage inherent in the operation of a mailing list, especially
one that's popular and bi-gated to a newsgroup.  Ask your upstream
if they object before you start.  Also try to ensure that no one
else is already gating the same newsgroup.  If they are, then take
great pains to ensure that no reposts escape your site.  Any
slip-ups and you and the admin at the other gate will have many
fun hours sorting this out and hunting down the miriad of dups
charging around the 'NET, all half the admins on the 'NET growl
at you.

Large hint:  unless your intention is to re-propagate to the 'NET
at large, all your gated newsgroups should be local and preferably
not even remotely related to "real" USENET newgroups.

If you have mmdfII level 43, you can reduce the load on your
immediate upstream by modifying your uucp channel entry in
/usr/mmdf/mmdftailor :
MCHN    uucp, show="SCO UUCP Delivery", que=uucp, tbl=uuchn, ap=same,
        pgm=uucp, mod=imm, confstr="naddrs=15,maxlen=1024"
This will cause multiple address envelopes for copies being
forwarded via a single uucp site to be generated.  Depending
on the length of the actual addresses, it might save you as
much as a 15:1 reduction of bandwidth.  Caution:  don't
experiment with the values above unless you know what you're
doing.  They're set that way for a reason.  If you're using
the smtp channel, none of this matters.

We'll leave "resolution of infinite loops and rabid repeaters"
as a topic for another day.

Another topic to be written up:  "automated request/delete/admin
software".  I personally don't believe in it, as I've yet to see
any that actually leaves the administrator with _less_ work to do.

Some of the examples and terms may contain trademarks, noticeably
uunet.uu.net, SCO, ....
--
  Ed. A. Hew,    <edhew@xenitec.on.ca>    ....!uunet.ca!xenitec!eah
  XeniTec Consulting Services, Kitchener ON, Canada +1 519 570 9848
 [biz.sco.{opendesktop,general,announce} newsgroup/mlists godfather]


Date: Fri, 8 Jan 93 04:29 CST
From: bill@wlk.com (Bill Kennedy)
To: jstine@logiconultra.com
Subject: Re: In-coming mail to news question
Organization: W.L. Kennedy Jr. & Associates, Pipe Creek, TX

That's how I run a reflector mailing list and another one that I moderate.
If you have access to your mail alias file and are running some form of
sendmail then you just alias the addressee to pipe through a filter.  You
need some unique address, it won't be smart enough to distinguish between
something intended for a human and something else for news.


Here's how I do it:
/*
 *   fm_plus.c
 *
 *   This program accepts a message from stdin, piped
 *   from Elm or something similar and formats it in
 *   a fashion acceptable to usenet news.  It's a piped
 *   alias from sendmail to introduce mail to plus@wrangler
 *   into the plus.submit news group which is coordinated
 *   by bill@ssbn.
 */
#include <stdio.h>
#include <string.h>
#include <malloc.h>

char	*string, *field, *compare,
	FROM[512], RFROM[512], FROM1[512], SUBJ[512],
	ID[512], DATE[512], REPLY[512], ORG[512];

main(argc,argv)
int argc;
char *argv[];
{
	string=malloc(512);
	compare=malloc(512);

	while((gets(string)) != NULL){
		if (!strlen(string))
			break;
		strcpy(compare, string);
		/*
		 *   Grab and process the perinent header members
		 */
		field=strtok(compare," \0");
		if((strcmp(compare,"From"))==0){
			strcpy(FROM,string);
			continue;
			}
		if((strcmp(compare,"Message-ID:"))==0){
			strcpy(ID,string);
			continue;
			}
		if((strcmp(compare,"Message-Id:"))==0){
			strcpy(ID,string);
			ID[9] = 'D';
			continue;
			}
		if((strcmp(compare,"From:"))==0){
			strcpy(FROM1,string);
			continue;
			}
		if((strcmp(compare,"Subject:"))==0){
			strcpy(SUBJ,string);
			continue;
			}
		if((strcmp(compare,"Date:"))==0){
			strcpy(DATE,string);
			continue;
			}
		if((strcmp(compare,"Reply-To:"))==0){
			strcpy(REPLY,string);
			continue;
			}
		if((strcmp(compare,"Organization:"))==0){
			strcpy(ORG,string);
			continue;
			}
	}

	/*
	 *   Force the Path to point to dunsel!plus
	 *   This technique guarantees that when the
	 *   comp.sys.ncr news comes in, articles that
	 *   originated on the mailing list don't get
	 *   repeated to the mailing list.
	 */
	printf("Path: wlk.com!plus\n");

	/* build the Path line from the 1st From line */
	field=strtok(FROM,"!");
	field=strtok((char *)NULL," ");
	
	/* build the 2nd line, the From: line */
	if(strlen(FROM1))
		printf("%s\n",FROM1);
	else
		printf("From: %s\n", field);

	printf("Newsgroups: plus.submit\n");

	if(strlen(SUBJ))
		printf("%s\n",SUBJ);
	else
		printf("Subject: No Subject\n");
	if(strlen(ID))
		printf("%s\n",ID);

	if(strlen(REPLY))
		printf("%s\n",REPLY);
	printf("Distribution: plus\n");
	if (strlen(DATE))
		printf("%s\n",DATE);
	if(strlen(ORG))
		printf("%s\n",ORG);
	printf("\n");
	while((gets(string)) != NULL) {
		if ( '>' == *string ) *string = '}';
		printf("%s\n",string);
	}
}

And the corresponding mail alias entry:

plus:	"|/u/bill/news_filters/plus_submit | /bin/inews -h"

plus-admin:	"|/u/bill/news_filters/plus_admin | /bin/inews -h"

Note that these differ by the news group they handle.  Mail to plus
gets posted to plus.submit and mail to plus-admin (I use that to
remail administrative messages that are addressed to me) gets posted
to plus.admin.

There are other and certainly more elegant ways to do it but I have
been using this for a couple of years now.
-- 
Bill Kennedy            bill@WLK.COM  | Where there's a will there's a  
won't.
                                      | NAPA auto parts commercial.


Date: Mon, 11 Jan 93 12:28:47 PST
From: garym@flash.telesoft.com (Gary Morris @pulsar)
To: jstine@logiconultra.com
Subject: Re: In-coming mail to news question
Newsgroups: news.software.nn

Sure is.  You need the "newsgate" package which has software to handle
this.  I found a copy of ftp.uu.net.
--GaryM
-- 
Gary Morris                       Internet: garym@telesoft.com
Alsys Group, San Diego, CA        Phone:    +1 619-457-2700

Newsgroups: news.software.b,news.software.nn