From 0fefe11bfd8a7d221841e5f753524697a7d0f250 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sun, 10 May 2020 16:21:42 +0300 Subject: [PATCH] Do not return "empty rfc724_mid" errors from rfc724_mid_cnt This function should only return temporary errors, e.g. database errors, as precheck_imf() and dc_receive_imf::add_parts() treat them as such, retrying the fetch on failure. When permanent errors, like missing Message-ID, are bubbled up, they cause infinite fetch loop. --- src/message.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/message.rs b/src/message.rs index d96833ee7..bb067eb5e 100644 --- a/src/message.rs +++ b/src/message.rs @@ -1432,7 +1432,10 @@ pub(crate) fn rfc724_mid_exists( context: &Context, rfc724_mid: &str, ) -> Result, Error> { - ensure!(!rfc724_mid.is_empty(), "empty rfc724_mid"); + if rfc724_mid.is_empty() { + warn!(context, "Empty rfc724_mid passed to rfc724_mid_exists"); + return Ok(None); + } context .sql