mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
fix: "No body available" #262
When the request returns an empty body, choose to skip it and print the account ID and UID information, leaving it for the user to investigate themselves. Otherwise, the IMAP download process will be blocked by this.
This commit is contained in:
@@ -50,9 +50,17 @@ pub async fn extract_envelope_and_store_it(
|
|||||||
.map(|d| d.timestamp_millis())
|
.map(|d| d.timestamp_millis())
|
||||||
.unwrap_or(0);
|
.unwrap_or(0);
|
||||||
let uid = fetch.uid.unwrap_or(0);
|
let uid = fetch.uid.unwrap_or(0);
|
||||||
let body = fetch
|
let body = match fetch.body() {
|
||||||
.body()
|
Some(b) => b,
|
||||||
.ok_or_else(|| raise_error!("No body available".into(), ErrorCode::InternalError))?;
|
None => {
|
||||||
|
tracing::warn!(
|
||||||
|
account_id,
|
||||||
|
uid = fetch.uid,
|
||||||
|
"FETCH response has no body, skipping message"
|
||||||
|
);
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
};
|
||||||
let size = fetch.size.unwrap_or(body.len() as u32);
|
let size = fetch.size.unwrap_or(body.len() as u32);
|
||||||
extract_envelope_core(body, uid, size, internal_date, account_id, mailbox_id).await
|
extract_envelope_core(body, uid, size, internal_date, account_id, mailbox_id).await
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user