Xref: utzoo news.software.nntp:1268 news.software.b:7487 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!mtecv2!jgabriel From: jgabriel@mtecv2.mty.itesm.mx (Juan Gabriel Ruiz Pinto) Newsgroups: news.software.nntp,news.software.b Subject: Re: sending a mail file to inews Message-ID: <3180@mtecv2.mty.itesm.mx> Date: 16 Apr 91 22:51:12 GMT References: <1991Apr15.233624.11811@ssd.kodak.com> Followup-To: news.software.nntp Distribution: na Organization: ITESM. Campus Monterrey Lines: 142 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 (//, $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 <