Skip to content

v0.4.0

Choose a tag to compare

@rickknowles-hikari rickknowles-hikari released this 21 Sep 13:42
· 59 commits to main since this release

v0.4.0

A feature release: header_rewrites, a per-route regex replacement over one
named header's value. Nothing else changes: a configuration that does not use it
behaves exactly as on v0.3.2.

Why. A List-Unsubscribe carrying a per-message token —
<https://www.meddoc.net/unsub.cfm?13323193_418550_3_9011119906_90535> — could
not be pointed at the link proxy. set_headers can only assign a template, and
body_rewrites only reaches text/* parts, so the body links went through the
proxy while the header, and a mailbox provider's one-click unsubscribe, did not.

identity:
  header_rewrites:
    - header: List-Unsubscribe
      pattern: '<https://www\.meddoc\.net/'
      replacement: '<https://link-pmps.healthcarematch.com/'
  • Order: remove_headers, then header_rewrites, then set_headers, so an
    explicit set_headers value still wins. Templates still read the message as
    it arrived.
  • Matched on the decoded value: folded lines are unfolded and RFC 2047
    encoded-words decoded before any pattern runs. A header no rule changes
    leaves byte for byte as it arrived.
  • Refused at startup: a rewrite of From, Sender or Message-ID (use
    set_headers); rules that change their own output (not overridable by
    unstable_headers); replacement text that could not form a valid header; and
    a reference to a capture group the pattern does not have — including the
    $1a trap, which the error explains.
  • New metric: simmer_header_rewrite_skipped_total{route,header,reason},
    for a header that could not be rewritten and went out unchanged — an unknown
    charset, a broken encoded-word, raw 8-bit bytes, or a result too long to
    fold. Worth alerting on if you rely on a rewrite.

Now in the specification. SPEC.md is amended for it: §4.1's example, three
§4.2 startup rules, §6.1 step 5a, §6.2 (the mechanism, its order and how it meets
§1.1's cutover invariant), §6.6 and §9.1. DECISIONS.md D-089 records the
reasoning, and open question O-16 is settled.

Images, built from 51da15b3f9f4cb617c02e77e1dcbe049d437b15d:

  • Postgres: hikarisystems/simmer:v0.4.0 (linux/amd64, linux/arm64)
  • SQL Server: hikarisystems/simmer:v0.4.0-mssql (linux/amd64)

Full Changelog: v0.3.2...v0.4.0