Thread View: news.software.nntp
7 messages
7 total messages
Started by Don Cox (253-7121)
Mon, 15 Apr 1991 23:36
sending a mail file to inews
Author: Don Cox (253-7121)
Date: Mon, 15 Apr 1991 23:36
Date: Mon, 15 Apr 1991 23:36
26 lines
1331 bytes
1331 bytes
Is it possible to send a mail file through inews and have it posted
to a newsgroup? The following is a mail message I received:
From root Mon Apr 15 16:35:12 1991
Date: Mon, 15 Apr 91 16:35:12 EDT
From: root (Super User)
To: dcox
Subject: meeting notice
Don,
[text deleted]
Suppose I wanted to post this message to kodak.junk. Can inews accept
an input that doesn't have Newsgroup in the header? Is there a way that
inews can get the Subject field and use that as the Subject for the
newsgroup?
Thanks much.
--
Don Cox
Phone (716) 253-7121 KMX (716) 253-7998
INTERNET dcox@ssd.kodak.com
Re: sending a mail file to inews
Author: Henry Spencer
Date: Tue, 16 Apr 1991 15:37
Date: Tue, 16 Apr 1991 15:37
12 lines
1158 bytes
1158 bytes
In article <1991Apr15.233624.11811@ssd.kodak.com> dcox@ssd.kodak.com (Don Cox (253-7121)) writes: >Is it possible to send a mail file through inews and have it posted >to a newsgroup? ... It's possible but not trivial. News needs more headers (e.g., Newsgroups) and is fussier about the format of headers (e.g., parenthesized comments are allowed in only one or two places). You can't just feed mail into inews and expect it to work reliably. -- And the bean-counter replied, | Henry Spencer @ U of Toronto Zoology "beans are more important". | henry@zoo.toronto.edu utzoo!henry
Re: sending a mail file to inews
Author: Juan Gabriel Ruiz Pinto
Date: Tue, 16 Apr 1991 22:51
Date: Tue, 16 Apr 1991 22:51
143 lines
4495 bytes
4495 bytes
dcox@ssd.kodak.com (Don Cox (253-7121)) writes:
>Is it possible to send a mail file through inews and have it posted
>to a newsgroup? The following is a mail message I received:
Is not easy as just send the mail to inews and post it, the
news articles need more headers, I use a perl script to change
listserv mail articles for a local group to a newsgroup, next
is the script, maybe it helps you. (if you have perl of course)
-----------------------------------------------------------------------
#! /usr/local/bin/perl -s
# Recibe articulos de BIT-CLUB via mail
$encontre = 0;
$lineas = -1;
while ( $linea = <> ) {
if ( $linea =~ /^From:/ ) {
chop($linea);
$linea_from = $linea unless $linea_from;
}
elsif ( $linea =~ /^Path:/ ) {
chop($linea);
$path = $linea unless $path;
@auxx = split(/ +/,$path);
$path = join(" ",@auxx[1..$#auxx]);
$path =~ y/A-Z/a-z/;
}
elsif ( $linea =~ /^Distribution:/ ) {
chop($linea);
$distribution = $linea unless $distribution;
}
elsif ( $linea =~ /^References:/ ) {
chop($linea);
$references = $linea unless $references;
}
elsif ( $linea =~ /^Subject:/ ) {
chop($linea);
$linea_subject = $linea unless $linea_subject;
@aux = split(/ +/, $linea_subject);
$subject = join(" ",@aux[0..$#aux]);
}
elsif ( $linea =~ /^Date:/ ) {
chop($linea);
$linea_date = $linea unless $linea_date;
}
elsif ( $linea =~ /^Organization:/ ) {
chop($linea);
$linea_organization = $linea unless $linea_organization;
@aux = split(/ +/, $linea_organization);
$organization = join(" ",@aux[0..$#aux]);
}
elsif ( $linea =~ /^Message-Id:/ ) {
chop($linea);
@aux = split(/ +/, $linea);
$messageid = join(" ",@aux[0..$#aux]) unless $messageid;
}
elsif ( $linea =~ /^Newsgroups: / ) {
chop($linea);
@aux = split(/ +/, $linea);
$newsgroups = join(" ",@aux[0..$#aux]) unless $newsgroups;
}
elsif ( $linea =~ /^\n/ ) {
$encontre = 1;
}
if ( $encontre ) {
$lineas++;
chop($linea);
$texto[$lineas] = $linea;
}
}
if ( $linea_from =~ />$/ ) {
@from = split (/</, $linea_from);
@aux = split(/ /, $from[0]);
$nombre = join(" ",@aux[1..$#aux]);
@aux = split(/>/, $from[1]);
$origen = $aux[0];
}
else {
@from = split (/ +/, $linea_from);
$nombre = "sin nombre";
$origen = $from[1];
}
if ( $origen =~ /%/ ) {
@aux = split(/@/, $origen);
@aux = split(/%/, $aux[0]);
$origen = join("@",@aux[0..$#aux]);
}
@aux = split(/@/, $origen);
$userid = $aux[0];
@aux = split(/\./, $aux[1]);
$nodo = $aux[0];
$nodo =~ y/A-Z/a-z/;
if ( !$path ) {
if ( $nodo !~ /^mtecv2/i ) {
$path = $nodo . "!" . $userid;
$path =~ y/A-Z/a-z/;
}
else {
$path = $userid;
$path =~ y/A-Z/a-z/;
}
}
@aux = split (/ +/, $linea_date);
$date = join(" ",@aux[2..$#aux]);
if ( !$subject ) {
$subject = "Subject: (sin titulo)";
}
if ( !$newsgroups ) {
$newsgroups = "Newsgroups: itesm.bit-club";
}
$origen =~ y/A-Z/a-z/;
print <<EOT;
Path: $path
From: $origen ($nombre)
$newsgroups
$subject
$messageid
Date: $date
Approved: news@mtecv2.mty.itesm.mx
EOT
if ( $organization ) {
print "$organization\n";
}
for ($i = 0; $i <= $#texto; $i++) {
print "$texto[$i]\n";
}
--
Juan Gabriel Ruiz Pinto Internet:
Ing. Sistemas Electronicos jgabriel@mtecv2.mty.itesm.mx
I.T.E.S.M. Campus Monterrey
Re: sending a mail file to inews
Author: Bruce D. Becker
Date: Fri, 19 Apr 1991 17:30
Date: Fri, 19 Apr 1991 17:30
25 lines
1690 bytes
1690 bytes
In article <1991Apr16.153753.2336@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: |In article <1991Apr15.233624.11811@ssd.kodak.com> dcox@ssd.kodak.com (Don Cox (253-7121)) writes: |>Is it possible to send a mail file through inews and have it posted |>to a newsgroup? ... | |It's possible but not trivial. News needs more headers (e.g., Newsgroups) |and is fussier about the format of headers (e.g., parenthesized comments |are allowed in only one or two places). You can't just feed mail into inews |and expect it to work reliably. I've been injecting a number of mail lists into news here for a while - I use a shell script that calls awk, which does the real work. This seems to be pretty reliable; the main problems are dup Message-ID's, or else the system running out of process slots... -- ,u, Bruce Becker Toronto, Ontario a /i/ Internet: bdb@becker.UUCP, bruce@gpu.utcs.toronto.edu `\o\-e UUCP: ...!utai!mnetor!becker!bdb _< /_ "Waking up is hard to do" - Neil Sedated
Re: sending a mail file to inews
Author: Henry Spencer
Date: Fri, 19 Apr 1991 22:39
Date: Fri, 19 Apr 1991 22:39
17 lines
1397 bytes
1397 bytes
In article <90894@becker.UUCP> bdb@becker.UUCP (Bruce D. Becker) writes: >|It's possible but not trivial. News needs more headers (e.g., Newsgroups) >|and is fussier about the format of headers... > > I've been injecting a number of mail lists > into news here for a while - I use a shell > script that calls awk, which does the real > work. A reasonable approach. Does your shell/awk combo deal with things like parenthesized comments where they aren't allowed in news? The real test of a gateway is how it copes with extreme cases, not whether it handles the typical ones easily. It's not as simple as it looks. -- And the bean-counter replied, | Henry Spencer @ U of Toronto Zoology "beans are more important". | henry@zoo.toronto.edu utzoo!henry
Re: sending a mail file to inews
Author: Bruce D. Becker
Date: Sun, 21 Apr 1991 23:09
Date: Sun, 21 Apr 1991 23:09
37 lines
2252 bytes
2252 bytes
In article <1991Apr19.223903.28698@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:
|In article <90894@becker.UUCP> bdb@becker.UUCP (Bruce D. Becker) writes:
|>|It's possible but not trivial. News needs more headers (e.g., Newsgroups)
|>|and is fussier about the format of headers...
|>
|> I've been injecting a number of mail lists
|> into news here for a while - I use a shell
|> script that calls awk, which does the real
|> work.
|
|A reasonable approach. Does your shell/awk combo deal with things like
|parenthesized comments where they aren't allowed in news? The real test
|of a gateway is how it copes with extreme cases, not whether it handles
|the typical ones easily. It's not as simple as it looks.
Well, I certainly have found that it isn't
as simple as it looks, you're right there.
The current version works because it's had
fixes applied until it does, not because I
RTFM. I've currently (until next week) got
B news installed - the case you mentioned
hasn't yet arisen so it isn't implemented.
B news seems to accept the "(" without any
complaints so it actually converts "From:"
lines to that style (perhaps incorrectly).
When I go to C news, I can see that it may
need to be fixed for that case, as well as
as yet undiscovered others. No doubt this
is a familiar-sounding circumstance 8^)...
Cheers,
--
,u, Bruce Becker Toronto, Ontario
a /i/ Internet: bdb@becker.UUCP, bruce@gpu.utcs.toronto.edu
`\o\-e UUCP: ...!utai!mnetor!becker!bdb
_< /_ "Waking up is hard to do" - Neil Sedated
Re: sending a mail file to inews
Author: Henry Spencer
Date: Mon, 22 Apr 1991 15:19
Date: Mon, 22 Apr 1991 15:19
13 lines
1179 bytes
1179 bytes
In article <91014@becker.UUCP> bdb@becker.UUCP (Bruce D. Becker) writes:
>|... Does your shell/awk combo deal with things like
>|parenthesized comments where they aren't allowed in news? ...
>
> B news seems to accept the "(" without any
> complaints so it actually converts "From:"
> lines to that style (perhaps incorrectly).
The From header is a specialized exception to the rule.
--
And the bean-counter replied, | Henry Spencer @ U of Toronto Zoology
"beans are more important". | henry@zoo.toronto.edu utzoo!henry
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