🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
19 messages
19 total messages Started by Charles Lasitter Sun, 05 Aug 2007 19:45
[Dialog] .DAT to .mbox conversion?
#203222
Author: Charles Lasitter
Date: Sun, 05 Aug 2007 19:45
13 lines
1500 bytes
Is there any utility that can convert Dialog's .DAT format to standard
mbox format?

-- 

CL -> http://tinyurl.com/2zqgly
For email correspondence.

+----------------------------------------------+
| Charles Lasitter   | Address, Mail / Ship:   |
| 401/728-1987       | 14 Cooke St             |
| see^tinyurl>4email | Pawtucket RI 02860-6114 |
+----------------------------------------------+
Re: [Dialog] .DAT to .mbox conversion?
#203257
Author: Steve Wertz
Date: Mon, 06 Aug 2007 02:31
13 lines
1773 bytes
On Sun, 5 Aug 2007 15:45:10 -0400, Charles Lasitter wrote:

> Is there any utility that can convert Dialog's .DAT format to standard
> mbox format?

Along those same lines, I've wanted to write an external
folder/group search function.

Is there a list of file formats and a description of what each
file is?  Are *all* the actual bodies and headers really stored
in just the single file msg.dat?

-sw
Re: [Dialog] .DAT to .mbox conversion?
#203289
Author: Oliver Cromm
Date: Mon, 06 Aug 2007 16:13
33 lines
2854 bytes
* Steve Wertz wrote:

> On Sun, 5 Aug 2007 15:45:10 -0400, Charles Lasitter wrote:
> 
>> Is there any utility that can convert Dialog's .DAT format to standard
>> mbox format?
> 
> Along those same lines, I've wanted to write an external
> folder/group search function.
> 
> Is there a list of file formats and a description of what each
> file is?  Are *all* the actual bodies and headers really stored
> in just the single file msg.dat?

The data you are asking about are in the files msg.dat, msg1.dat,
msg2.dat etc., depending on how big your database is - each of them
maxes out at roughly 10 MB, I have currently msg13.dat as the highest. 

There is no official description, but the format of the .dat files is
not that difficult. An analysis and a way to export data (one file per
message) was posted in the thread starting at
<news:x4b3t9jctoc8$.1g4quxwvnmwf1.dlg@40tude.net>. That's in the German
Dialog group, but that very thread was initiated in English and most of
the answers are in English, too.

The Ruby script I gave in that thread could be easily changed to create
one mbox file per dat-file instead of single messages.

-- 
Java is the SUV of programming tools.
A project done in Java will cost 5 times as much, take twice as long,
and be harder to maintain than a project done in a scripting language
such as PHP or Perl. - Philip Greenspun
Re: [Dialog] .DAT to .mbox conversion?
#203304
Author: Charles Lasitter
Date: Mon, 06 Aug 2007 21:02
35 lines
2622 bytes
On Mon, 6 Aug 2007 12:13:43 -0400, Oliver Cromm wrote:

> The data you are asking about are in the files msg.dat, msg1.dat,
> msg2.dat etc., depending on how big your database is - each of them
> maxes out at roughly 10 MB, I have currently msg13.dat as the
> highest. 

I got up to msg19 and it barfed on a file that hit 13 megs.

> There is no official description, but the format of the .dat files
> is not that difficult. An analysis and a way to export data (one
> file per message) was posted in the thread starting at
> <news:x4b3t9jctoc8$.1g4quxwvnmwf1.dlg@40tude.net>. 

A most imformative thread ...

> The Ruby script I gave in that thread could be easily changed to create
> one mbox file per dat-file instead of single messages.

So I found out where I'd download the cygwin part, but I don't know
how you run (compile?) a ruby script within the linux api emulation
layer?  Another something to download and install?

Thanks for your post.  Very enlightening.

-- 

CL -> http://tinyurl.com/2zqgly
For email correspondence.

+----------------------------------------------+
| Charles Lasitter   | Address, Mail / Ship:   |
| 401/728-1987       | 14 Cooke St             |
| see^tinyurl>4email | Pawtucket RI 02860-6114 |
+----------------------------------------------+
Re: [Dialog] .DAT to .mbox conversion?
#203313
Author: Oliver Cromm
Date: Mon, 06 Aug 2007 22:11
65 lines
3708 bytes
* Charles Lasitter wrote:

