Fix MTA: Process reports using original RCPT before rewriting.
This commit is contained in:
@@ -23,6 +23,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If
|
||||
- ACME:
|
||||
- Include apex domains when requesting certificates for subdomains.
|
||||
- Use the public suffix list to determine the zone name when no origin is provided.
|
||||
- MTA: Process reports using original `RCPT` before rewriting.
|
||||
|
||||
## [0.16.4] - 2026-05-05
|
||||
|
||||
|
||||
@@ -38,14 +38,20 @@ impl<T: AsyncWrite + AsyncRead + Unpin> Session<T> {
|
||||
pub fn is_report(&self) -> bool {
|
||||
for addr_match in &self.server.core.smtp.report.analysis.addresses {
|
||||
for addr in &self.data.rcpt_to {
|
||||
let rcpt_addr = addr
|
||||
.dsn_info
|
||||
.as_ref()
|
||||
.and_then(|v| v.strip_prefix("rfc822;"))
|
||||
.unwrap_or(&addr.address_lcase);
|
||||
|
||||
match addr_match {
|
||||
AddressMatch::StartsWith(prefix) if addr.address_lcase.starts_with(prefix) => {
|
||||
AddressMatch::StartsWith(prefix) if rcpt_addr.starts_with(prefix) => {
|
||||
return true;
|
||||
}
|
||||
AddressMatch::EndsWith(suffix) if addr.address_lcase.ends_with(suffix) => {
|
||||
AddressMatch::EndsWith(suffix) if rcpt_addr.ends_with(suffix) => {
|
||||
return true;
|
||||
}
|
||||
AddressMatch::Equals(value) if addr.address_lcase.eq(value) => return true,
|
||||
AddressMatch::Equals(value) if rcpt_addr.eq(value) => return true,
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user