feat: Disable MDNs for bots by default

- To avoid receiving undecryptable MDNs by bots and replying to them if the bot's key changes.
- MDNs from bots don't look useful in general, usually the user expects some reply from the bot, not
  just that the message is read.
This commit is contained in:
iequidoo
2024-08-06 18:35:10 -03:00
committed by iequidoo
parent f03ffa7641
commit 5ce44ade17
4 changed files with 29 additions and 18 deletions

View File

@@ -631,9 +631,7 @@ async fn send_mdn_rfc724_mid(
/// Tries to send a single MDN. Returns true if more MDNs should be sent.
async fn send_mdn(context: &Context, smtp: &mut Smtp) -> Result<bool> {
let mdns_enabled = context.get_config_bool(Config::MdnsEnabled).await?;
if !mdns_enabled {
// User has disabled MDNs.
if !context.mdns_enabled().await? {
context.sql.execute("DELETE FROM smtp_mdns", []).await?;
return Ok(false);
}