Fix eml ID conversion issue

This commit is contained in:
rustmailer
2026-03-07 17:50:20 +08:00
parent 2cba001431
commit a273b7f5e1
4 changed files with 45 additions and 19 deletions
+4 -6
View File
@@ -5,6 +5,7 @@ use crate::{
error::{code::ErrorCode, BichonResult},
imap::executor::ImapExecutor,
indexer::manager::{EML_INDEX_MANAGER, ENVELOPE_INDEX_MANAGER},
utils::create_hash,
},
raise_error,
};
@@ -55,16 +56,13 @@ pub async fn restore_emails(account_id: u64, message_ids: Vec<u64>) -> BichonRes
ErrorCode::ResourceNotFound
)
})?;
let eml_id = create_hash(account_id, &envelope.message_id);
let eml = EML_INDEX_MANAGER
.get(account_id, message_id)
.get(account_id, eml_id)
.await?
.ok_or_else(|| {
raise_error!(
format!(
"Email record not found: account_id={} id={}",
account_id, message_id
),
format!("Eml not found: account_id={} id={}", account_id, message_id),
ErrorCode::ResourceNotFound
)
})?;
+4
View File
@@ -206,6 +206,10 @@ pub async fn retrieve_email_content(account_id: u64, id: u64) -> BichonResult<Fu
}
}
}
//inline attachment will not be displayed in email attachment list
if inline && attachment.content_id().is_some() {
continue;
}
attachments.push(AttachmentInfo {
filename,