You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rc...@apache.org on 2020/05/04 10:01:55 UTC

[james-project] 08/14: [Refactoring] replace a String[] API with a Set one in some Mailets

This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit ba70efe8a6e450ecf0887a4932ff5408a931684e
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Tue Apr 28 23:18:51 2020 +0200

    [Refactoring] replace a String[] API with a Set<String> one in some Mailets
---
 .../java/org/apache/mailet/base/GenericMailet.java | 42 +++++++---------------
 .../james/transport/mailets/AbstractSign.java      |  5 +--
 .../apache/james/transport/mailets/SMIMESign.java  |  9 +++--
 .../org/apache/james/transport/mailets/Sign.java   |  9 +++--
 .../apache/james/transport/mailets/ClamAVScan.java |  8 +++--
 .../org/apache/james/transport/mailets/Bounce.java |  8 +++--
 .../apache/james/transport/mailets/DSNBounce.java  |  6 ++--
 .../apache/james/transport/mailets/Forward.java    |  8 +++--
 .../james/transport/mailets/NotifyPostmaster.java  |  8 +++--
 .../james/transport/mailets/NotifySender.java      |  8 +++--
 .../apache/james/transport/mailets/Redirect.java   |  8 +++--
 .../org/apache/james/transport/mailets/Resend.java |  8 +++--
 .../transport/mailets/redirect/RedirectNotify.java |  3 +-
 13 files changed, 69 insertions(+), 61 deletions(-)

diff --git a/mailet/base/src/main/java/org/apache/mailet/base/GenericMailet.java b/mailet/base/src/main/java/org/apache/mailet/base/GenericMailet.java
index 70488b0..dbc167e 100644
--- a/mailet/base/src/main/java/org/apache/mailet/base/GenericMailet.java
+++ b/mailet/base/src/main/java/org/apache/mailet/base/GenericMailet.java
@@ -20,13 +20,11 @@
 
 package org.apache.mailet.base;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
+import static java.util.function.Predicate.not;
+
 import java.util.Iterator;
 import java.util.Optional;
+import java.util.Set;
 
 import javax.mail.MessagingException;
 
@@ -38,8 +36,10 @@ import org.apache.mailet.MailetContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.github.steveash.guavate.Guavate;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
+import com.google.common.collect.Streams;
 
 /**
  * GenericMailet makes writing mailets easier. It provides simple
@@ -290,34 +290,18 @@ public abstract class GenericMailet implements Mailet, MailetConfig {
     
     /**
      * Utility method: Checks if there are unallowed init parameters specified in the 
-     * configuration file against the String[] allowedInitParameters.
-     * @param allowedArray array of strings containing the allowed parameter names
+     * configuration file against the allowedInitParameters.
+     * @param allowed List of strings containing the allowed parameter names
      * @throws MessagingException if an unknown parameter name is found
      */
