convert .eml to .mbox in win32

M

Mike James

Hi, I'm working with some code I copied from here:
http://www.usethesource.com/articles/02/06/17/1957223.shtml

My system: WinXP Home, ActiveState Perl 5.6.1, operated by Perl newbie...

The script is supposed to descend into sub-folders, read *.eml messages,
then concatenate them into .mbox files. The problem is that the script
doesn't descend into the sub-folders. Instead, it only operates on the
files (and folders) in the folder where the script is located.

Here's the script for convert.pl:

sub convert
{
my ($file) = @_;
my $from = '';
my $date = '';
my $message = '';
my $stop_looking = 0;

open OE, "<$file";

while ()
{
my $line;
chomp;
$line = $_;

$message .= $_ . "\n";

if ( $stop_looking == 0 )
{
if ( $line =~ /(From:.*\<(.*)\>)/ )
{
$from = $2;
}
else
{
if ( $line =~ /(From: ([^\<]*))/ )
{
$from = $2;
}
}

if ( $line =~ /Date: (.*)/ )
{
$date = $1;

if ( $date =~ /(\w{3}), (\d+) (\w{3}) (\d{4}) (\d\d:
\d\d:\d\d)/ )
{
my ($dow, $day, $month, $year, $time) = ($1,
$2,$3,$4,$5);

if ( $day =~ /0(\d)/ )
{
$day = " $1";
}

$date = "$dow $month $day $time $year";
}
}

if ( $line =~ /X-UIDL:/ )
{
$message = "\n\nFrom $from $date\n" . $message;

$stop_looking = 1;
}
}
}

close OE;

return $message;
}

sub convert_folder
{
my ($folder) = @_;
my @files = glob "$folder/*.eml";

open MBOX, ">$folder.mbox";
foreach my $file (@files)
{
print "File $file...\n";
print MBOX convert( $file );
}
close MBOX;
}

my @folders = glob '*';
foreach my $folder (@folders)
{
print "Converting $folder...\n";
convert_folder( $folder );
}
 
J

Jonathan N. Little

shakespeare1 said:
Today, many users are facing troubles about how to convert messages from Windows Live Mail into Thunderbird. Conversion of Live Mail to Thunderbird is not easy task because both supports different email format. Windows Live Mail supports .eml format while Thunderbird supports MBOX format. Without any help of third party tool, Live Mail to Thunderbird conversion is not possible.

In this situation the EML to MBOX Converter is reliable solution to convert your mail messages from Windows 7 mail into Thunderbird, The software also allows you to open or view .eml files into .mbox format with complete emails data like - Mata data (To, Cc, Bcc, Date, Time, From), Attachments & attachment, Content style and Formatting, Image, Hyperlink, Sub-folders & Email folder etc. For more information view below link >> http://www.import-windows-live-mail-to-thunderbird.emltombox.org/
https://sites.google.com/site/emlin...advance-feature/howindows-mail-to-thunderbird


You can just drag and drop EML files directly into Thunderbird no
problem-o. Thunderbird could always import from Outlook and
OutlookExpress with no addons required, not sure about Windows Live
Mail, but if you export as EML Thunderbird has no problem with that
filetype.
 
Joined
Jun 26, 2024
Messages
1
Reaction score
0
To convert .eml to .mbox in win32? I would also recommend using Mailvita EML to MBOX Converter Tool is simple way to convert .eml to .mbox for Mac and Windows. This application is convert one and multiple Windows Live Mail EML files to MBOX file format. It enables users to convert EML files to Thunderbird, Mac Mail, Eudora, Poco Mail, Sec Monkey, and many more MBOX-based email clients. The utility contains a simple-to-use interface that can be easily managed by any technical and non-technical user. Apart from it, the tool has lots of advanced features that help us to convert EML files of any email client into MBOX format. You can try the free demo version of the software. EML to MBOX Converter Tool supports all Mac and Windows OS versions.
 
Joined
Dec 2, 2024
Messages
29
Reaction score
1
I suggest you try the EmailSoftwares EML to MBOX Converter, a reliable solution for converting EML emails and attachments to MBOX format. This tool supports batch conversion for multiple EML files, making it compatible with email clients like Thunderbird, PocoMail, Apple Mail, and OperaMail. It preserves the folder hierarchy and original formatting, with no need to install an email client during the process. The preview feature ensures accuracy, and you can save converted files to a location of your choice. Compatible with all Windows OS editions, it offers a free trial version, making it perfect for seamless email migration.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,260
Messages
2,571,038
Members
48,768
Latest member
first4landlord

Latest Threads

Top