node->parent = parent;
node->next = parent->children;
parent->children = node;
- continue;
}
} else if (strcasecmp(node->raw_name, "INBOX") == 0) {
ilist->rebuild_on_missing_inbox = FALSE;
"Duplicate mailbox '%s' in index, renaming to %s",
old_name, node->raw_name);
}
- node->next = ilist->mailbox_tree;
- ilist->mailbox_tree = node;
+ if (node->parent == NULL) {
+ node->next = ilist->mailbox_tree;
+ ilist->mailbox_tree = node;
+ }
}
hash_table_destroy(&duplicate_hash);
return *error_r == NULL ? 0 : -1;