feat(roles/postfix): add recipient_canonicals to rewrite recipient addresses (fix #185)#294
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirrors the existing
sender_canonicalsmachinery for recipient address rewriting via Postfixrecipient_canonical_maps.Changes
defaults/main.yml:postfix__recipient_canonicals__{role,dependent,group,host,combined}_varslotstasks/main.yml: deploy/etc/postfix/recipient_canonicalhandlers/main.yml:postmaphandler chained to reloadtemplates/etc/postfix/recipient_canonical.j2: new (copy ofcanonical.j2){RedHat,Debian}-main.cf.j2:recipient_canonical_mapsline (alphabetically beforesender_canonical_maps)README.md: variable docs + examplesetup_basic: inventory vars + runtime verification viapostconf -handpostmap -q(no file grep)Verification
recipient_canonicalusage found in downstream inventories, so nothing to migrate.recipient_canonical_mapsrewrites envelope and header recipient addresses, same table format/types as sender.Known gaps
postfixrole has nometa/argument_specs.yml(unchanged here); adding a complete one is out of scope for this issue.Closes #185