mirror of
https://github.com/chatmail/relay.git
synced 2026-08-10 18:40:51 +00:00
feat: Log disabled recipients (#113)
Logs disabled recipient addresses when removing them from RCPT TO. Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
committed by
GitHub
parent
2450d1d9c7
commit
ec0413bd5f
@@ -101,7 +101,13 @@ impl SmtpHandler for IncomingBeforeQueueHandler {
|
||||
envelope.rcpt_to = envelope
|
||||
.rcpt_to
|
||||
.iter()
|
||||
.filter(|s| !self.config.is_disabled(s))
|
||||
.filter(|s| {
|
||||
let disabled = self.config.is_disabled(s);
|
||||
if disabled {
|
||||
log::warn!("Disabled recipient: {s}; removing from RCPT TO");
|
||||
}
|
||||
!disabled
|
||||
})
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
|
||||
@@ -81,7 +81,13 @@ impl SmtpHandler for OutgoingBeforeQueueHandler {
|
||||
envelope.rcpt_to = envelope
|
||||
.rcpt_to
|
||||
.iter()
|
||||
.filter(|s| !self.config.is_disabled(s))
|
||||
.filter(|s| {
|
||||
let disabled = self.config.is_disabled(s);
|
||||
if disabled {
|
||||
log::warn!("Disabled recipient: {s}; removing from RCPT TO");
|
||||
}
|
||||
!disabled
|
||||
})
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user