mirror of
https://github.com/chatmail/relay.git
synced 2026-09-12 10:23:14 +00:00
fix(logs): Log From address instead of envelope MAIL FROM. (#66)
Fixes #64 Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
committed by
GitHub
parent
52208c42b6
commit
e1841cb590
@@ -35,8 +35,6 @@ impl SmtpHandler for IncomingBeforeQueueHandler {
|
||||
}
|
||||
|
||||
async fn check_data(&self, envelope: &Envelope) -> Result<(), String> {
|
||||
log::debug!("Processing DATA message from {}", envelope.mail_from);
|
||||
|
||||
let message = match parse_mail(&envelope.data) {
|
||||
Ok(m) => m,
|
||||
Err(e) => return Err(format!("500 Failed to parse message: {}", e)),
|
||||
@@ -53,6 +51,8 @@ impl SmtpHandler for IncomingBeforeQueueHandler {
|
||||
return Err(format!("500 Invalid FROM header: {from_header}"));
|
||||
};
|
||||
|
||||
log::debug!("Processing DATA message from {from_addr}");
|
||||
|
||||
let from_domain = AddressDomain::from_str(&from_addr).map_err(|e| e.smtp_response())?;
|
||||
|
||||
match from_domain {
|
||||
@@ -108,7 +108,7 @@ impl SmtpHandler for IncomingBeforeQueueHandler {
|
||||
|
||||
for recipient in &envelope.rcpt_to {
|
||||
if !self.config.is_cleartext_ok(recipient) {
|
||||
log::warn!("Rejected unencrypted mail from: {}", envelope.mail_from);
|
||||
log::warn!("Rejected unencrypted mail from: {from_addr}");
|
||||
return Err(ENCRYPTION_NEEDED_523.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user