MTA: Log when messages are rejected or discarded by the spam classifier.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ use std::{
|
||||
borrow::Cow,
|
||||
time::{Instant, SystemTime},
|
||||
};
|
||||
use trc::SmtpEvent;
|
||||
use trc::{SmtpEvent, SpamEvent};
|
||||
use utils::DomainPart;
|
||||
|
||||
impl<T: SessionStream> Session<T> {
|
||||
@@ -453,10 +453,24 @@ impl<T: SessionStream> Session<T> {
|
||||
}
|
||||
}
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user