> On Mon, 6 Aug 2007 12:13:43 -0400, Oliver Cromm wrote:
> 
>> The data you are asking about are in the files msg.dat, msg1.dat,
>> msg2.dat etc., depending on how big your database is - each of them
>> maxes out at roughly 10 MB, I have currently msg13.dat as the
>> highest. 
> 
> I got up to msg19 and it barfed on a file that hit 13 megs.
> 
>> There is no official description, but the format of the .dat files
>> is not that difficult. An analysis and a way to export data (one
>> file per message) was posted in the thread starting at
>> <news:x4b3t9jctoc8$.1g4quxwvnmwf1.dlg@40tude.net>. 
> 
> A most imformative thread ...
> 
>> The Ruby script I gave in that thread could be easily changed to create
>> one mbox file per dat-file instead of single messages.
> 
> So I found out where I'd download the cygwin part, but I don't know
> how you run (compile?) a ruby script within the linux api emulation
> layer?  Another something to download and install?
> 
> Thanks for your post.  Very enlightening.

I find ruby (and other things) to work more natural in Cygwin, but it is
not necessary just to run my script; you could use native Windows Ruby
as well. <http://www.ruby-lang.org/en/downloads/>. Install, then
double-click any .rb-file.

If you have, however, already installed Cygwin, and want to run it
there, 

1. Make sure you have ruby:

Type

  which ruby
  
It should answer:

  /usr/local/bin/ruby

If there's no answer, you should run Cygwin's setup.exe, then, after
many clicks, when you come to package selection, manually select ruby
for installation (you find it in both the Devel and the Interpreters
section).

2. Just type the file name you copied my script under, e.g.:

  dialog_data/msg_split.rb

Or, if it's in the current directory:

  ./msg_split.rb

My script has to be in the same directory as the msg*.dat files. Run it
on a copy of your msg.dat files, just for added security. If you extract
all your 19 files, it will create a *lot* of result files, so many it's
tough for Windows to handle.

-- 
Pentiums melt in your PC, not in your hand.
Re: [Dialog] .DAT to .mbox conversion?
#203318
Author: Charles Lasitter
Date: Mon, 06 Aug 2007 22:48
23 lines
2139 bytes
On Mon, 6 Aug 2007 18:11:07 -0400, Oliver Cromm wrote:

> My script has to be in the same directory as the msg*.dat files. Run
> it on a copy of your msg.dat files, just for added security. If you
> extract all your 19 files, it will create a *lot* of result files,
> so many it's tough for Windows to handle.

Again, thanks.  You said that modifying the ruby script to produce a
single output mbox file would not be so difficult (for you, but near
impossible for me).

So, could I bribe you to mod the script for me?

-- 

CL -> http://tinyurl.com/2zqgly
For email correspondence.

+----------------------------------------------+
| Charles Lasitter   | Address, Mail / Ship:   |
| 401/728-1987       | 14 Cooke St             |
| see^tinyurl>4email | Pawtucket RI 02860-6114 |
+----------------------------------------------+
Re: [Dialog] .DAT to .mbox conversion?
#203333
Author: Oliver Cromm
Date: Tue, 07 Aug 2007 02:02
19 lines
2199 bytes
On Mon, 6 Aug 2007 18:48:26 -0400, Charles Lasitter wrote:

> On Mon, 6 Aug 2007 18:11:07 -0400, Oliver Cromm wrote:
> 
>> My script has to be in the same directory as the msg*.dat files. Run
>> it on a copy of your msg.dat files, just for added security. If you
>> extract all your 19 files, it will create a *lot* of result files,
>> so many it's tough for Windows to handle.
> 
> Again, thanks.  You said that modifying the ruby script to produce a
> single output mbox file would not be so difficult (for you, but near
> impossible for me).
> 
> So, could I bribe you to mod the script for me?

I take a note, but I won't promise anything.

-- 
Oliver C.
Re: [Dialog] .DAT to .mbox conversion?
#203419
Author: Oliver Cromm
Date: Wed, 08 Aug 2007 17:59
25 lines
2564 bytes
* Oliver Cromm wrote:

> On Mon, 6 Aug 2007 18:48:26 -0400, Charles Lasitter wrote:
> 
>> On Mon, 6 Aug 2007 18:11:07 -0400, Oliver Cromm wrote:
>> 
>>> My script has to be in the same directory as the msg*.dat files. Run
>>> it on a copy of your msg.dat files, just for added security. If you
>>> extract all your 19 files, it will create a *lot* of result files,
>>> so many it's tough for Windows to handle.
>> 
>> Again, thanks.  You said that modifying the ruby script to produce a
>> single output mbox file would not be so difficult (for you, but near
>> impossible for me).
>> 
>> So, could I bribe you to mod the script for me?
> 
> I take a note, but I won't promise anything.

