Solved

Converting mbox To Maildir using Perfect_maildir tool

Posted on 2004-04-02
11
927 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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now