diff --git a/CHANGELOG.md b/CHANGELOG.md index a2e3405f..be4dbc9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If - Yandex Cloud DNS - DNS updater: Log DNS record types and values. - Sieve: Allow User Sieve scripts to access `orcpt`. +- MTA: Log when messages are rejected or discarded by the spam classifier. ## Changed - Bump JMAP File Storage to [draft-ietf-jmap-filenode-14](https://datatracker.ietf.org/doc/html/draft-ietf-jmap-filenode-14). @@ -85,6 +86,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If - Allow internal TLDs in e-mail addresses. - Websocket: Perform case insensitive matching during upgrade. - LDAP: Synchronize accounts when expanding mailing list recipients. +- Sieve: `replace` action adds an extra `From` header. ## [0.16.5] - 2026-05-11 diff --git a/crates/smtp/src/inbound/data.rs b/crates/smtp/src/inbound/data.rs index e9cc6c4b..15a9bdd5 100644 --- a/crates/smtp/src/inbound/data.rs +++ b/crates/smtp/src/inbound/data.rs @@ -44,7 +44,7 @@ use std::{ borrow::Cow, time::{Instant, SystemTime}, }; -use trc::SmtpEvent; +use trc::{SmtpEvent, SpamEvent}; use utils::DomainPart; impl Session { @@ -453,10 +453,24 @@ impl Session { } } SpamFilterAction::Discard => { + trc::event!( + Spam(SpamEvent::Classify), + SpanId = self.data.session_id, + Result = "discard", + Reason = "Message discarded due to excessive spam score.", + ); + self.data.messages_sent += 1; return (b"250 2.0.0 Message queued for delivery.\r\n"[..]).into(); } SpamFilterAction::Reject => { + trc::event!( + Spam(SpamEvent::Classify), + SpanId = self.data.session_id, + Result = "reject", + Reason = "Message rejected due to excessive spam score.", + ); + self.data.messages_sent += 1; return (b"550 5.7.1 Message rejected due to excessive spam score.\r\n"[..]) .into();