Article View: news.software.readers
Article #203440Re: [Dialog] .DAT to .mbox conversion?
From: Oliver Cromm
Date: Thu, 09 Aug 2007 05:42
Date: Thu, 09 Aug 2007 05:42
70 lines
3748 bytes
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.
Technical Details
Message-ID:
<14w8exlprcgmx$.dlg@ocromm.my-fqdn.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news-out.octanews.net!indigo.octanews.net!auth.beige.octanews.com.POSTED!not-for-mailReferences:
<16n9t1ynvi8j2.dlg@ncdm.com> <nxsahp9pj00b$.dlg@sqwertz.com> <1wk9pc4x2ck6z$.dlg@ocromm.my-fqdn.de> <1ty9e76kkz658.dlg@ncdm.com> <nydjhcd39a0y$.dlg@ocromm.my-fqdn.de> <1vvi7q5d0q4rf.dlg@ncdm.com> <1a3wznzipiq2h$.dlg@ocromm.my-fqdn.de> <9si85jancxkk.dlg@ocromm.my-fqdn.de> <zk0obxz7cif8.dlg@ncdm.com>Show Full Headers
Complete Article Headers
Message-ID: <14w8exlprcgmx$.dlg@ocromm.my-fqdn.de>
Subject: Re: [Dialog] .DAT to .mbox conversion?
Date: Thu, 9 Aug 2007 01:42:39 -0400
From: Oliver Cromm <lispamateur@yahoo.de>
References: <16n9t1ynvi8j2.dlg@ncdm.com> <nxsahp9pj00b$.dlg@sqwertz.com> <1wk9pc4x2ck6z$.dlg@ocromm.my-fqdn.de> <1ty9e76kkz658.dlg@ncdm.com> <nydjhcd39a0y$.dlg@ocromm.my-fqdn.de> <1vvi7q5d0q4rf.dlg@ncdm.com> <1a3wznzipiq2h$.dlg@ocromm.my-fqdn.de> <9si85jancxkk.dlg@ocromm.my-fqdn.de> <zk0obxz7cif8.dlg@ncdm.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news-out.octanews.net!indigo.octanews.net!auth.beige.octanews.com.POSTED!not-for-mail
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.10.1
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Organization: Seminar fuer kritische Bananenwissenschaft
X-Face: .f:ZE>c\~9oJ+1nK#>ntSHOQS~4x"Qx2m(<D<@p$G"tzb1lgWLUGY.zApKa@VL_?d$r(8=?VjrD9=uY:x!+H=hvj58Uw7)Y9<:KMYD.+^~#qMpeg2rvt`{#2a~7YoyFaFaBEdo4.TJzBqgtCZZ:mku4J|hey}DE}_"z(rl0N)\Pxh*0$"3B2mr\01&YPY7WJ:2kSe'I#PqiTxs1s49!S#W85'\zMXy*wRgD,,k.=4:3M{(P"i6S;
\az~ut3z`; ?*Y;
&]11<(EPF-SN`|3PhyL%~AuZpoFjjE_oM1`znHPq_?uib2WXwE+q@m),cLq~B$r^5uO]u6?CEecn=%xsDXNVa(1DX.)O(
Cache-Post-Path: vector.crommatograph.info!unknown@192.168.11.166
X-Cache: nntpcache 3.0.2 (see http://www.nntpcache.com/)
Lines: 70
NNTP-Posting-Date: 09 Aug 2007 00:42:57 CDT
X-Complaints-To: abuse@octanews.net
X-Original-Bytes: 3429