Solved

Converting mbox To Maildir using Perfect_maildir tool

Posted on 2004-04-02
11
938 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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ignore other .htaccess 2 69
centos commands 6 87
What is the best way to transfer files from and to Linux VNC window? 9 69
NTPD Client Port Usage 12 60
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

680 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