mirror of
https://github.com/chatmail/relay.git
synced 2026-08-10 10:30:51 +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
GitHub
parent
0fce0a2191
commit
7f14693b31
@@ -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