diff --git a/src/receive_imf.rs b/src/receive_imf.rs index f5f9a0525..012106eef 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -545,8 +545,15 @@ pub(crate) async fn receive_imf_inner( if mime_parser.incoming { return Ok(None); } - // For the case if we missed a successful SMTP response. Be optimistic that the message is - // delivered also. + + // It sometimes happens that a slow server (usually a classical email server) + // receives a message via SMTP, + // but then the connection to the server dies before it sends the OK response. + // In order to handle this case, we delete the SMTP send jobs if we receive our own message via IMAP. + // + // Now, messages with long recipient lists are split into multiple SMTP jobs. + // In this case, we only want to delete the SMTP job that was sent to self + // because this is the only chunk we can be sure was sent out. let self_addr = context.get_primary_self_addr().await?; context .sql