Fix can_use_transactional_email field name mismatch and update SRS forwarding tests#470
Merged
jdelic merged 2 commits intofeature/separate-forward-relayfrom Mar 9, 2026
Conversation
Co-authored-by: jdelic <1956349+jdelic@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update tests for mailforwarder with new transactional email logic
Fix Mar 9, 2026
can_use_transactional_email field name mismatch and update SRS forwarding tests
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.
ForwarderServer._process_messagereferenceddomain.can_use_transactional_relay— a field that doesn't exist on theDomainmodel (the actual field iscan_use_transactional_email), silently disabling transactional relay routing. The SRS forwarding tests also broke when_rewrite_mailfromwas removed in favour of inlineself.srs.forward()calls.maildaemons/forwarder/server.pydomain.can_use_transactional_relay→domain.can_use_transactional_emailin both the runtime routing condition and the--transactional-relay-ipCLI help text.transactional_relayas a parameter/argument name is correct and unchanged — it names the SMTP relay, not the model field.mailauth/tests/test_mailforwarder_srs.pytest_rewrite_mailfrom_uses_static_sender_without_srs/test_rewrite_mailfrom_uses_srs_when_available(tested the removed_rewrite_mailfrommethod) with_process_message-level equivalents:test_process_message_uses_list_mailfrom_when_set—forward_to.new_mailfromis used directly as envelope sender when set.test_process_message_uses_srs_when_list_mailfrom_not_set— SRS rewrites the sender whennew_mailfromis empty.test_process_message_uses_rewritten_mailfrom_for_forwarding→ renamedtest_process_message_list_mailfrom_overrides_srs_when_set: add missingdomain=SimpleNamespace(name=...)on the alias (the current code callsalias.domain.name), remove mock of the deleted_rewrite_mailfrom, clarify that a non-emptynew_mailfromwins even when SRS is configured.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.