I didn't express myself clearly? I don't see the bribe going up.

-- 
Microsoft designed a user-friendly car:
instead of the oil, alternator, gas and engine
warning lights it has just one: "General Car Fault"
Re: [Dialog] .DAT to .mbox conversion?
#203428
Author: Charles Lasitter
Date: Wed, 08 Aug 2007 21:01
32 lines
2460 bytes
On Wed, 8 Aug 2007 13:59:40 -0400, Oliver Cromm wrote:

> I didn't express myself clearly? I don't see the bribe going up.

Ah, I misunderstood.  OK.

Your choice, $35 to you directly or as a contribution to 
Doctors Without Borders/Médecins Sans Frontières(MSF)
in your honor.  

I do the latter for people too altruistic to accept money for their
freeware efforts.  (They DO exist ...) Looks like I could even use my
"ClickAndBuy" account to make that payment in Euros to you or 

(MSF/ÄRZTE OHNE GRENZEN e.V. 
Am Köllnischen Park 1 
10179 Berlin 
+49 30 22 33 77 00)

If you have other ideas please feel free to toss them out here or in
email (follow link below).

-- 

CL -> http://tinyurl.com/2zqgly
For email correspondence.

+----------------------------------------------+
| Charles Lasitter   | Address, Mail / Ship:   |
| 401/728-1987       | 14 Cooke St             |
| see^tinyurl>4email | Pawtucket RI 02860-6114 |
+----------------------------------------------+
Re: [Dialog] .DAT to .mbox conversion?
#203440
Author: Oliver Cromm
Date: Thu, 09 Aug 2007 05:42
70 lines
3748 bytes
On Wed, 8 Aug 2007 17:01:32 -0400, Charles Lasitter wrote:

> On Wed, 8 Aug 2007 13:59:40 -0400, Oliver Cromm wrote:
> 
>> I didn't express myself clearly? I don't see the bribe going up.
> 
> Ah, I misunderstood.  OK.
> 
> Your choice, $35 to you directly or as a contribution to 
> Doctors Without Borders/Médecins Sans Frontières(MSF)
> in your honor.  

It was basically a joke ... I felt no closure because in my first answer
I didn't do anything about the word "bribe". But if you are willing ...
I wouldn't take any money for a quick hack as the one I published in the
German group before, but it may be an incentive to do it the right way,
within my emerging framework of Ruby mail/news processing:

class Dialog_dat
  [...]
  def to_mbox(FLAGS)
    mbout = Mbox.new(self.name, FLAGS)
      self.each do |msg|
        mbout.add (msg)
      end
    end
  end
end


Well, here's a quick hack that worked for my SeaMonkey AFAICS in a few
tests. Tell me if it does the job for you. There are differences between
what various applications expect and accept as "mbox".


-------------- schnipp ---------------
#!/usr/bin/env ruby
# dattombx.rb
# Author: Oliver Cromm, 2007
# creates a mbx file from each msg*.dat in Dialog's data direectory
# Usage: place into data dir and run - that's it!
# Backup your files first, no guarantees.

FROMLINE = "From abc@xyz.invalid Mon Jan 01 00:00:00 1970\r\n"
EMPTYLINE = "\r\n"

Dir['msg*.dat'].each do |inp|
  fname = File.basename(inp)+".mbx"
  out = File.open(fname, "wb")
  firstline = true
  out.print FROMLINE
  File.open(inp).each do |line|
    line.chomp!
    line.gsub!(/^..../,'') if firstline
    firstline = false
    if line.sub!(/^\x7f/,'')
      out.print EMPTYLINE
      out.print FROMLINE
    end
    line.sub!(/^From /, ">From ")
    out.print line, "\r\n"
  end
  out.print EMPTYLINE
  out.close
end 
-------------- schnapp ---------------


-- 
Oliver C.
Re: [Dialog] .DAT to .mbox conversion?
#203446
Author: Charles Lasitter
Date: Thu, 09 Aug 2007 08:03
29 lines
2668 bytes
On Thu, 9 Aug 2007 01:42:39 -0400, Oliver Cromm wrote:

