Solved

Converting mbox To Maildir using Perfect_maildir tool

Posted on 2004-04-02
11
944 Views
Last Modified: 2007-12-19
I have been trying to get the Perfect_maildir tool working for an hour now.
http://perfectmaildir.home-dn.net/
From what I understand the syntax should be
./perfect_maildir.pl /home/user/Maildir < /home/user/mail

When I try this I get an error
[user@mail user]$ /home/user/Desktop/perfect_maildir.pl /home/user/Maildir < /home/user/mail
Cannot write to /home/user/Maildir/cur
[user@mail user]$

What the heck am I doing wrong.
0
Comment
Question by:illtbagu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10747478
Does /home/user/Maildir exist? If not, create this directory first and try again.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10747501
Actually, you also need to create the subdirs tmp new and cur in Maildir:

mkdir ~/Maildir
mkdir ~/Maildir/cur ~/Maildir/tmp ~/Maildir/new

0
 
LVL 1

Author Comment

by:illtbagu
ID: 10748389
Thanks for the help.

~/Maildir does exist.

Your suggestion did not work. Here are the results
---------------------------------------------------------------------------------------
[user@mail user]$ mkdir ~/Maildir/cur ~/Maildir/tmp ~/Maildir/new
[user@mail user]$ chown -R user:user Maildir
[user@mail user]$ /home/user/Desktop/perfect_maildir.pl /home/user/Maildir < /home/user/mail
Inserted 0 messages into maildir /home/user/Maildir in 0 seconds
----------------------------------------------------------------------------------------

Thanks,
AD
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10748418
It does work for me. What is "mail"? What does "file /home/user/mail" print?
I just tried it again on a different machine, and it still works ...
0
 
LVL 1

Author Comment

by:illtbagu
ID: 10748530
/home/user/mail is the directory where all of my mail is stored in mbox format.

[user@mail user]$ file /home/user/mail
/home/user/mail: directory
[user@mail user]$
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 10748596
You need to specify just one file at a time from your /home/user/mail directory:

/home/user/Desktop/perfect_maildir.pl /home/user/Maildir < /home/user/mail/my_emails_1

The Perl script is reading from stdin, so you have to specify a file and not a directory.
0
 
LVL 1

Author Comment

by:illtbagu
ID: 10748886
Ok that works. Thanks very much. I am very disappointed, I thought this script was capable of converting an entire users mailbox from mbox to maildir. Thats why I was pointing the script at the mbox directory instead of the actual mbox. Could you imagine tryng to convert hundreds or even thousands of uses mailboxes from mbox to maildir with this tool. I guess its better than nothing. There is just alot of manual work that needs to be done in order to convert an entire mbox directory over to maildir with this script.

I will try and use mbox2maildir again.
http://batleth.sapienti-sat.org/projects/mb2md/
I have actually been fighting trying to get either one of these tools to work for me. I actually started off using the mbox2maildir script but I keep getting errors. Frustration just got the best of me I guess. Sometimes frustrtion makes you stupid :)
------------------------------------------------------------------------------
[user@mail user]$ mb2md-3.20.pl -s mail -l .mailboxlist -R -d Maildir
Can't locate Date/Parse.pm in @INC (@INC contains: /usr/lib/perl5/5.8.3/i386-linux-thread-multi /usr/lib/perl5/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /usr/bin/mb2md-3.20.pl line 385.
BEGIN failed--compilation aborted at /usr/bin/mb2md-3.20.pl line 385.
[user@mail user]$
------------------------------------------------------------------------------
No matter what I do I get this error. On line 385 of this script it says
use Date::Parse;

Any ideas?

Thanks for your help.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10748921
I'm not familiar with this tool. Give me some time to download/install/investigate.

Regarding the directories vs. individual files: You can probably create a script that searches for all files in the user's mail directory and then recreates this structure in Maildir form. The challenge is to actually recreate the structure. If you had someting in it's own mail folder, you want to create a new directory under Maildir (with the three subdirs) and use this directory as output directory.
0
 
LVL 1

Author Comment

by:illtbagu
ID: 10749217
I rewarded you for your help on my original question and I have open up another concerning the mbox2maildir tool. This is only fair to you.
http://experts-exchange.com/Operating_Systems/Linux/Q_20942581.html

Thanks again,
AD
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10749262
I suspect that it's a missing Perl module. If you check the download link at http://batleth.sapienti-sat.org/projects/mb2md/#Download it states that this program requires TimeDate.

It's very likely that this Perl module is part of your Linux distribution, and you just have to install it. If you don't find it on your installation CDs, you can download it from here: http://www.perl.com/CPAN/modules/by-module/Time/TimeDate-1.16.tar.gz 
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10749268
Sorry, didn't see your last comment. I'll post the comment in the new question again.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question