Repository navigation
Conversation
When the exact lookup returns one value equal to the normalized address and that address has a domain, the result is cleared and the local-part lookup still runs. Any other exact result is kept and applied once. A domain-less value such as postmaster stays on the exact path, so that echo is not joined with an empty domain. The envelope modifier reference describes this unchanged exact result, and a test expects cat@example.org to become dog@example.org when the full address maps to itself and cat maps to dog. Fixes foxcpp#734
This branch has not been deployed
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.
Why
A relative alias that maps only a local part, such as cat to dog, leaves the recipient unchanged, and the message is rejected because that user does not exist. The same alias works when both sides are full addresses. In the usual rewrite chain, the documented rule that should turn cat@example.net into dog@example.net has no effect.
Exact-address lookup is treated as final as soon as it returns any value, so the local-part lookup is skipped. An optional chain step echoes its lookup key when it has nothing to substitute, and that echo is a single value equal to the normalized address. The rewrite stops on that echo before the relative alias is read.
Summary
When the exact lookup returns one value equal to the normalized address and that address has a domain, the result is cleared and the local-part lookup still runs. Any other exact result is kept and applied once. A domain-less value such as postmaster stays on the exact path, so that echo is not joined with an empty domain. The envelope modifier reference describes this unchanged exact result, and a test expects cat@example.org to become dog@example.org when the full address maps to itself and cat maps to dog.
Testing
Go test ./internal/modify/... passed. Ran
go test ./...in a Linux container (golang:1.24) for the maddy change; it passed. The tests ininternal/modify/replace_addr_test.gofail without the fix in the maddy change (checked by reverting the source changes).Fixes #734