From 8a1684d48823397309417ac0b35618cab178e175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jagoda=20Estera=20=C5=9Al=C4=85zak?= <128227338+j-g00da@users.noreply.github.com> Date: Mon, 23 Feb 2026 19:45:21 +0100 Subject: [PATCH] fix(smtp): Properly handle bounce messages (#63) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #58 Signed-off-by: Jagoda Ślązak --- filtermail/src/smtp_server.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/filtermail/src/smtp_server.rs b/filtermail/src/smtp_server.rs index 7efcccf2..ddb3d9fb 100644 --- a/filtermail/src/smtp_server.rs +++ b/filtermail/src/smtp_server.rs @@ -116,6 +116,11 @@ where .write_all(b"250-filtermail\r\n250-XFORWARD ADDR\r\n250 OK\r\n") .await?; writer.flush().await?; + } else if cmd.to_uppercase().starts_with("MAIL FROM:<>") { + // bounce message + envelope.mail_from = String::new(); + writer.write_all(b"250 OK\r\n").await?; + writer.flush().await?; } else if cmd.to_uppercase().starts_with("MAIL FROM:") { if let Some(from) = extract_address(cmd) { match handler.handle_mail(&from) {