-    protected final void checkInitParameters(String[] allowedArray) throws MessagingException {
-        // if null then no check is requested
-        if (allowedArray == null) {
-            return;
-        }
-        
-        Collection<String> allowed = new HashSet<>();
-        Collection<String> bad = new ArrayList<>();
+    protected final void checkInitParameters(Set<String> allowed) throws MessagingException {
+        Set<String> bad = Streams.stream(getInitParameterNames())
+            .filter(not(allowed::contains))
+            .collect(Guavate.toImmutableSet());
 
-        Collections.addAll(allowed, allowedArray);
-        
-        Iterator<String> iterator = getInitParameterNames();
-        while (iterator.hasNext()) {
-            String parameter = iterator.next();
-            if (!allowed.contains(parameter)) {
-                bad.add(parameter);
-            }
-        }
-        
-        if (bad.size() > 0) {
-            throw new MessagingException("Unexpected init parameters found: " + Arrays.toString(bad.toArray()));
+        if (!bad.isEmpty()) {
+            throw new MessagingException("Unexpected init parameters found: " + bad);
         }
     }
 
 }
-
-
diff --git a/mailet/crypto/src/main/java/org/apache/james/transport/mailets/AbstractSign.java b/mailet/crypto/src/main/java/org/apache/james/transport/mailets/AbstractSign.java
index 6de0ef5..34a65d7 100644
--- a/mailet/crypto/src/main/java/org/apache/james/transport/mailets/AbstractSign.java
+++ b/mailet/crypto/src/main/java/org/apache/james/transport/mailets/AbstractSign.java
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.lang.reflect.Constructor;
 import java.util.Enumeration;
 import java.util.Optional;
+import java.util.Set;
 
 import javax.inject.Inject;
 import javax.mail.MessagingException;
@@ -161,9 +162,9 @@ public abstract class AbstractSign extends GenericMailet {
     
     /**
      * Gets the expected init parameters.
-     * @return An array containing the parameter names allowed for this mailet.
+     * @return A set containing the parameter names allowed for this mailet.
      */
-    protected abstract String[] getAllowedInitParameters();
+    protected abstract Set<String> getAllowedInitParameters();
     
     /* ******************************************************************** */
     /* ****************** Begin of setters and getters ******************** */
diff --git a/mailet/crypto/src/main/java/org/apache/james/transport/mailets/SMIMESign.java b/mailet/crypto/src/main/java/org/apache/james/transport/mailets/SMIMESign.java
index 4ac3061..5a2f8b5 100644
--- a/mailet/crypto/src/main/java/org/apache/james/transport/mailets/SMIMESign.java
+++ b/mailet/crypto/src/main/java/org/apache/james/transport/mailets/SMIMESign.java
@@ -22,6 +22,7 @@
 package org.apache.james.transport.mailets;
 
 import java.io.IOException;
+import java.util.Set;
 
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeBodyPart;
@@ -32,6 +33,8 @@ import org.apache.mailet.Mail;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableSet;
+
 /**
  * <p>Puts a <I>server-side</I> SMIME signature on a message.
  * It is a concrete subclass of {@link Sign}, with very few modifications to it,
@@ -68,8 +71,8 @@ public class SMIMESign extends Sign {
     }
     
     @Override
-    protected  String[] getAllowedInitParameters() {
-        return new String[]{
+    protected Set<String> getAllowedInitParameters() {
+        return ImmutableSet.of(
             "debug",
             "keyStoreFileName",
             "keyStorePassword",
@@ -80,7 +83,7 @@ public class SMIMESign extends Sign {
             "postmasterSigns",
             "rebuildFrom",
             "explanationText"
-        };
+        );
     }
     
     /* ******************************************************************** */
diff --git a/mailet/crypto/src/main/java/org/apache/james/transport/mailets/Sign.java b/mailet/crypto/src/main/java/org/apache/james/transport/mailets/Sign.java
index 1ea3f84..3f31bdc 100644
--- a/mailet/crypto/src/main/java/org/apache/james/transport/mailets/Sign.java
+++ b/mailet/crypto/src/main/java/org/apache/james/transport/mailets/Sign.java
@@ -22,6 +22,7 @@
 package org.apache.james.transport.mailets;
 
 import java.io.IOException;
+import java.util.Set;
 
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeBodyPart;
@@ -32,6 +33,8 @@ import org.apache.mailet.Mail;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableSet;
+
 /**
  * <p>Puts a <I>server-side</I> signature on a message.
  * It is a concrete subclass of {@link AbstractSign}, with very few modifications to it.</p>
@@ -74,8 +77,8 @@ public class Sign extends AbstractSign {
     }
     
     @Override
-    protected  String[] getAllowedInitParameters() {
-        return new String[]{
+    protected Set<String> getAllowedInitParameters() {
+        return ImmutableSet.of(
             "keyHolderClass",
             "debug",
             "keyStoreFileName",
@@ -87,7 +90,7 @@ public class Sign extends AbstractSign {
             "postmasterSigns",
             "rebuildFrom",
             "explanationText"
-        };
+        );
     }
     
     /* ******************************************************************** */
diff --git a/mailet/standard/src/main/java/org/apache/james/transport/mailets/ClamAVScan.java b/mailet/standard/src/main/java/org/apache/james/transport/mailets/ClamAVScan.java
index 007d468..9ad2565 100644
--- a/mailet/standard/src/main/java/org/apache/james/transport/mailets/ClamAVScan.java
+++ b/mailet/standard/src/main/java/org/apache/james/transport/mailets/ClamAVScan.java
@@ -50,6 +50,8 @@ import org.apache.mailet.base.RFC2822Headers;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableSet;
+
 
 /**
  * <P>Does an antivirus scan check using a ClamAV daemon (CLAMD)</P>
@@ -253,8 +255,8 @@ public class ClamAVScan extends GenericMailet {
     /**
      * Gets the expected init parameters.
      */
-    protected String[] getAllowedInitParameters() {
-        return new String[]{
+    protected Set<String> getAllowedInitParameters() {
+        return ImmutableSet.of(
                 //            "static",
                 "debug",
                 "host",
@@ -262,7 +264,7 @@ public class ClamAVScan extends GenericMailet {
                 "maxPings",
                 "pingIntervalMilli",
                 "streamBufferSize"
-        };
+        );
     }
 
     /**
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Bounce.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Bounce.java
index f2072d8..436d910 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Bounce.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Bounce.java
@@ -21,6 +21,7 @@ package org.apache.james.transport.mailets;
 
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 
 import javax.inject.Inject;
 import javax.mail.MessagingException;
@@ -47,6 +48,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * <p>
@@ -125,8 +127,8 @@ import com.google.common.collect.ImmutableList;
 public class Bounce extends GenericMailet implements RedirectNotify {
     private static final Logger LOGGER = LoggerFactory.getLogger(Bounce.class);
 
-    private static final String[] CONFIGURABLE_PARAMETERS = new String[] {
-            "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "notice", "sender", "sendingAddress", "prefix", "attachError" };
+    private static final ImmutableSet<String> CONFIGURABLE_PARAMETERS = ImmutableSet.of(
+            "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "notice", "sender", "sendingAddress", "prefix", "attachError");
     private static final List<MailAddress> RECIPIENTS = ImmutableList.of(SpecialAddress.REVERSE_PATH);
     private static final List<InternetAddress> TO = ImmutableList.of(SpecialAddress.REVERSE_PATH.toInternetAddress());
     private final DNSService dns;
@@ -147,7 +149,7 @@ public class Bounce extends GenericMailet implements RedirectNotify {
     }
 
     @Override
-    public String[] getAllowedInitParameters() {
+    public Set<String> getAllowedInitParameters() {
         return CONFIGURABLE_PARAMETERS;
     }
 
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/DSNBounce.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/DSNBounce.java
index 423da7b..6354d32 100755
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/DSNBounce.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/DSNBounce.java
@@ -28,6 +28,7 @@ import java.time.format.DateTimeFormatter;
 import java.util.Date;
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 import java.util.regex.Pattern;
 
 import javax.inject.Inject;
@@ -67,6 +68,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * <p>
@@ -111,7 +113,7 @@ import com.google.common.collect.ImmutableList;
 public class DSNBounce extends GenericMailet implements RedirectNotify {
     private static final Logger LOGGER = LoggerFactory.getLogger(DSNBounce.class);
 
-    private static final String[] CONFIGURABLE_PARAMETERS = new String[]{ "debug", "passThrough", "messageString", "attachment", "sender", "prefix" };
+    private static final ImmutableSet<String> CONFIGURABLE_PARAMETERS = ImmutableSet.of("debug", "passThrough", "messageString", "attachment", "sender", "prefix");
     private static final List<MailAddress> RECIPIENT_MAIL_ADDRESSES = ImmutableList.of(SpecialAddress.REVERSE_PATH);
     private static final List<InternetAddress> TO_INTERNET_ADDRESSES = ImmutableList.of(SpecialAddress.REVERSE_PATH.toInternetAddress());
 
@@ -165,7 +167,7 @@ public class DSNBounce extends GenericMailet implements RedirectNotify {
     }
 
     @Override
-    public String[] getAllowedInitParameters() {
+    public Set<String> getAllowedInitParameters() {
         return CONFIGURABLE_PARAMETERS;
     }
 
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Forward.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Forward.java
index 517a2ae..60b0a60 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Forward.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Forward.java
@@ -21,6 +21,7 @@ package org.apache.james.transport.mailets;
 
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 
 import javax.inject.Inject;
 import javax.mail.MessagingException;
@@ -47,6 +48,7 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * <p>
@@ -95,8 +97,8 @@ import com.google.common.collect.ImmutableList;
 public class Forward extends GenericMailet implements RedirectNotify {
     private static final Logger LOGGER = LoggerFactory.getLogger(Forward.class);
 
-    private static final String[] CONFIGURABLE_PARAMETERS = new String[] {
-            "debug", "passThrough", "fakeDomainCheck", "forwardto", "forwardTo" };
+    private static final ImmutableSet<String> CONFIGURABLE_PARAMETERS = ImmutableSet.of(
+            "debug", "passThrough", "fakeDomainCheck", "forwardto", "forwardTo");
     private static final List<String> ALLOWED_SPECIALS = ImmutableList.of(
             "postmaster", "sender", "from", "replyTo", "reversePath", "unaltered", "recipients", "to", "null");
     private final DNSService dns;
@@ -117,7 +119,7 @@ public class Forward extends GenericMailet implements RedirectNotify {
     }
 
     @Override
-    public String[] getAllowedInitParameters() {
+    public Set<String> getAllowedInitParameters() {
         return CONFIGURABLE_PARAMETERS;
     }
 
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/NotifyPostmaster.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/NotifyPostmaster.java
index ec6cdcf..58035e4 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/NotifyPostmaster.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/NotifyPostmaster.java
@@ -21,6 +21,7 @@ package org.apache.james.transport.mailets;
 
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 
 import javax.inject.Inject;
 import javax.mail.MessagingException;
@@ -49,6 +50,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * <p>
@@ -125,8 +127,8 @@ import com.google.common.collect.ImmutableList;
 public class NotifyPostmaster extends GenericMailet implements RedirectNotify {
     private static final Logger LOGGER = LoggerFactory.getLogger(NotifyPostmaster.class);
 
-    private static final String[] CONFIGURABLE_PARAMETERS = new String[]{
-            "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "notice", "sender", "sendingAddress", "prefix", "attachError", "to" };
+    private static final ImmutableSet<String> CONFIGURABLE_PARAMETERS = ImmutableSet.of(
+            "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "notice", "sender", "sendingAddress", "prefix", "attachError", "to");
     private static final List<String> ALLOWED_SPECIALS = ImmutableList.of("postmaster", "unaltered");
 
     private final DNSService dns;
@@ -154,7 +156,7 @@ public class NotifyPostmaster extends GenericMailet implements RedirectNotify {
     }
 
     @Override
-    public String[] getAllowedInitParameters() {
+    public Set<String> getAllowedInitParameters() {
         return CONFIGURABLE_PARAMETERS;
     }
 
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/NotifySender.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/NotifySender.java
index 6a9d22b..eae9b49 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/NotifySender.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/NotifySender.java
@@ -21,6 +21,7 @@ package org.apache.james.transport.mailets;
 
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 
 import javax.inject.Inject;
 import javax.mail.MessagingException;
@@ -49,6 +50,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * <p>
@@ -124,8 +126,8 @@ import com.google.common.collect.ImmutableList;
 public class NotifySender extends GenericMailet implements RedirectNotify {
     private static final Logger LOGGER = LoggerFactory.getLogger(NotifySender.class);
 
-    private static final String[] CONFIGURABLE_PARAMETERS = new String[]{
-            "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "notice", "sender", "sendingAddress", "prefix", "attachError", "to" };
+    private static final ImmutableSet<String> CONFIGURABLE_PARAMETERS = ImmutableSet.of(
+            "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "notice", "sender", "sendingAddress", "prefix", "attachError", "to");
     private static final List<MailAddress> RECIPIENT_MAIL_ADDRESSES = ImmutableList.of(SpecialAddress.SENDER);
     private static final List<String> ALLOWED_SPECIALS = ImmutableList.of("sender", "unaltered", "from");
 
@@ -154,7 +156,7 @@ public class NotifySender extends GenericMailet implements RedirectNotify {
     }
 
     @Override
-    public String[] getAllowedInitParameters() {
+    public Set<String> getAllowedInitParameters() {
         return CONFIGURABLE_PARAMETERS;
     }
 
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Redirect.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Redirect.java
index ae941e1..c4fd907 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Redirect.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Redirect.java
@@ -21,6 +21,7 @@ package org.apache.james.transport.mailets;
 
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 
 import javax.inject.Inject;
 import javax.mail.MessagingException;
@@ -48,6 +49,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * <p>
@@ -303,8 +305,8 @@ import com.google.common.collect.ImmutableList;
 public class Redirect extends GenericMailet implements RedirectNotify {
     private static final Logger LOGGER = LoggerFactory.getLogger(Redirect.class);
 
-    private static final String[] CONFIGURABLE_PARAMETERS = new String[] {
-            "static", "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "recipients", "to", "replyTo", "replyto", "reversePath", "sender", "subject", "prefix", "attachError", "isReply" };
+    private static final ImmutableSet<String> CONFIGURABLE_PARAMETERS = ImmutableSet.of(
+            "static", "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "recipients", "to", "replyTo", "replyto", "reversePath", "sender", "subject", "prefix", "attachError", "isReply");
     private static final List<String> ALLOWED_SPECIALS = ImmutableList.of(
             "postmaster", "sender", "from", "replyTo", "reversePath", "unaltered", "recipients", "to", "null");
     private final DNSService dns;
@@ -325,7 +327,7 @@ public class Redirect extends GenericMailet implements RedirectNotify {
     }
 
     @Override
-    public String[] getAllowedInitParameters() {
+    public Set<String> getAllowedInitParameters() {
         return CONFIGURABLE_PARAMETERS;
     }
 
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Resend.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Resend.java
index 1975c9a..1b13c81 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Resend.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Resend.java
@@ -21,6 +21,7 @@ package org.apache.james.transport.mailets;
 
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 
 import javax.inject.Inject;
 import javax.mail.MessagingException;
@@ -47,6 +48,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * <p>
@@ -298,8 +300,8 @@ import com.google.common.collect.ImmutableList;
 public class Resend extends GenericMailet implements RedirectNotify {
     private static final Logger LOGGER = LoggerFactory.getLogger(Resend.class);
 
-    private static final String[] CONFIGURABLE_PARAMETERS = new String[] {
-            "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "recipients", "to", "replyTo", "replyto", "reversePath", "sender", "subject", "prefix", "attachError", "isReply" };
+    private static final ImmutableSet<String> CONFIGURABLE_PARAMETERS = ImmutableSet.of(
+            "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "recipients", "to", "replyTo", "replyto", "reversePath", "sender", "subject", "prefix", "attachError", "isReply");
     private final DNSService dns;
 
     @Inject
@@ -318,7 +320,7 @@ public class Resend extends GenericMailet implements RedirectNotify {
     }
 
     @Override
-    public String[] getAllowedInitParameters() {
+    public Set<String> getAllowedInitParameters() {
         return CONFIGURABLE_PARAMETERS;
     }
 
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/RedirectNotify.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/RedirectNotify.java
index 0bf1d25..4089d88 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/RedirectNotify.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/RedirectNotify.java
@@ -21,6 +21,7 @@ package org.apache.james.transport.mailets.redirect;
 
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 
 import javax.mail.MessagingException;
 import javax.mail.internet.InternetAddress;
@@ -141,7 +142,7 @@ public interface RedirectNotify extends Mailet, MailetConfig {
 
     InitParameters getInitParameters();
 
-    String[] getAllowedInitParameters();
+    Set<String> getAllowedInitParameters();
 
     DNSService getDNSService();
 


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