Solved

Converting mbox To Maildir using Perfect_maildir tool

Posted on 2004-04-02
11
934 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

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…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…

805 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