Description
This issue follows the user mailing list thread https://www.mail-archive.com/server-user@james.apache.org/msg15949.html
User Story:
When I send an email to James James rewrites the Recipient to a fixed address (WILCARD -> recipient@domain.com)
This need had been expressed by two distinct members of the community.
`MappingSource::wildcard` is the most straightforward way to implement this (a simple address would do the trick) but sadly MappingSource wildcard testing is not part of the AbstractRecipientRewriteTableTest test suite and thus is not supported.
// This is failing but it should not !!! @Test public void wildcardRewritesShouldBeResolvedForAnyInput() throws Exception { Mapping mappingForward = Mapping.address(ADDRESS); virtualUserTable.addMapping(MappingSource.wildCard(), mappingForward); assertThat(virtualUserTable.getResolvedMappings(USER, Domain.LOCALHOST)).containsOnly(mappingForward); }
What we should do:
- Testing for MappingSource.wildard within AbstractRecipientRewriteTableTest
- Support it for non-deprecated implementations - deprecated implementations can ignore this feature
- Integration tests :
- Using the CLI I can set up a wildcard address rewrite cf DataCommandsIntegrationTest
- Using webadmin I can set up a wildcard address/forward/group/alias/domain entry (cf unit tests + integration tests)