Skip to content

fix: standardize X-Mailer, version string, and forensic relay tracing#429

Merged
thegushi merged 2 commits into
trusteddomainproject:developfrom
thegushi:fix/x-mailer-header-consistency
Jun 21, 2026
Merged

fix: standardize X-Mailer, version string, and forensic relay tracing#429
thegushi merged 2 commits into
trusteddomainproject:developfrom
thegushi:fix/x-mailer-header-consistency

Conversation

@thegushi

Copy link
Copy Markdown
Collaborator

Summary

  • The milter's AFRF failure-report path used User-Agent: %s/%s; opendmarc-reports already used X-Mailer: opendmarc-reports v<version> for aggregate reports. Both now use X-Mailer, the established email convention for identifying generating software.
  • opendmarc-reports' $version used the plain release version with no git-describe logic, while the milter's DMARCF_VERSION already runs git describe --tags --dirty at configure time. Identical dev builds reported different version strings depending on which program authored the report. configure.ac now AC_SUBSTs DMARCF_VERSION for use in opendmarc-reports.in.
  • opendmarc-reports --forensic relays the milter-composed message via Net::SMTP directly to the configured server, completely untouched -- unlike the direct sendmail -t path, which picks up a normal Received: header for free from the local MTA. There was previously no way to tell, from the message itself, whether a forensic report went out via the milter directly or was relayed through opendmarc-reports. A single Received: by <host> (opendmarc-reports v<version>) via forensic relay; <date> line is now prepended before sending, added before the message is archived via --archive-dir so the archived copy matches what was actually sent, and applied identically regardless of --verp (VERP only rewrites the SMTP envelope sender per recipient; it never touches message content, so this doesn't interact with it).

Test plan

  • Full make + make check: 0 warnings, 0 errors, all 11 test programs pass
  • Confirmed build-config.h's DMARCF_VERSION and the generated reports/opendmarc-reports's $version now resolve to the identical git-describe string on a dirty dev build
  • perl -c reports/opendmarc-reports: syntax OK
  • Manually verified the Received: line renders correctly ahead of a sample forensic message

thegushi added 2 commits June 20, 2026 22:13
opendmarc-reports already labels aggregate reports with
X-Mailer: opendmarc-reports v<version>. The milter's own AFRF
failure-report path used User-Agent instead, so the two report types
disagreed on which header identifies the generating software.
Standardize both on X-Mailer.
opendmarc-reports' $version used the plain release version with no
git-describe logic, while the milter's DMARCF_VERSION already includes
a dirty-build hash suffix; identical dev builds reported different
version strings depending on which program authored a report.
configure.ac now AC_SUBST's DMARCF_VERSION for use in opendmarc-reports.in.

Also: --forensic mode relays the milter-composed message via Net::SMTP
without ever picking up a Received: header, unlike the direct
sendmail -t path which gets one for free from the local MTA. Prepend a
single Received: line identifying the relay hop, added before
archiving so --archive-dir captures what was actually sent.
@thegushi thegushi merged commit 0d91505 into trusteddomainproject:develop Jun 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant