Article View: news.software.nntp
Article #38746Re: E-mail --> Newsgroup
From: dannyman
Date: Mon, 19 Jul 1999 00:00
Date: Mon, 19 Jul 1999 00:00
41 lines
1697 bytes
1697 bytes
Hi.
I'm new to innd myself, and got really pissed off the other day with this same
problem.
So ...
1-16:48 root@noneedto /usr/local/news/etc# cat /usr/local/news/bin/mail2news
#!/usr/bin/perl
$ENV{NNTPSERVER} = 'news.tellme.com';
my $ng = $ARGV[0];
die unless ( $ng );
open( OUT, "| /usr/local/news/bin/inews -h" ) or die "inews: $!";
print OUT "Newsgroups: $ng\n";
while( <STDIN> ) {
if( ! $headers_done ) {
s/^From:\s+(.*) <(.*)>/From: $2 ($1)/;
s/Message-Id/Message-ID/;
s/^From\s+(\S+)@(\S+).*/Path: $2!$1/ ||
s/^From\s+(\S+)[^@]*$/Path: $1\n/;
s/^Received:\s+(.*)/X-Original-Received: $1/;
if( /^$/ ) { $headers_done++; }
}
print OUT;
}
0-16:48 root@noneedto /usr/local/news/etc# grep jobs /etc/aliases
news-jobs: "| /usr/local/news/bin/mail2news tellme.jobs"
Some of that code I ripped out of another script, which claimed to be Perl3.
-danny
--
dannyman - http://www.dannyland.org/~dannyman/
Technical Details
Message-ID:
<7n0dmb$ena$1@eve.enteract.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-mailReferences:
<37908383.AE13C1A0@razorfish.com>Show Full Headers
Complete Article Headers
Message-ID: <7n0dmb$ena$1@eve.enteract.com>
Subject: Re: E-mail --> Newsgroup
Date: Mon, 19 Jul 1999 00:00:00 +0000
From: dannyman@dannyland.org
References: <37908383.AE13C1A0@razorfish.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
X-Deja-AN: 502916992
Organization: EnterAct L.L.C. Turbo-Elite News Server
User-Agent: tin/pre-1.4-980818 ("Laura") (UNIX) (FreeBSD/2.2.8-STABLE (i386))
Newsgroups: news.software.nntp