Felix created JAMES-4229:
----------------------------

             Summary: WebAPI for DomainMapping mixes domain mappings and domain 
alias mappings
                 Key: JAMES-4229
                 URL: https://issues.apache.org/jira/browse/JAMES-4229
             Project: James Server
          Issue Type: Bug
            Reporter: Felix


The RRT has two types of domain mappings defined in 
server/data/data-api/src/main/java/org/apache/james/rrt/lib/Mapping.java. There 
is the `Type.DomainAlias` and the `Type.Domain`.

The web API offers the route `/domainMappings` to edit these mappings 
(https://james.apache.org/server/manage-webadmin.html#Creating_domain_mappings).
>From the name and description, I would guess that the API creates 
>`Type.Domain`.

However, the API actually uses a wild mix of the two types:

- PUT calls `recipientRewriteTable.addDomainAliasMapping`: It creates a new 
`Type.DomainAlias`.
- DELETE calls `recipientRewriteTable.removeDomainMapping`: It removes an 
existing `Type.Domain` and can therefore not remove mappings created with PUT.
- GET (all) filters mappings for `Type.Domain`, so it can not list mappings 
created with PUT.
- GET (specific source) filters mappings for `Type.Domain`, so it can not list 
mappings created with PUT.

I would assume that the usage of `Type.DomainAlias` in the PUT endpoint is a 
bug. If you see it the same way, I would offer to fix it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to