Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Move all encrypted messages to mvbox if MvboxMove is on
Before, only replies to chat messages were moved to the mvbox because we're removing Chat-Version
from outer headers, but there's no much sense in moving only replies and not moving original
messages and MDNs. Instead, move all encrypted messages. Users should be informed about this in UIs,
so if a user has another PGP-capable MUA, probably they should disable MvboxMove. Moreover, untying
this logic from References and In-Reply-To allows to remove them from outer headers too, the "Header
Protection for Cryptographically Protected Email" RFC even suggests such a behavior:
https://datatracker.ietf.org/doc/html/rfc9788#name-offering-more-ambitious-hea.
  • Loading branch information
iequidoo committed Nov 14, 2025
commit e95e40c94f006cf7a7a7681cead9cd0d44ba4304
12 changes: 1 addition & 11 deletions src/imap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2106,17 +2106,7 @@ async fn needs_move_to_mvbox(
// there may be a non-delta device that wants to handle it
return Ok(false);
}

if headers.get_header_value(HeaderDef::SecureJoin).is_some() {
Ok(true)
} else if let Some(parent) = get_prefetch_parent_message(context, headers).await? {
match parent.is_dc_message {
MessengerMessage::No => Ok(false),
MessengerMessage::Yes | MessengerMessage::Reply => Ok(true),
}
} else {
Ok(false)
}
Ok(headers.get_header_value(HeaderDef::SecureJoin).is_some() || is_encrypted(headers))
}

/// Try to get the folder meaning by the name of the folder only used if the server does not support XLIST.
Expand Down
4 changes: 2 additions & 2 deletions src/imap/imap_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const COMBINATIONS_ACCEPTED_CHAT: &[(&str, bool, bool, &str)] = &[
("INBOX", false, false, "INBOX"),
("INBOX", false, true, "INBOX"),
("INBOX", true, false, "INBOX"),
("INBOX", true, true, "INBOX"),
("INBOX", true, true, "DeltaChat"),
("Spam", false, false, "INBOX"),
("Spam", false, true, "INBOX"),
// Move unencrypted emails in accepted chats from Spam to INBOX, not 100% sure on this, we could
Expand All @@ -185,7 +185,7 @@ const COMBINATIONS_REQUEST: &[(&str, bool, bool, &str)] = &[
("INBOX", false, false, "INBOX"),
("INBOX", false, true, "INBOX"),
("INBOX", true, false, "INBOX"),
("INBOX", true, true, "INBOX"),
("INBOX", true, true, "DeltaChat"),
("Spam", false, false, "Spam"),
("Spam", false, true, "INBOX"),
("Spam", true, false, "Spam"),
Expand Down