From ce526040d163d995ba32c6630180dcd1a05e0757 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 1 Apr 2007 21:44:57 +0000 Subject: [PATCH] Support cPanel domain owners with maildir inbox --- migrate_form.cgi | 2 +- migration-cpanel.pl | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/migrate_form.cgi b/migrate_form.cgi index ee832a3e6..4d14f13e0 100755 --- a/migrate_form.cgi +++ b/migrate_form.cgi @@ -15,7 +15,7 @@ print &ui_table_start($text{'migrate_header'}, "width=100%", 4); print &ui_table_row($text{'migrate_file'}, &ui_radio("mode", 0, [ [ 0, &text('migrate_file0', &ui_upload("upload"))."
" ], - [ 1, &text('migrate_file1', &ui_textbox("file", undef, 30)). + [ 1, &text('migrate_file1', &ui_textbox("file", undef, 50)). &file_chooser_button("file") ] ]), 3); print &ui_table_row($text{'migrate_type'}, diff --git a/migration-cpanel.pl b/migration-cpanel.pl index 70516a98e..0924e5a0a 100755 --- a/migration-cpanel.pl +++ b/migration-cpanel.pl @@ -485,8 +485,17 @@ sub migration_cpanel_migrate if ($owner) { &$first_print("Moving server owner's mailbox .."); local ($mfile, $mtype) = &user_mail_file($owner); - local $srcfolder = { 'type' => 0, 'file' => "$dom{'home'}/mail/inbox" }; - if (-r $srcfolder->{'file'}) { + local $srcfolder; + if (-d "$dom{'home'}/mail/cur") { + # Maildir format + $srcfolder = { 'type' => 1, 'file' => "$dom{'home'}/mail" }; + } + elsif (-r "$dom{'home'}/mail/inbox") { + # mbox format + $srcfolder = { 'type' => 0, + 'file' => "$dom{'home'}/mail/inbox" }; + } + if ($srcfolder) { local $dstfolder = { 'type' => $mtype, 'file' => $mfile }; &mailboxes::mailbox_move_folder($srcfolder, $dstfolder); &$second_print(".. done");