Skip to content

opendmarc -V: show configure args, git hash, and clarify SPF backend - #372

Merged
thegushi merged 2 commits into
trusteddomainproject:developfrom
thegushi:feature/verbose-version
May 28, 2026
Merged

opendmarc -V: show configure args, git hash, and clarify SPF backend#372
thegushi merged 2 commits into
trusteddomainproject:developfrom
thegushi:feature/verbose-version

Conversation

@thegushi

@thegushi thegushi commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three related improvements to -V output, mirroring what was done in OpenDKIM (#366):

  • CONFIGURE_ARGS: ./configure arguments are now embedded via AC_DEFINE_UNQUOTED, so operators can see exactly how the binary was built.
  • Git hash in version string: configure.ac runs git describe --tags --dirty; if the result differs from PACKAGE_VERSION (i.e. the build is not an exact tagged release), it becomes DMARCF_VERSION. Tagged release builds and environments without git fall back to the plain version number. All five VERSION references in opendmarc.c replaced with DMARCF_VERSION.
  • SPF backend clarity: the redundant WITH_SPF + WITH_SPF2 optlist entries are merged into a single WITH_SPF (libspf2) or WITH_SPF (internal) string.

Example output (dev build with SPF + libspf2)

opendmarc: OpenDMARC Filter v1.4.2-5-gabcdef7
    SMFI_VERSION 0x1000002
    libmilter version 1.0.2
    Configured with:  '--with-spf' '--with-spf2-include=/usr/local/include/spf2' '--with-spf2-lib=/usr/local/lib'
    Active code options:
        WITH_SPF (libspf2)

Test plan

  • Build from a tagged commit: version string is plain 1.4.2
  • Build from an untagged commit: version string is 1.4.2-N-gHASH (or -dirty suffix if tree is modified)
  • Build without git in PATH: falls back to plain version number
  • Build without SPF: no SPF entry in active options, Configured with: reflects flags used
  • Build with --with-spf: shows WITH_SPF (internal)
  • Build with --with-spf --with-spf2-include=... --with-spf2-lib=...: shows WITH_SPF (libspf2)
  • CI passes

thegushi added 2 commits May 27, 2026 15:59
Add CONFIGURE_ARGS (captured by autoconf from $ac_configure_args) to
the -V output so operators can see exactly how the binary was built.

Also clarify the SPF option display: instead of two separate entries
(WITH_SPF and WITH_SPF2), emit a single entry that names the backend
in use - either "WITH_SPF (libspf2)" or "WITH_SPF (internal)".

Mirrors the pattern already used in OpenDKIM.
Three related improvements to -V output, mirroring what was done in
OpenDKIM:

- CONFIGURE_ARGS: embeds the arguments passed to ./configure in the
  -V output (via AC_DEFINE_UNQUOTED in configure.ac), so operators can
  see exactly how the binary was built.

- Git hash in version string: configure.ac now runs git describe
  --tags --dirty and, if the result differs from PACKAGE_VERSION (i.e.
  the build is not an exact tagged release), uses that as DMARCF_VERSION
  instead of the plain package version.  Tagged release builds and
  environments without git fall back to the plain version number.
  All five VERSION references in opendmarc.c replaced with DMARCF_VERSION.

- SPF backend clarity: the two separate WITH_SPF / WITH_SPF2 optlist
  entries are merged into a single "WITH_SPF (libspf2)" or
  "WITH_SPF (internal)" string.
@thegushi thegushi changed the title opendmarc -V: show configure args and clarify SPF backend opendmarc -V: show configure args, git hash, and clarify SPF backend May 27, 2026
@thegushi
thegushi merged commit 1da33bb into trusteddomainproject:develop May 28, 2026
1 check 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