Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of rafael (2125)

Sunday July 14, 2002
05:00 PM

Export mailbox to MH

[ #6347 ]
In the process of migrating to Sylpheed, I had to convert my mailboxes to MH folders. Should it be useful, here's the code I used for that :

cd $HOME
for folder in `find mail -type f -not -empty | sed s,mail/,,`
    mkdir -p $HOME/Mail/$folder
    cd $HOME/Mail/$folder
    cat $HOME/mail/$folder | formail -s perl -pe \
        'BEGIN{$n=$ENV{FILENO}+1;open STDOUT,">$n"or die"$n:$!"}END{close STDOUT}'
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.