🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
5 messages
5 total messages Started by Eduardo-Sorocaba Thu, 27 Mar 2008 23:50
INN - RPost - empty file
#78845
Author: Eduardo-Sorocaba
Date: Thu, 27 Mar 2008 23:50
81 lines
3457 bytes
Hi,

Trying to use rpost I´m getting this:

Using the command "/usr/bin/rpost post.server -b 
/var/spool/news/outgoing/post.server"

result: "Empty file, skipping"

Using the script below, the messages are sent but without body, just headers.

Any help, please?

Thanks

Eduardo.

script:
#!/usr/bin/perl

my $server  = "post.server";
my $tokens  = "/var/spool/news/outgoing/nic.near.net";
my $sm      = "/usr/lib/news/bin/sm";
my $rpost   = "/usr/bin/rpost";
my $errfile = "/var/log/news/suck.errlog";

open TOKENS, "$tokens" or die "Unable to open $tokens";
my @tokens = <TOKENS>;
close TOKENS;

foreach ( @tokens )
{
        my $tok = $_;

        open ARTICLE, "$sm $tok|" or die "Unable to retreive $tok";
        my @article = <ARTICLE>;
        close ARTICLE;

        my %art;
        foreach ( @article )
        {
                $art{'local'} = 1 if (( $_ =~ /^Path:/ ) and
                                      ( $art{'body'} == 0));
                $art{'body'}  = 1 if ( $_ eq "n" );

                if ( ($art{'body'} == 0 ))
                {
                        $art{'Newsgroups'} = $_ if ( $_ =~ /^Newsgroups:/);
                        $art{'From'} = $_ if ( $_ =~ /^From:/);
                        $art{'Subject'} = $_ if ( $_ =~ /^Subject:/);
                        $art{'Message-ID'} = $_ if ( $_ =~ /^Message-ID:/);
                        $art{'References'} = $_ if ( $_ =~ /^References:/);
                        $art{'CT'} = $_ if ( $_ =~ /^Content-Type:/);
                        $art{'References'} = $_ if ( $_ =~ /^References:/);
                        $art{'CTE'} = $_ if ( $_ =~ 
/^Content-Transfer-Encoding:/);
                }

                $art{'body_text'} .= $_ if ( $art{'body'} == 1 );
        }

        my $raw = $art{'From'} . $art{'Subject'} . $art{'Newsgroups'} .
	$art{'Message-ID'} . $art{'References'} . $art{'CT'} .
	$art{'CTE'} . "\n" . $art{'body_text'};

        if ( $art{'local'} == 1 )
        {
                my $rpost_cli = "$rpost $server -E $errfile -S $errfile";
                open RPOST, "|$rpost_cli" or die "Unable to post article 
$art{'Message-ID'}";
                print RPOST $raw;
                close RPOST;
        }
}

-- 
BRA-NET
bra.dnsalias.net
Sorocaba,SP - Brasil

Re: INN - RPost - empty file
#78846
Author: Aioe
Date: Fri, 28 Mar 2008 08:39
22 lines
1410 bytes
Eduardo-Sorocaba wrote:

> Hi,
> 
> Trying to use rpost I?m getting this:
> 
> Using the command "/usr/bin/rpost post.server -b
> /var/spool/news/outgoing/post.server"

which is the content of "/var/spool/news/outgoing/post.server"?

> Using the script below, the messages are sent but without body, just
> headers.
> 
> Any help, please?

there's a typeo...

>                 $art{'body'}  = 1 if ( $_ eq "n" );
should be
>                 $art{'body'}  = 1 if ( $_ eq "\n" );
Re: INN - RPost - empty file
#78854
Author: Aioe
Date: Fri, 28 Mar 2008 08:41
10 lines
1212 bytes
Aioe wrote:

> there's a typeo...
> 
>>                 $art{'body'}  = 1 if ( $_ eq "n" );
> should be
>>                 $art{'body'}  = 1 if ( $_ eq "\n" );

i've updated the source at http://ftp.aioe.org/Programs/News/Other/rpost.pl
you can simply download the correct version here
Re: INN - RPost - empty file
#78847
Author: Julien ÉLIE
Date: Fri, 28 Mar 2008 08:48
25 lines
1951 bytes
Hi Eduardo,

> Using the script below, the messages are sent but without body, just headers.
>
>                $art{'body'}  = 1 if ( $_ eq "n" );

Shouldn't it be "\n" or "\r\n"?
Otherwise, the body never begins!


>                $art{'body_text'} .= $_ if ( $art{'body'} == 1 );

It will then be appended there.



As for your rpost problem, I do not know what happens.  If it says that
the file is empty, then it might not look at the right file.

-- 
Julien ÉLIE

« -- Que lui est-il arrivé ? Un choc moral ?
  -- Oui, avec un menhir. » (Astérix)
Re: INN - RPost - empty file
#78848
Author: Eduardo-Sorocaba
Date: Fri, 28 Mar 2008 12:29
29 lines
1875 bytes
Aioe submitted this idea :
> Aioe wrote:

>> there's a typeo...
>> 
>>>                 $art{'body'}  = 1 if ( $_ eq "n" ); should be
>>>                 $art{'body'}  = 1 if ( $_ eq "\n" );

> i've updated the source at http://ftp.aioe.org/Programs/News/Other/rpost.pl
> you can simply download the correct version here

Thank you very much Aioe.
Working very well now!!!

I run a server as a hobby and want to make some integrations using INN and 
Hamster.
Your script will be very usefull.

[s]

Eduardo
Sorocaba - Brasil

-- 
BRA-NET
bra.dnsalias.net
Sorocaba,SP - Brasil

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