mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 13:26:38 +03:00
feat: add option to force encryption
This commit is contained in:
@@ -505,6 +505,14 @@ pub(crate) async fn receive_imf_inner(
|
||||
Ok(mime_parser) => mime_parser,
|
||||
};
|
||||
|
||||
if !mime_parser.was_encrypted()
|
||||
&& mime_parser.get_header(HeaderDef::SecureJoin).is_none()
|
||||
&& context.get_config_bool(Config::ForceEncryption).await?
|
||||
{
|
||||
warn!(context, "Fetched unencrypted message, ignoring");
|
||||
return trash().await;
|
||||
}
|
||||
|
||||
let rfc724_mid_orig = &mime_parser
|
||||
.get_rfc724_mid()
|
||||
.unwrap_or(rfc724_mid.to_string());
|
||||
|
||||
Reference in New Issue
Block a user