Skip to content

Commit

Permalink
Avoid sending reports for DMARC/delivery reports (closes #173)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Jul 6, 2024
1 parent be8f232 commit af89725
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/smtp/src/inbound/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ impl<T: SessionStream> Session<T> {
}

// Verify DMARC
let is_report = self.is_report();
let (dmarc_result, dmarc_policy) = match &self.data.spf_mail_from {
Some(spf_output) if dmarc.verify() => {
let dmarc_output = self
Expand Down Expand Up @@ -301,7 +302,7 @@ impl<T: SessionStream> Session<T> {
}

// Send DMARC report
if dmarc_output.requested_reports() {
if dmarc_output.requested_reports() && !is_report {
self.send_dmarc_report(
&auth_message,
&auth_results,
Expand Down Expand Up @@ -330,7 +331,7 @@ impl<T: SessionStream> Session<T> {
};

// Analyze reports
if self.is_report() {
if is_report {
self.core.analyze_report(raw_message.clone());
if !rc.analysis.forward {
self.data.messages_sent += 1;
Expand Down

0 comments on commit af89725

Please sign in to comment.