Skip to content

Commit

Permalink
Support cPanel domain owners with maildir inbox
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Apr 1, 2007
1 parent dda5dac commit ce52604
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion migrate_form.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -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"))."<br>" ],
[ 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'},
Expand Down
13 changes: 11 additions & 2 deletions migration-cpanel.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit ce52604

Please sign in to comment.