> It was basically a joke ... I felt no closure because in my first answer
> I didn't do anything about the word "bribe". But if you are willing ...
> I wouldn't take any money for a quick hack as the one I published in the
> German group before, but it may be an incentive to do it the right way,

Worked brilliantly.  Only problem with it is that the MSG*.DAT files
contain all newsgroups as well as emails, and everything gets dumped
into my inbox (or whatever folder I say).

A bit tedious to do the deleting, but those are the breaks.

And, as I promised:
http://www.ncdm.com/misc/msf_oc.jpg

They MSF didn't give me a way to acknowledge your good works on this
form, but I'll work on that later.

-- 

CL -> http://tinyurl.com/2zqgly
For email correspondence.

+----------------------------------------------+
| Charles Lasitter   | Address, Mail / Ship:   |
| 401/728-1987       | 14 Cooke St             |
| see^tinyurl>4email | Pawtucket RI 02860-6114 |
+----------------------------------------------+
Re: [Dialog] .DAT to .mbox conversion?
#203450
Author: Charles Lasitter
Date: Thu, 09 Aug 2007 13:06
135 lines
5760 bytes
On Thu, 9 Aug 2007 01:42:39 -0400, Oliver Cromm wrote:

> Well, here's a quick hack that worked for my SeaMonkey AFAICS in a
> few tests. Tell me if it does the job for you. There are
> differences between what various applications expect and accept as
> "mbox".

More feedback, mostly still good:

By applying a score to newsgroup articles, I could sort them and
delete them easily.  The message data was present in the body, but 

Something went a bit wrong with either converting or Dialog's
interpreting of messages I had originated, since message fields were
not properly identified.  Here's how one looked after conversion but
before import:

