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 <[email protected]> Authored: Wed Nov 9 16:49:39 2016 +0100 Committer: Benoit Tellier <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
