JAMES-2366 Ignore non-null user upon Domain mapping

This edge case is not tested, not exposed, and ignoring is safe.

Furthermore, it avoids switch cases, and allow the room for further refactorings


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/82371635
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/82371635
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/82371635

Branch: refs/heads/master
Commit: 8237163569406d5c40c89ce58f6513a23656593e
Parents: f7d515c
Author: benwa <btell...@linagora.com>
Authored: Fri Apr 6 10:08:43 2018 +0700
Committer: benwa <btell...@linagora.com>
Committed: Thu Apr 19 11:12:07 2018 +0700

----------------------------------------------------------------------
 .../apache/james/rrt/lib/AbstractRecipientRewriteTable.java    | 6 ------
 1 file changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/82371635/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
----------------------------------------------------------------------
diff --git 
a/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
 
b/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
index b5d1f4f..e624766 100644
--- 
a/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
+++ 
b/server/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
@@ -263,9 +263,6 @@ public abstract class AbstractRecipientRewriteTable 
implements RecipientRewriteT
         } else if (mappingType.equals(Type.Regex)) {
             addRegexMapping(user, domain, mappingSuffix);
         } else if (mappingType.equals(Type.Domain)) {
-            if (user != null) {
-                throw new RecipientRewriteTableException("User must be null 
for aliasDomain mappings");
-            }
             addAliasDomainMapping(domain, Domain.of(mappingSuffix));
         } else {
             addAddressMapping(user, domain, mappingSuffix);
@@ -286,9 +283,6 @@ public abstract class AbstractRecipientRewriteTable 
implements RecipientRewriteT
                 removeRegexMapping(user, domain, mappingSuffix);
                 break;
             case Domain:
-                if (user != null) {
-                    throw new RecipientRewriteTableException("User must be 
null for aliasDomain mappings");
-                }
                 removeAliasDomainMapping(domain, Domain.of(mappingSuffix));
                 break;
             case Address:


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to