***** Begin *****
postedheaderCT="From: Charles Lasitter
<check.sig4@ddress.com>","Subject: Re: Reformat quoted
lines","Newsgroups:
alt.usenet.offline-reader.forte-agent","User-Agent:
40tude_Dialog/2.0.15.1 (6ba32acf.285.130)","MIME-Version:
1.0","Content-Type: text/plain;
charset=""us-ascii""","Content-Transfer-Encoding: 7bit","References:
<7o4r52l1iu1qcbr4p745ti03rn56ofun5b@4ax.com>
<t_v7g.383943$hn5.158825@fe04.news.easynews.com>","Date: Mon, 8 May
2006 14:03:19 -0400","Message-ID:
<1mheaim2i3pyi$.1ahezg9tsfgcn.dlg@40tude.net>"
msgid=<1mheaim2i3pyi$.1ahezg9tsfgcn.dlg@40tude.net>
subject=Re: Reformat quoted lines
newsgroups=alt.usenet.offline-reader.forte-agent
email=
identity=NCDM
signature=Cooke Street
server=Cox
spelloption=1|
rect=1,1,630,545
wrapat=65
dowrap=1
replyto=
yourname=Charles Lasitter
ownemailposting=check.sig4@ddress.com
ownemailemail=??@????.???
sender=
organization=
followupto=
mailcopiesto=
references=<7o4r52l1iu1qcbr4p745ti03rn56ofun5b@4ax.com>
<t_v7g.383943$hn5.158825@fe04.news.easynews.com>
supersedes=
cancel=
cc=
bcc=
archive=
keywords=
summary=
expires=
approved=
distribution=
bodypos=911
attachments=||0|0|-1|
fontname=Courier New
fontsize=8
currentintroline=On Mon, 08 May 2006 00:08:57 GMT, ebook@eworm.tld
wrote:
prevsignature=-- --
CL.+-----------------------------------------+| Charles Lasitter
| Mailing / Shipping || 401/728-1987       | 14 Cooke St        ||
cl+at+ncdm+dot+com | Pawtucket RI 02860
|+-----------------------------------------+
originalgroupkey=21318
originalarticlekey=48
orisubject=Reformat quoted lines
orisubjectplain=Reformat quoted lines
israwsubject=0
followuptowanted=
mailcopiestowanted=
referencesunedited=<7o4r52l1iu1qcbr4p745ti03rn56ofun5b@4ax.com>
<t_v7g.383943$hn5.158825@fe04.news.easynews.com>
nntpresult=Sent successfully
smtpresult=Not yet sent
meantasemail=false
orifromw=<ebook@eworm.tld>
orifullnamew=ebook@eworm.tld
orinewsgroup=alt.usenet.offline-reader.forte-agent
bodypos=-1

On Mon, 08 May 2006 00:08:57 GMT, ebook@eworm.tld wrote:

>> I vaguely remember using a prgm like Agent (or perhaps it was
>> 1 of the earlier versions of Agent) that would let me auto
>> reformat the quoted lines.

>> I can't find that in (this version of) Agent. Did I miss it,
>> isn't it there or/and has it never been there?

> I don't think Agent ever did, but the email/news program Dialog
> (from 40tude) does it easily and correctly, even when reply
> lines are nested many levels deep.

> Agent *needs* this feature.

I agree.  This is my first usenet post using 40tude, which is 
very fast at retrieving bodies compared to Agent.  I think the 
software is so promising that I've already sent them a donation.

I hope Agent picks up the pace on features such as this, because 
they are real time savers.  Without them, I'm afraid it'll be 
another 8-10 years before I look at Agent again.

-- CL.

+-----------------------------------------+
| Charles Lasitter   | Mailing / Shipping |
| 401/728-1987       | 14 Cooke St        |
| cl+at+ncdm+dot+com | Pawtucket RI 02860 |
+-----------------------------------------+

***** End *****

This message still exists in the "sent" folder, so I just had to
delete it, so no big deal.

-- 

CL -> http://tinyurl.com/2zqgly
For email correspondence.

+----------------------------------------------+
| Charles Lasitter   | Address, Mail / Ship:   |
| 401/728-1987       | 14 Cooke St             |
| see^tinyurl>4email | Pawtucket RI 02860-6114 |
+----------------------------------------------+
Re: [Dialog] .DAT to .mbox conversion?
#203454
Author: Oliver Cromm
Date: Thu, 09 Aug 2007 16:52
64 lines
3988 bytes
* Charles Lasitter wrote:

> On Thu, 9 Aug 2007 01:42:39 -0400, Oliver Cromm wrote:
> 
>> Well, here's a quick hack that worked for my SeaMonkey AFAICS in a
>> few tests. Tell me if it does the job for you. There are
>> differences between what various applications expect and accept as
>> "mbox".
> 
> More feedback, mostly still good:
> 
> By applying a score to newsgroup articles, I could sort them and
> delete them easily.  

Good, I wanted to suggest something like that. It could of course be
done in the conversion - and "one mbx per Newsgroup" as well. I will do
that in the "proper" version.

> Something went a bit wrong with either converting or Dialog's
> interpreting of messages I had originated, since message fields were
> not properly identified.  Here's how one looked after conversion but
> before import:
> 
> ***** Begin *****
> postedheaderCT="From: Charles Lasitter
> <check.sig4@ddress.com>","Subject: Re: Reformat quoted
> lines","Newsgroups:
> alt.usenet.offline-reader.forte-agent","User-Agent:
> 40tude_Dialog/2.0.15.1 (6ba32acf.285.130)","MIME-Version:
> 1.0","Content-Type: text/plain;
> charset=""us-ascii""","Content-Transfer-Encoding: 7bit","References:
> <7o4r52l1iu1qcbr4p745ti03rn56ofun5b@4ax.com>
> <t_v7g.383943$hn5.158825@fe04.news.easynews.com>","Date: Mon, 8 May
> 2006 14:03:19 -0400","Message-ID:
> <1mheaim2i3pyi$.1ahezg9tsfgcn.dlg@40tude.net>"
> msgid=<1mheaim2i3pyi$.1ahezg9tsfgcn.dlg@40tude.net>
> subject=Re: Reformat quoted lines
> newsgroups=alt.usenet.offline-reader.forte-agent
> email=
> identity=NCDM
> signature=Cooke Street
> server=Cox
> spelloption=1|

[...]

I believe this is a Draft or Outbox message. It was mentioned in the old
thread. The way the conversion works right now, I'm not seeing the index
files, and I don't know to which Group or Folder a message belongs.


> +-----------------------------------------+
>| Charles Lasitter   | Mailing / Shipping |
>| 401/728-1987       | 14 Cooke St        |
>| cl+at+ncdm+dot+com | Pawtucket RI 02860 |
> +-----------------------------------------+

So how's the beer there, really?

-- 
Microsoft designed a user-friendly car:
instead of the oil, alternator, gas and engine
warning lights it has just one: "General Car Fault"
Re: [Dialog] .DAT to .mbox conversion?
#203461
Author: Charles Lasitter
Date: Thu, 09 Aug 2007 21:06
24 lines
2454 bytes
On Thu, 9 Aug 2007 12:52:14 -0400, Oliver Cromm wrote:

