mirror of
https://github.com/chatmail/relay.git
synced 2026-08-20 23:40:53 +00:00
feat(logs): Log incoming mailer-daemon message sources (#191)
Logs mailer-daemon messages separately from other unencrypted mails. Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
committed by
missytake
parent
4f92a110b5
commit
f064b9ec2c
@@ -136,15 +136,16 @@ where
|
||||
return self.verify_origin(&transaction.envelope, &from_addr).await;
|
||||
}
|
||||
|
||||
log::info!("Incoming: Filtering unencrypted mail.");
|
||||
|
||||
// Allow cleartext mailer-daemon messages
|
||||
if let Some(auto_submitted) = message.headers.get_first_value("Auto-Submitted")
|
||||
&& !auto_submitted.is_empty()
|
||||
&& from_addr.to_lowercase().starts_with("mailer-daemon@")
|
||||
&& message.ctype.mimetype == "multipart/report"
|
||||
{
|
||||
log::info!("Incoming: Filtering mailer-daemon message from <{from_addr}>");
|
||||
return self.verify_origin(&transaction.envelope, &from_addr).await;
|
||||
} else {
|
||||
log::info!("Incoming: Filtering unencrypted mail.");
|
||||
}
|
||||
|
||||
for recipient in &transaction.envelope.rcpt_to {
|
||||
|
||||
Reference in New Issue
Block a user