🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #27898

Re: changing trn news headers to mail headers

#27898
From: Denis McKeon
Date: Sun, 24 Nov 1996 00:00
99 lines
4521 bytes
[followup both posted and mailed to poster,]
[and cross-posted to news.software.readers]

In <574ei5$nmn@lynx.dac.neu.edu> zbrown@lynx.dac.neu.edu wrote:
>I've been archiving usenet threads I participate in, for a few years now. 
>I use trn, and when it starts an archive, it always asks me if I want to 
>use mailbox format. For years I said no. Now I not only want to say yes, 
>but I want to have said yes from the beginning. How can I translate those 
>news archives so that formail can process them?

Can't you just send the archive file through formail?:

   formail < archive > mbox

It works for me if we're talking about a file like this:

    Article: 2514 of comp.mail.headers
    Path: sloth.swcp.com!tesuque.cs.sandia.gov!lynx.unm.edu!chaos.aoc.nrao.edu!newshost.nmt.edu!rutgers!goliath.montclair.edu!newsserver.jvnc.net!news.edu.tw!news-peer.gsl.net!news.gsl.net!news.mathworks.com!uunet!in2.uu.net!gail.ripco.com!nntp.neu.edu!not-for-mail
    From: zbrown@lynx.dac.neu.edu (zachary brown)
    Newsgroups: comp.mail.headers
    Subject: changing trn news headers to mail headers
    Date: 22 Nov 1996 09:49:41 -0500
    Organization: Northeastern University, Boston, MA, USA
    Lines: 10
    Message-ID: <574ei5$nmn@lynx.dac.neu.edu>
    NNTP-Posting-Host: lynx.dac.neu.edu

    I've been archiving usenet threads I participate in, for a few years now. 
    ...

Although I would probably do it as:

formail -czYbq -I Path -I Article -I Lines < archive > mbox

producing:

    From zbrown@lynx.dac.neu.edu  Sun Nov 24 09:22:48 1996
    From: zbrown@lynx.dac.neu.edu (zachary brown)
    Newsgroups: comp.mail.headers
    Subject: changing trn news headers to mail headers
    Date: 22 Nov 1996 09:49:41 -0500
    Organization: Northeastern University, Boston, MA, USA
    Message-ID: <574ei5$nmn@lynx.dac.neu.edu>
    NNTP-Posting-Host: lynx.dac.neu.edu

    I've been archiving usenet threads I participate in, for a few years now. 
    ...

On a related topic, here's a way to get trn to create archives in
BSD/mbox format to - basically, have trn flog up a 'From ' line, and
have the saver script echo it:

In the initialization file, or in your environment:

-EMBOXSAVER='%X/my-mbox.saver %A %P %c %a %B %C "%b" "From %t %[Date]"' 

in the mbox.saver file:

#!/bin/sh
# $Id: mbox.saver.SH,v 3.0 1991/09/09 20:23:31 davison Trn $
# 
# This software is Copyright 1991 by Stan Barber. 
#
# modified by Denis McKeon Dec 1994
# Permission is hereby granted to copy, reproduce, redistribute or otherwise
# use this software as long as: there is no monetary profit gained
# specifically from the use or reproduction of this software, it is not
# sold, rented, traded or otherwise marketed, and this copyright notice is
# included prominently in any copy made. 
#
# The author make no claims as to the fitness or correctness of this software
# for any use whatsoever, and it is provided as is. Any use of this software
# is at the user's own risk. 
# 
#       Arguments:
#       1 Full name of article (%A)
#       2 Public news spool directory (%P)
#       3 Directory of current newsgroup (%c)
#       4 Article number (%a)
#       5 Where in article to start (%B)
#       6 Newsgroup name (%C)
#       7 Save destination (%b)
#       8 First line of message, normally From...
#
export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)

 ( /bin/echo "$8"
  /usr/ucb/tail +$5c $1 | /bin/sed "s/^From />From /"
  /bin/echo ""
  /bin/echo "" ) >> $7

If there's an easier way to do that, I'd be happy to hear about it.

-- 
Denis McKeon 
dmckeon@swcp.com

Technical Details
Message-ID: <579t0s$a31@sloth.swcp.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.mail.headers.mbox.zip!not-for-mail
References: <574ei5$nmn@lynx.dac.neu.edu>

Show Full Headers
Complete Article Headers
Message-ID: <579t0s$a31@sloth.swcp.com>
Subject: Re: changing trn news headers to mail headers
Date: Sun, 24 Nov 1996 00:00:00 +0000
From: dmckeon@swcp.com (Denis McKeon)
References: <574ei5$nmn@lynx.dac.neu.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.mail.headers.mbox.zip!not-for-mail
X-Deja-AN: 198433042
Sender: dmckeon@swcp.com (Denis McKeon)
Organization: Connemara - Computing for People - ABQ/NM/USA
Reply-to: dmckeon@swcp.com
Newsgroups: comp.mail.headers,news.software.readers
X-copyright: Copyright 1996 by Denis McKeon
Originator: dmckeon@slug.swcp.com
X-mailer: Mail User's Shell (7.2.5 10/14/92)