Skip to content

feat(roles/postfix): add recipient_canonicals to rewrite recipient addresses (fix #185)#294

Merged
markuslf merged 1 commit into
mainfrom
feat/postfix-recipient-canonicals
Jul 12, 2026
Merged

feat(roles/postfix): add recipient_canonicals to rewrite recipient addresses (fix #185)#294
markuslf merged 1 commit into
mainfrom
feat/postfix-recipient-canonicals

Conversation

@markuslf

Copy link
Copy Markdown
Member

Mirrors the existing sender_canonicals machinery for recipient address rewriting via Postfix recipient_canonical_maps.

Changes

  • defaults/main.yml: postfix__recipient_canonicals__{role,dependent,group,host,combined}_var slots
  • tasks/main.yml: deploy /etc/postfix/recipient_canonical
  • handlers/main.yml: postmap handler chained to reload
  • templates/etc/postfix/recipient_canonical.j2: new (copy of canonical.j2)
  • {RedHat,Debian}-main.cf.j2: recipient_canonical_maps line (alphabetically before sender_canonical_maps)
  • README.md: variable docs + example
  • Molecule setup_basic: inventory vars + runtime verification via postconf -h and postmap -q (no file grep)

Verification

  • No manual recipient_canonical usage found in downstream inventories, so nothing to migrate.
  • Postfix mechanics verified empirically: recipient_canonical_maps rewrites envelope and header recipient addresses, same table format/types as sender.

Known gaps

  • The postfix role has no meta/argument_specs.yml (unchanged here); adding a complete one is out of scope for this issue.

Closes #185

…dresses (fix #185)

Mirror the existing sender_canonicals machinery for recipient address
rewriting via Postfix recipient_canonical_maps. Adds the
postfix__recipient_canonicals__{role,dependent,group,host,combined}_var
slots, deploys /etc/postfix/recipient_canonical, wires
recipient_canonical_maps in both main.cf templates and adds a postmap
handler chained to reload.

Covered in the setup_basic Molecule scenario by asserting the effective
postconf value and the postmap -q rewrite result at runtime.
@markuslf markuslf enabled auto-merge July 12, 2026 17:05
@markuslf markuslf merged commit b366e97 into main Jul 12, 2026
11 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.

role:postfix: add postfix__recipient_canonicals variable

1 participant