NAME

Mail::Convert::Mbox::ToEml - Perl extension to convert Mbox files (from Mozilla and Co) to Outlook Express eml files.

SYNOPSIS

use Mail::Convert::Mbox::ToEml;
my $EML=Mail::Convert::Mbox::ToEml->new($file, $outdir);
my $ret=$EML->CreateEML();

DESCRIPTION

Mail::Convert::Mbox::ToEml is a module to convert Mbox mail folder which used by Mozilla and co. to single Outlook Express .eml files.

FUNCTIONS

new()

The constructor. $EML=Mail::Convert::Mbox::ToEml->new($file, $outdir); The two arguments are: $file is the MBox file to convert. $outdir is the directory where the single eml files are stored.

On error the method returns undef.

CreateEML()

This function do the convertion and writes the .eml file. The two optional arguments are: $file is the MBox file to convert. $outdir is the directory where the single eml files have to be stored.

The return value is undef if the file or the ouput directory does not exist and 1 on success. If there was an error to create the eml file it will be printed out and continuewith the next message.

GetMessages()

This method returns the subject line of all messages in the file. Paramter: the file to process (optional) Return: an Array of subjects or undef.

FindMessage()

This method return the found messages which match the keyword in the subject line given as parameter. Parameters: a keyword and optional a file to process Return: a hash of hashes whith the subject line and the message number or undef.

example: my %h = $MBX->FindMessage("RE: Help", ["d:/mail/Inbox"]); foreach (keys %h) { print "The key: $_="; foreach my $xx (keys %{$h{$_}}) { print "$xx=" . %{$h{$_}}->{$xx} . " "; } print " \n"; }

GetMessageCount()

This method returns the number of messages in the given file or undef. There are no parameters.

SetFileAndDir()

With this Method the input file and the output directory can be set. Parameters: filename, output directory Return 1 on success or undef if the file or the output directory does not exist.

CREDITS

Many thank's to Ivan from Broobles.com (http://www.broobles.com/imapsize/) the author of the usefull IMAPSize program for his help and tips to develop this module.

EXPORT

None by default.

AUTHOR

Reinhard Pagitsch, <rpirpag@gmx.at>

SEE ALSO

perl.