Mail::Transport::Dbx

Parse Outlook Express mailboxes
Download

Mail::Transport::Dbx Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tassilo von Parseval
  • Publisher web site:
  • http://search.cpan.org/~vparseval/

Mail::Transport::Dbx Tags


Mail::Transport::Dbx Description

Parse Outlook Express mailboxes Mail::Transport::Dbx is a Perl module that gives you platform independent access to Outlook Express' dbx files. Extract subfolders, messages etc. from those or use it to convert dbx archives into a more portable format (such as standard mbox format).It relies on LibDBX to do its job. The bad news: LibDBX knows nothing about the endianness of your machine so it does not work on big-endian machines such as Macintoshs or SUNs. The good news: I made the appropriate patches so that it in fact does work even on machines with the 'wrong' byteorder (exception: machines with an even odder byteorder such as Crays are not suppored; exception from the exception: If you buy me a Cray I'll promise to fix it.You have to understand the structure of .dbx files to make proper use of this module. Outlook Express keeps a couple of those files on your harddisk. For instance: Folders.dbx folder1.dbx comp.lang.perl.misc.dbxThe nasty thing about that is that there are really two different kinds of such files: One that contains the actual messages and one that merely holds references to other .dbx files. Folders.dbx could be considered the toplevel file since it lists all other available .dbx files. As for folder1.dbx and comp.lang.perl.misc.dbx you can't yet know whether they contain messages or subfolders (though comp.lang.perl.misc.dbx probably contains newsgroup messages that are treated as mere emails).Fortunately this module gives you the information you need. A common approach would be the following: 1) create a new Mail::Transport::Dbx object from "Folders.dbx" 2) iterate over its items using the get() method 2.1 if it returns a Mail::Transport::Dbx::Email => a message 2.2 if it returns a Mail::Transport::Dbx::Folder => a folder 3) if message 3.1 call whatever method from Mail::Transport::Dbx::Email you need 4) if folder 4.1 call whatever method from Mail::Transport::Dbx::Folder you need OR 4.2 call dbx() on it to create a new Mail::Transport::Dbx object 4.2.1 if dbx() returned something defined => rollback to item 2)The confusing thing is that .dbx files may contain references to other folders that don't really exist! If Outlook Express was used a newsclient this is a common scenario since Folders.dbx lists all newsgroups as separate Mail::Transport::Dbx::Folder objects no matter whether you are subscribed to any of those or not. So in essence calling dbx() on a folder will only return a new object if the corresponding .dbx file exists.SYNOPSIS use Mail::Transport::Dbx; my $dbx = eval { Mail::Transport::Dbx->new("box.mbx") }; die $@ if $@; for my $i (0 .. $dbx->msgcount - 1) { my $msg = $dbx->get($i); print $msg->subject; ... } # more convenient for my $msg ($dbx->emails) { print $msg->subject; ... } Requirements: · Perl


Mail::Transport::Dbx Related Software