> I believe this is a Draft or Outbox message. It was mentioned in the
> old thread. The way the conversion works right now, I'm not seeing
> the index files, and I don't know to which Group or Folder a
> message belongs.

Mission accomplished:  It took some time, but I think I've now
recovered all the messages that were in my inbox.

The only other curious thing I would report is that after the .DAT
file was converted and imported from the .mbox format, I then saw two
copies of every imported message.  Don't know why this happened.

-- 

CL -> http://tinyurl.com/2zqgly
For email correspondence.

+----------------------------------------------+
| Charles Lasitter   | Address, Mail / Ship:   |
| 401/728-1987       | 14 Cooke St             |
| see^tinyurl>4email | Pawtucket RI 02860-6114 |
+----------------------------------------------+
Re: [Dialog] .DAT to .mbox conversion?
#203522
Author: Bernd Rose
Date: Sat, 11 Aug 2007 03:38
38 lines
2881 bytes
On Thu, 9 Aug 2007 01:42:39 -0400, Oliver Cromm wrote:

>>> I didn't express myself clearly? I don't see the bribe going up.
[...] 
>> $35
[...] 
> It was basically a joke ... 

I had a good laugh watching this exchange during the last days. Since
Charles posted his offer I wondered how you meddle out of this. ;-)

> Well, here's a quick hack that worked for my SeaMonkey AFAICS in a few
> tests. Tell me if it does the job for you. There are differences between
> what various applications expect and accept as "mbox".
[...]
> FROMLINE = "From abc@xyz.invalid Mon Jan 01 00:00:00 1970\r\n"

You could extract the envelope-From from the Return-Path: header. 
It is always the first line for mails and not available for Usenet
postings. So you could also filter out the Usenet postings during 
the parsing process, this way.

But because of the little importance of the envelope-From for *.mbox
handling, I suggest to stick with a solution like the one you posted,
but with a minor change. If you use

>From msgXXXXX@export.from.40tude.invalid [24 chars current date 'asctime']

you can archive them and can easily identify the content, later.
(The XXXXX would be a counter, of course.)

>     line.sub!(/^From /, ">From ")

You need to adjust this one. You not only need to "escape" lines starting
with "From", but also with ">From", ">>From", and so on.

HTH.
Bernd
Re: [Dialog] .DAT to .mbox conversion?
#203690
Author: Charles Lasitter
Date: Mon, 13 Aug 2007 03:27
22 lines
2378 bytes
On Sat, 11 Aug 2007 05:38:15 +0200, Bernd Rose wrote:

> I had a good laugh watching this exchange during the last days. Since
> Charles posted his offer I wondered how you meddle out of this. ;-)

Important outcome for me was that the ruby script got me back the
messages so I could work with them, if even in rough shape, to get
back to about where I was.

>From now on I'll be doing the "compact database" thing to generate
backups more frequently ...

-- 

CL -> http://tinyurl.com/2zqgly
For email correspondence.

+----------------------------------------------+
| Charles Lasitter   | Address, Mail / Ship:   |
| 401/728-1987       | 14 Cooke St             |
| see^tinyurl>4email | Pawtucket RI 02860-6114 |
+----------------------------------------------+
Re: [Dialog] .DAT to .mbox conversion?
#203691
Author: Oliver Cromm
Date: Mon, 13 Aug 2007 04:15
87 lines
4438 bytes
On Sat, 11 Aug 2007 05:38:15 +0200, Bernd Rose wrote:

> On Thu, 9 Aug 2007 01:42:39 -0400, Oliver Cromm wrote:
> 
>>>> I didn't express myself clearly? I don't see the bribe going up.
> [...] 
>>> $35
> [...] 
>> It was basically a joke ... 
> 
> I had a good laugh watching this exchange during the last days. Since
> Charles posted his offer I wondered how you meddle out of this. ;-)

It was a little awkward, but giving money to MSF is a good thing. If I
continue feeling bad, I'll give the same amount :-)
 
>> FROMLINE = "From abc@xyz.invalid Mon Jan 01 00:00:00 1970\r\n"
> 
> You could extract the envelope-From from the Return-Path: header. 
> It is always the first line for mails and not available for Usenet
> postings. So you could also filter out the Usenet postings during 
> the parsing process, this way.

