🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #59133

RE: Xnews importing Agent's files?

#59133
From: H. Merijn Brand
Date: Fri, 10 Mar 2000 00:00
125 lines
4244 bytes
arkmucha@priv2.onet.pl (Arkadiusz Mucha) wrote in 
<8a8r1d.3vvk945.0@burczy.mucha.pl>:

>On Tue, 07 Mar 2000 23:41:37 +0100, EagleStorm
><from.email@address.invalid> wrote:
>
>>� Ross Presser � <8EF0737C5pt101594@207.211.168.90> wrote:
>>
>>>2) IIRC, you can export a folder or group in Agent into a "Unix Message 
>>>File".  This is, I believe, exactly the same format as Xnews' folder 
>>>files.
>>IMHO, this is a questionable assertion.
>
>Yes, it is indeed questionable.  I noticed that each message in my
>XNews archive folder is preceded by a line similar to this :
>From ???@0x000007DA Pn lut 07 12:24:11 2000

Which might lead to messages in the thread having '0' lines :-(

>(The date is in Polish so it should be different on your systems)
>I exported Agent messages by appending them to the archive.mbx file,
>using the line quoted above as the delimiter, and it worked. Even the
>dates were correct. 
>
>Arkadiusz Mucha

Same for Pegasus. Solution (See # <<<<<<<<<) for converting Pegasus
mail files to Becky!.

--------------------------8<---------------------------------------
#!/usr/bin/perl

use strict;

# Change this to your needs
chdir "E:/Work/Mail" or die "Cannot chdir to PMail dir: $!";

my %hier = ();
open HIERARCH, "HIERARCH.PM";
while (<HIERARCH>) {
    my @h = split m/"*,"*/, $_, 5;
    $h[0] == 0 or next;

    chomp $h[4];
    $h[4] =~ s/"$//;

    my @f = split m/:/ => $h[2];
    my @n = split m/:/ => $h[3];

    my $pmm = $f[2];
    if ($pmm =~ m/^UNX/) {
	$pmm .= ".MBX";
	}
    else {
	$pmm .= ".PMM";
	}
    my $bnm = "$n[1] - $h[4].mbx";

# Change this to your needs
    chdir "E:/Work/Mail" or die "Cannot chdir to PMail dir: $!";
    -e $pmm or next;
    unless (open PMM, "<$pmm") {
	warn "$pmm: $!";
	next;
	}

# Change this to your needs
    chdir "E:/Work/Becky/wardan/Conv" or die "Cannot chdir to Conv dir: 
$!";
    open BECK, ">>$bnm" or die "$bnm: $!";

    if ($pmm =~ m/^UNX/) {
	local $/ = "From ???\@??? ";    	# <<<<<<<<<<<<<<<<<<
	while (<PMM>) {
	    chomp;

	    s/^\w\w\w \w\w\w \d\d \d\d:\d\d:\d\d [ \d]?\d\d\d\n//;
	    s/[\s\n]+$//;

	    m/^\S/ or next;

	    s/^(From:\s+-\s+.*\n)+//;

	    my $dte = (m/^(Date:\s+.+)$/im)[0];
	    my $frm = (m/^(From:\s.+)$/im)[0];
	    my $sbj = (m/^(Subject:\s.+)$/im)[0];

	    defined $frm and print BC $frm, "\n";
	    defined $sbj and print BC $sbj, "\n";
	    defined $dte and print BC $dte, "\n";
# Change "\n.\n" to "\n\n" for X-News
	    print BECK $_, "\n.\n";
	    }
	}
    else {
	binmode PMM;
	my $posts;
	sysread PMM, $_, 84 + 42;
	{ local $/ = undef;
	  $posts = <PMM>
	  }
	close PMM;

	foreach my $post (split m/\cZ/ => $posts) {
	    $post =~ s/^\0+//;
	    $post =~ s/\r+//g;
	    $post =~ s/[\r\n\0]+$//;
# Change "\n.\n" to "\n\n" for X-News
	    print BECK $post, "\n.\n";
	    }
	}
    close PMM;
    close BECK;
    }
close HIERARCH;
-------------------------->8---------------------------------------

-- 
H.Merijn Brand
using perl5.005.03 on HP-UX 10.20, HP-UX 11.00, AIX 4.2.1, AIX 4.3.0, DEC
     OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.018 and/or DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Member of Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)

Technical Details
Message-ID: <8EF3633B1Merijn@192.0.1.90>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <iw=FOMc4mw=kdUDXKRu35e9QLqL=@4ax.com> <8EF0737C5pt101594@207.211.168.90> <d61bcs4275joi452mj6hmj9l2th3s2u88i@4ax.com> <8a8r1d.3vvk945.0@burczy.mucha.pl>

Show Full Headers
Complete Article Headers
Message-ID: <8EF3633B1Merijn@192.0.1.90>
Subject: RE: Xnews importing Agent's files?
Date: Fri, 10 Mar 2000 00:00:00 +0000
From: h.m.brand@hccnet.nl (H. Merijn Brand)
References: <iw=FOMc4mw=kdUDXKRu35e9QLqL=@4ax.com> <8EF0737C5pt101594@207.211.168.90> <d61bcs4275joi452mj6hmj9l2th3s2u88i@4ax.com> <8a8r1d.3vvk945.0@burczy.mucha.pl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 595607202
X-Posting-IP-Address: 192.0.1.19
X-Complaints-To: abuse@hccnet.nl
X-Trace: news.hccnet.nl 952680850 6339 193.173.120.131 (10 Mar 2000 09:34:10 GMT)
Organization: PROCURA B.V.
User-Agent: Xnews/03.02.04
NNTP-Posting-Date: 10 Mar 2000 09:34:10 GMT
Newsgroups: news.software.readers