🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #8801

Re: mail to news gateway software

#8801
From: Bill Sherman
Date: Tue, 25 Jun 1996 00:00
136 lines
4993 bytes
Rich Z. Lenihan wrote:
> 
> I need to set up an intranet news server so that mail sent to a
> particular mailing list gets posted to a particular newsgroup. The news
> server will be strictly local -- no incoming or outgoing feeds. Any
> suggestions as to:
> 
> 1. What news software would be most appropriate for this (can be NT or
> UNIX)
> 2. What email-->news gateway software works with 1
> 
> would be appreciated. I've played with INN and newsgate but gave up trying
> to hack the newsgate piece of it.
> 
> -Rich
> 
> p.s. Oh yeah, the server needs to work with Netscape news clients (i.e.
> support for XOVER)

I'm working on a similar problem, except that we use an external newsfeed!  If
you have totally Netscape clients, would it be easier to let them use the Netscape
mailer than hacking thru NNTP?  I DID find a mail2news perl script that works with
INEWS (see below).  If this works, best of luck!  

I am still interested in something that will do a mail2news gateway with INND for 
intranet purposes (ie: local news groups)

***************************  SNIP ORIGINAL ARTICLE *****************************8
Path: tut.cis.ohio-state.edu!cs.utexas.edu!uunet!convex!convex.com!tchrist
From: tchrist@convex.com (Tom Christiansen)
Newsgroups: alt.sources
Subject: generic mail-to-news interface
Message-ID: <2100@convex.UUCP>
Date: 16 Oct 89 13:24:34 GMT
Sender: news@convex.UUCP
Reply-To: tchrist@convex.com (Tom Christiansen)
Organization: Convex Computer Corporation, Richardson, Tx.
Lines: 89
 
 
Here is a perl script that you can use to send mail messages
to newsgroups.  It expects to be passed the newsgroup as an
argument, or else included in the headers.  You may have to
alter the pathname for inews.
 
It doesn't really *require* perl version 3, although you'd
have to tweak STDIN to stdin and the
 
    print INEWS while <STDIN>;
to
    while (<stdin>) {
        print INEWS;
    }
 
As well as the one "warn" to "print stderr".
 
--tom
 
ps: kudos to Dave Cohrs <dave@cs.wisc.edu> for the original version
    of this script written in csh+grep+sed+ed.
 
=================  CUT HERE ===============================================
#!/usr/local/bin/perl
 
($program = $0) =~ s%.*/%%;
 
( $version  ) = $] =~ /(\d+\.\d+).*\nPatch level/;
die "$program: requires at least version 3 of perl\n"
        if $version < 3;
 
$inews = "/usr/spool/news/lib/inews";
$inews = "/usr/local/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"; }
 
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):/i;
   $saw_subject |= ( $+ eq 'Subject' );
   $saw_newsgroup |= ( $+ eq 'Newsgroups' );
}
 
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 "\n";
 
print INEWS while <STDIN>;   # gobble rest of message
 
close INEWS;
exit $?;
=================  END OF CUT HERE ========================================

-- 
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|   Bill Sherman    |    (803) 748-3256   |
| New Systems, Inc  |  bsherman@scana.com |
>-------------------^---------------------<
| at South Carolina Electric and Gas, Co. |
|              Columbia, SC               |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

Technical Details
Message-ID: <31D05D10.6A92@scana.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <richl.835720327@zip0.zipnet.net>

Show Full Headers
Complete Article Headers
Message-ID: <31D05D10.6A92@scana.com>
Subject: Re: mail to news gateway software
Date: Tue, 25 Jun 1996 00:00:00 +0000
From: Bill Sherman <bsherman@scana.com>
References: <richl.835720327@zip0.zipnet.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 162123727
Content-type: text/plain; charset=us-ascii
Organization: New Systems, Inc.
Mime-version: 1.0
Newsgroups: news.software.nntp
X-mailer: Mozilla 3.0b4 (Win95; I; 16bit)