Subject: | can't read Offline.dbx |
Date: | Thu, 04 Jun 2009 13:42:28 -0700 |
To: | bug-Mail-Box [...] rt.cpan.org |
From: | Mike Ekberg <emike1955 [...] gmail.com> |
When I run the enclosed perl script, with the atttached Offline.dbx, I
get an exception:
dbx2mbox.pl dbxExamples/Offline.dbx dbxTest/Offline.mbox
opening existing dbxfile dbxExamples/Offline.dbx
ERROR: Cannot read dbx folder file dbxExamples/Offline.dbx.
Uncaught exception from user code:
cannot read dbxfile dbxExamples/Offline.dbx using
Mail::Box:Dbx->new: at ./dbx2mbox.pl line 24.
at ./dbx2mbox.pl line 24
make: *** [dbx] Error 255
I am not exactly sure where I got Offline.dbx, so it could be bogus. I
think it likely I got it from setting up a simply microsoft mail program
and creating a few emails.
Mike Ekberg
#! /usr/bin/perl
#dbx2mbox.pl <dbxfile> <mboxfile>
# convert <dbxfile> to <mboxfile>
$| = 1;
use strict;
use warnings;
use diagnostics;
use Mail::Transport::Dbx;
use Mail::Box::Mbox;
use Mail::Box::Dbx;
chomp (my $dbxfile = shift);
chomp (my $mboxfile = shift);
system ("/bin/rm -f $mboxfile");
-e $dbxfile || die "cannot find dbxfile $dbxfile";
print "opening existing dbxfile $dbxfile\n";
my $from = Mail::Box::Dbx->new(folder => $dbxfile)
or die "cannot read dbxfile $dbxfile using Mail::Box:Dbx->new:$!";
print "dbxfile $dbxfile is open\n";
print "creating mboxfile $mboxfile\n";
my $to = Mail::Box::Mbox->new(folder => $mboxfile,
access => 'w', create => 1) or die "cannot create new mbox file using Mail::Box::Mbox->new: $!";
print "mboxfile $mboxfile is created\n";
print "copying dbxfile($dbxfile) -> mboxfile($mboxfile)\n";
$from->copyTo($to) || die "from->copyTo($mboxfile) failed:$!";
exit;
Message body not shown because it is not plain text.