fix: skip invalid MBOX files during import

This commit is contained in:
rustmailer
2026-01-13 23:31:45 +08:00
parent 3fb761064d
commit 5d3c319a67
+7 -1
View File
@@ -102,7 +102,13 @@ pub async fn run_import(
target_folder: Option<String>,
) {
let client = Client::new();
let mbox = MboxFile::from_file(mbox_path).unwrap();
let mbox = match MboxFile::from_file(mbox_path) {
Ok(mbox) => mbox,
Err(err) => {
println!("Skipping invalid MBOX: {} ({})", mbox_path.display(), err);
return;
}
};
let mut folder_buffers: HashMap<String, Vec<String>> = HashMap::new();
let batch_limit = 50;