Re: [Mailman-Users] Importing archived msgs into a Mailman list

2016-06-14 Thread Mark Sapiro
On 06/14/2016 10:51 AM, John Poltorak wrote:
> I think each msg starts with *Return-Path:*
> so I guess I need to insert an extra line at the start of each msg...
> 
> A simple sed script should suffice to convert each msg. Do I just need
> to insert '*From *'  as the first line of each msg?

Ideally, you insert

'From address date`

where address is the address without the <> from the Return-Path: and
date is the string produced by the 'date' command.

The attached addfrom script is what I use. It's overly complex for your
purpose and converts one message in one file in place. You could
probably adapt it to your purpose.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
#! /bin/bash
#
# Convert a single saved email with a Return-Path: as its first line
# to a mailbox by adding a From_
#
if [ ! -w "$1" ]; then
  echo usage: addfrom file
  exit
fi
d=`date`
f1=`mktemp`
f2=`mktemp`
head -1 "$1" > $f1
if grep -q -i -e "^From " $f1 ; then
  echo File already has From_ line
  rm $f1 $f2
  exit
fi
if ! grep -q -i -e "^return-path:" $f1 ; then
  echo "Return-Path: " > $f1
fi
sed -e "s/^.*.*/  $d/" <$f1 >$f2
# strip any trailing s
sed -e 's/\r$//' < "$1" >> $f2
# make sure we have a trailing empty line
echo >$f1
cat $f2 $f1 $f1 > "$1"
rm $f1 $f2

--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Re: [Mailman-Users] Importing archived msgs into a Mailman list

2016-06-14 Thread John Poltorak
I think each msg starts with *Return-Path:*
so I guess I need to insert an extra line at the start of each msg...

A simple sed script should suffice to convert each msg. Do I just need to
insert '*From *'  as the first line of each msg?

On Tue, Jun 14, 2016 at 5:06 PM, Mark Sapiro  wrote:

> On 06/14/2016 12:36 AM, John Poltorak wrote:
> > I have managed to obtain all the msgs as individual files. I'm not  sure
> > of the mbox format, but hopefully I can create it... Isn't it just a
> > concatenation of all the individual files as a single file? There's
> > probably more to it, but hopefully it is doable without too much
> difficulty.
>
>
> A .mbox is not quite the concatenation of the individual messages. I
> have attached an excerpt of a .mbox file with two messages. The key is
> that the first line of each message is a 'From_' separator that looks like
>
> 'From email@address date'
>
> It begins literally with 'From ' and no other lines in the mbox begin
> with these 5 characters - this is why you sometimes see lines in the
> body of an email that begin 'From ' escaped by inserting '>' as in
> '>From '. For the purposes of bin/arch, the actual contents after the
> leading 'From ' are not important, but in general, there should be an
> email address representing the envelope sender of the message and a date
> in the format of the example. See, e.g.,
> .
>
> --
> Mark Sapiro The highway is for gamblers,
> San Francisco Bay Area, Californiabetter use your sense - B. Dylan
>
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Importing archived msgs into a Mailman list

2016-06-14 Thread Mark Sapiro
On 06/14/2016 12:36 AM, John Poltorak wrote:
> I have managed to obtain all the msgs as individual files. I'm not  sure
> of the mbox format, but hopefully I can create it... Isn't it just a
> concatenation of all the individual files as a single file? There's
> probably more to it, but hopefully it is doable without too much difficulty.


A .mbox is not quite the concatenation of the individual messages. I
have attached an excerpt of a .mbox file with two messages. The key is
that the first line of each message is a 'From_' separator that looks like

'From email@address date'

It begins literally with 'From ' and no other lines in the mbox begin
with these 5 characters - this is why you sometimes see lines in the
body of an email that begin 'From ' escaped by inserting '>' as in
'>From '. For the purposes of bin/arch, the actual contents after the
leading 'From ' are not important, but in general, there should be an
email address representing the envelope sender of the message and a date
in the format of the example. See, e.g.,
.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
From m...@msapiro.net  Wed Jun 19 14:35:45 2013
Return-Path: 
X-Original-To: li...@msapiro.net
Delivered-To: li...@msapiro.net
Received: by msapiro.net (Postfix, from userid 1000)
 id 918F54C0E07; Wed, 19 Jun 2013 14:35:45 -0700 (PDT)
Date: Wed, 19 Jun 2013 14:35:45 -0700
From: Mark Sapiro 
To: li...@msapiro.net
Message-ID: <20130619213545.ga3...@msapiro.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
Subject: [List1] Test 3
X-BeenThere: li...@msapiro.net
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 19 Jun 2013 21:35:45 -

Wow

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

From m...@msapiro.net  Wed Jun 19 14:36:25 2013
Return-Path: 
X-Original-To: li...@msapiro.net
Delivered-To: li...@msapiro.net
Received: by msapiro.net (Postfix, from userid 1000)
 id D095C4C0E07; Wed, 19 Jun 2013 14:36:25 -0700 (PDT)
Date: Wed, 19 Jun 2013 14:36:25 -0700
From: Mark Sapiro 
To: li...@msapiro.net
Message-ID: <20130619213625.gb3...@msapiro.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
Subject: [List1] Test4
X-BeenThere: li...@msapiro.net
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 19 Jun 2013 21:36:25 -

abcdef

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Re: [Mailman-Users] Importing archived msgs into a Mailman list

2016-06-14 Thread John Poltorak
I have managed to obtain all the msgs as individual files. I'm not  sure of
the mbox format, but hopefully I can create it... Isn't it just a
concatenation of all the individual files as a single file? There's
probably more to it, but hopefully it is doable without too much difficulty.

On Wed, Jun 8, 2016 at 3:22 PM, Mark Sapiro  wrote:

> On 06/08/2016 01:01 AM, John Poltorak wrote:
> > Is it possible to import archived msgs which are in a digest form,
> > originally from a Mailman mailing list, into a new mailing list?
>
>
> Maybe, but that's not the best way. The tool is Mailman's bin/arch. Run
> it with --help to see it's doc.
>
> The input must be in *nix mbox format. You can convert a digest, but the
> best way is if you still have access to the old list, the
> archives/private/LIST.mbox/LIST.mbox file already has the messages with
> all headers which a digest doesn't have.
>
> --
> Mark Sapiro The highway is for gamblers,
> San Francisco Bay Area, Californiabetter use your sense - B. Dylan
> --
> Mailman-Users mailing list Mailman-Users@python.org
> https://mail.python.org/mailman/listinfo/mailman-users
> Mailman FAQ: http://wiki.list.org/x/AgA3
> Security Policy: http://wiki.list.org/x/QIA9
> Searchable Archives:
> http://www.mail-archive.com/mailman-users%40python.org/
> Unsubscribe:
> https://mail.python.org/mailman/options/mailman-users/karotlopj%40gmail.com
>
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Importing archived msgs into a Mailman list

2016-06-08 Thread Mark Sapiro
On 06/08/2016 01:01 AM, John Poltorak wrote:
> Is it possible to import archived msgs which are in a digest form,
> originally from a Mailman mailing list, into a new mailing list?


Maybe, but that's not the best way. The tool is Mailman's bin/arch. Run
it with --help to see it's doc.

The input must be in *nix mbox format. You can convert a digest, but the
best way is if you still have access to the old list, the
archives/private/LIST.mbox/LIST.mbox file already has the messages with
all headers which a digest doesn't have.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org