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 ro...@apache.org on 2017/01/11 09:26:07 UTC

[19/50] [abbrv] james-project git commit: MAILET-115 Remove abstract getRecipients implementation

MAILET-115 Remove abstract getRecipients implementation


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

Branch: refs/heads/master
Commit: 6136d99bbccf62526aa0928632d7d935e981c986
Parents: 3ed6770
Author: Antoine Duprat <ad...@apache.org>
Authored: Wed Nov 9 16:49:39 2016 +0100
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Wed Jan 11 10:03:29 2017 +0700

----------------------------------------------------------------------
 .../java/org/apache/james/transport/mailets/Resend.java | 12 ++++++++++++
 .../transport/mailets/redirect/AbstractRedirect.java    | 11 +----------
 2 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/6136d99b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/Resend.java
----------------------------------------------------------------------
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 a9ee36c..2a0d735 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
@@ -333,6 +333,18 @@ public class Resend extends AbstractRedirect {
     }
 
     @Override
+    protected List<MailAddress> getRecipients() throws MessagingException {
+          ImmutableList.Builder<MailAddress> builder = ImmutableList.builder();
+          List<MailAddress> mailAddresses = AddressExtractor.withContext(getMailetContext())
+                  .allowedSpecials(ImmutableList.of("postmaster", "sender", "from", "replyTo", "reversePath", "unaltered", "recipients", "to", "null"))
+                  .extract(getInitParameters().getRecipients());
+          for (MailAddress address : mailAddresses) {
+              builder.add(address);
+          }
+          return builder.build();
+      }
+
+    @Override
     protected MailAddress getReversePath(Mail originalMail) throws MessagingException {
         MailAddress reversePath = getReversePath();
         if (reversePath != null) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/6136d99b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/AbstractRedirect.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/AbstractRedirect.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/AbstractRedirect.java
index 760990f..ae7f5db 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/AbstractRedirect.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/AbstractRedirect.java
@@ -187,16 +187,7 @@ public abstract class AbstractRedirect extends GenericMailet {
      *         <code>SpecialAddress.RECIPIENTS</code> or <code>null</code> if
      *         missing
      */
-    protected List<MailAddress> getRecipients() throws MessagingException {
-        ImmutableList.Builder<MailAddress> builder = ImmutableList.builder();
-        List<MailAddress> mailAddresses = AddressExtractor.withContext(getMailetContext())
-                .allowedSpecials(ImmutableList.of("postmaster", "sender", "from", "replyTo", "reversePath", "unaltered", "recipients", "to", "null"))
-                .extract(getInitParameters().getRecipients());
-        for (MailAddress address : mailAddresses) {
-            builder.add(address);
-        }
-        return builder.build();
-    }
+    protected abstract List<MailAddress> getRecipients() throws MessagingException; 
 
     /**
      * Gets the <code>recipients</code> property, built dynamically using the


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