WIP: feat: add option to process unencrypted messages

This commit is contained in:
link2xt
2026-05-07 07:10:17 +02:00
parent 37abfa2c1c
commit f1652d4dd6
32 changed files with 1173 additions and 829 deletions

View File

@@ -368,6 +368,7 @@ pub(crate) fn validate_detached_signature<'a, 'b>(
#[cfg(test)]
mod tests {
use super::*;
use crate::config::Config;
use crate::receive_imf::receive_imf;
use crate::test_utils::TestContext;
@@ -402,6 +403,8 @@ mod tests {
assert!(get_attachment_mime(&mail).is_some());
let bob = TestContext::new_bob().await;
bob.set_config(Config::ProcessUnencrypted, Some("1"))
.await?;
receive_imf(&bob, attachment_mime, false).await?;
let msg = bob.get_last_msg().await;
// Subject should be prepended because the attachment doesn't have "Chat-Version".
@@ -416,6 +419,8 @@ mod tests {
// Desktop via MS Exchange (actually made with TB though).
let mixed_up_mime = include_bytes!("../test-data/message/mixed-up-long.eml");
let bob = TestContext::new_bob().await;
bob.set_config(Config::ProcessUnencrypted, Some("1"))
.await?;
receive_imf(&bob, mixed_up_mime, false).await?;
let msg = bob.get_last_msg().await;
assert!(!msg.get_text().is_empty());