mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
Fix eml ID conversion issue
This commit is contained in:
@@ -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
|
||||
)
|
||||
})?;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user