Whether there or in From, I would do that (only) in a more systematic
version.

I can't really test Mail so well because my own Dialog doesn't contain
mail right now (except for converted Mailing Lists, which differ from
ordinary mail, e.g. wrt the Return-Path).

> From msgXXXXX@export.from.40tude.invalid [24 chars current date 'asctime']
> 
> you can archive them and can easily identify the content, later.
> (The XXXXX would be a counter, of course.)

Interesting suggestion. Yes, I like that. 

>>     line.sub!(/^From /, ">From ")
> 
> You need to adjust this one. You not only need to "escape" lines starting
> with "From", but also with ">From", ">>From", and so on.

Thanks, this is an important correction.

Below the script with Bernd's suggestions incorporated. Charles, if you
have your filters still ready, consider doing the conversion again. 



#!/usr/bin/env ruby
# dattombx.rb
# Author: Oliver Cromm, 2007 with input from Bernd Rose
# creates a mbx file from each msg*.dat in Dialog's data direectory
# Usage: place into data dir and run - that's it!
# Backup your files first, no guarantees.

TIMESTRING = Time::now.asctime
EMPTYLINE = "\r\n"

def fromline(counter)
  return "From msg#{counter}@export.from.40tude.invalid 
end

counter = "00001"
Dir['msg*.dat'].each do |inp|
  fname = File.basename(inp, ".dat")+".mbx"
  out = File.open(fname, "wb")
  firstline = true
  out.print fromline(counter)
  File.open(inp).each do |line|
    line.chomp!
    line.gsub!(/^..../,'') if firstline
    firstline = false
    if line.sub!(/^\x7f/,'')
      out.print EMPTYLINE
      counter.succ!
      out.print fromline(counter)
    end
    line.sub!(/^(\>*From )/, ">\\1")
    out.print line, "\r\n"
  end
  out.print EMPTYLINE
  out.close
end 

-- 
Oliver C.
Re: [Dialog] .DAT to .mbox conversion?
#203714
Author: Charles Lasitter
Date: Mon, 13 Aug 2007 13:43
26 lines
2502 bytes
On Mon, 13 Aug 2007 00:15:55 -0400, Oliver Cromm wrote:

> Below the script with Bernd's suggestions incorporated. Charles, if
> you have your filters still ready, consider doing the conversion
> again.

Thanks, I have saved this.

Which of the things I was observing would this update resolve?
Duplicate converted messages?  Differentiating between messages I had
sent versus received?

I have a favor to ask:  Could you munge your email so that I can
understand it but spambots cannot?  I've tried sending some emails
over the past few days and I'm pretty sure they didn't reach you.

-- 

CL -> http://tinyurl.com/2zqgly
For email correspondence.

+----------------------------------------------+
| Charles Lasitter   | Address, Mail / Ship:   |
| 401/728-1987       | 14 Cooke St             |
| see^tinyurl>4email | Pawtucket RI 02860-6114 |
+----------------------------------------------+
Re: [Dialog] .DAT to .mbox conversion?
#203743
Author: Bernd Rose
Date: Mon, 13 Aug 2007 22:08
33 lines
3034 bytes
Am Sun, 12 Aug 2007 23:27:49 -0400 schrieb Charles Lasitter:

> On Sat, 11 Aug 2007 05:38:15 +0200, Bernd Rose wrote:
> 
>> I had a good laugh watching this exchange during the last days. Since
>> Charles posted his offer I wondered how you meddle out of this. ;-)
> 
> Important outcome for me was that the ruby script got me back the
> messages so I could work with them, if even in rough shape, to get
> back to about where I was.

Yes. I read your question a few hours late. Oliver had already asked
his "what bribe?" question and your request didn't sound too urgent.
So I decided to sit back and watch things unfold. Else I would have
posted a Sed script or sth. the like, myself.

Regarding your question about improvements of the new version (i.e.
whether or not you should consider re-running the whole process):
The important point is the incomplete handling of lines starting
with "From " already preceded by ">" chars. If you don't have such
within your mails, you don't need to re-run. If you're unsure and
want perfect copies stored - do it again.

Please note that you shouldn't use the second version of the Ruby
script until Oliver has fixed the little flaws.

> From now on I'll be doing the "compact database" thing to generate
> backups more frequently ...

It is always a good idea to make up the mind to do sth. perfectly
*in future*. I hope, your good intentions hold.  ;-)

Bernd
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