CardDAV: Added 'card is ham' test

This commit is contained in:
mdecimus
2025-09-30 10:54:01 +02:00
parent 93a8265b98
commit d00d3dd013
3 changed files with 75 additions and 9 deletions

View File

@@ -668,9 +668,20 @@ impl<T: SessionStream> Session<T> {
// Queue message
let source = if !self.is_authenticated() {
MessageSource::Unauthenticated(
dmarc_result.is_some_and(|result| result == DmarcResult::Pass),
)
let is_dmarc_authenticated =
dmarc_result.is_some_and(|result| result == DmarcResult::Pass);
#[cfg(feature = "test_mode")]
{
MessageSource::Unauthenticated(
is_dmarc_authenticated || message.message.return_path.starts_with("dmarc-"),
)
}
#[cfg(not(feature = "test_mode"))]
{
MessageSource::Unauthenticated(is_dmarc_authenticated)
}
} else {
MessageSource::Authenticated
};