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 fe...@apache.org on 2011/04/04 18:36:45 UTC

svn commit: r1088681 [7/10] - in /james/server/trunk: jpa/src/main/java/org/apache/james/domainlist/jpa/ jpa/src/main/java/org/apache/james/domainlist/jpa/model/ jpa/src/main/java/org/apache/james/user/jpa/ jpa/src/main/java/org/apache/james/user/jpa/m...

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/Redirect.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/Redirect.java?rev=1088681&r1=1088680&r2=1088681&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/Redirect.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/Redirect.java Mon Apr  4 16:36:42 2011
@@ -17,221 +17,227 @@
  * under the License.                                           *
  ****************************************************************/
 
-
-
 package org.apache.james.transport.mailets;
 
 import java.util.Collection;
 import java.util.HashSet;
 
-
 import javax.mail.MessagingException;
 import javax.mail.internet.InternetAddress;
 
 import org.apache.mailet.Mail;
 import org.apache.mailet.MailAddress;
 
-
 /**
- * <P>A mailet providing configurable redirection services.</P>
- * <P>Can produce listserver, forward and notify behaviour, with the original
- * message intact, attached, appended or left out altogether.</P>
- * <P>It differs from {@link Resend} because
- * (i) some defaults are different,
- * notably for the following parameters: <I>&lt;recipients&gt;</I>, <I>&lt;to&gt;</I>,
- * <I>&lt;reversePath&gt;</I> and <I>&lt;inline&gt;</I>;
- * (ii) because it allows the use of the <I>&lt;static&gt;</I> parameter;.<BR>
- * Use <CODE>Resend</CODE> if you need full control, <CODE>Redirect</CODE> if
- * the more automatic behaviour of some parameters is appropriate.</P>
- * <P>This built in functionality is controlled by the configuration as laid out below.
- * In the table please note that the parameters controlling message headers
- * accept the <B>&quot;unaltered&quot;</B> value, whose meaning is to keep the associated
- * header unchanged and, unless stated differently, corresponds to the assumed default
- * if the parameter is missing.</P>
- * <P>The configuration parameters are:</P>
- * <TABLE width="75%" border="1" cellspacing="2" cellpadding="2">
- * <TR valign=top>
- * <TD width="20%">&lt;recipients&gt;</TD>
- * <TD width="80%">
- * A comma delimited list of addresses for recipients of
- * this message; it will use the &quot;to&quot; list if not specified, and &quot;unaltered&quot;
- * if none of the lists is specified.<BR>
- * These addresses will only appear in the To: header if no &quot;to&quot; list is
- * supplied.<BR>
- * Such addresses can contain &quot;full names&quot;, like
- * <I>Mr. John D. Smith &lt;john.smith@xyz.com&gt;</I>.<BR>
- * The list can include constants &quot;sender&quot;, &quot;from&quot;, &quot;replyTo&quot;, &quot;postmaster&quot;, &quot;reversePath&quot;, &quot;recipients&quot;, &quot;to&quot;, &quot;null&quot; and &quot;unaltered&quot;;
- * &quot;replyTo&quot; uses the ReplyTo header if available, otherwise the
- * From header if available, otherwise the Sender header if available, otherwise the return-path;
- * &quot;from&quot; is made equivalent to &quot;sender&quot;, and &quot;to&quot; is made equivalent to &quot;recipients&quot;;
- * &quot;null&quot; is ignored.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;to&gt;</TD>
- * <TD width="80%">
- * A comma delimited list of addresses to appear in the To: header;
- * the email will be delivered to any of these addresses if it is also in the recipients
- * list.<BR>
- * The recipients list will be used if this list is not supplied;
- * if none of the lists is specified it will be &quot;unaltered&quot;.<BR>
- * Such addresses can contain &quot;full names&quot;, like
- * <I>Mr. John D. Smith &lt;john.smith@xyz.com&gt;</I>.<BR>
- * The list can include constants &quot;sender&quot;, &quot;from&quot;, &quot;replyTo&quot;, &quot;postmaster&quot;, &quot;reversePath&quot;, &quot;recipients&quot;, &quot;to&quot;, &quot;null&quot; and &quot;unaltered&quot;;
- * &quot;from&quot; uses the From header if available, otherwise the Sender header if available,
- * otherwise the return-path;
- * &quot;replyTo&quot; uses the ReplyTo header if available, otherwise the
- * From header if available, otherwise the Sender header if available, otherwise the return-path;
- * &quot;recipients&quot; is made equivalent to &quot;to&quot;;
- * if &quot;null&quot; is specified alone it will remove this header.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;sender&gt;</TD>
- * <TD width="80%">
- * A single email address to appear in the From: and Return-Path: headers and become the sender.<BR>
- * It can include constants &quot;sender&quot;, &quot;postmaster&quot; and &quot;unaltered&quot;;
- * &quot;sender&quot; is equivalent to &quot;unaltered&quot;.<BR>
- * Default: &quot;unaltered&quot;.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;message&gt;</TD>
- * <TD width="80%">
- * A text message to insert into the body of the email.<BR>
- * Default: no message is inserted.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;inline&gt;</TD>
- * <TD width="80%">
- * <P>One of the following items:</P>
- * <UL>
- * <LI>unaltered &nbsp;&nbsp;&nbsp;&nbsp;The original message is the new
- * message, for forwarding/aliasing</LI>
- * <LI>heads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The
- * headers of the original message are appended to the message</LI>
- * <LI>body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The
- * body of the original is appended to the new message</LI>
- * <LI>all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Both
- * headers and body are appended</LI>
- * <LI>none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Neither
- * body nor headers are appended</LI>
- * </UL>
- * Default: &quot;body&quot;.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;attachment&gt;</TD>
- * <TD width="80%">
- * <P>One of the following items:</P>
- * <UL>
- * <LI>heads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The headers of the original
- * are attached as text</LI>
- * <LI>body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The body of the original
- * is attached as text</LI>
- * <LI>all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Both
- * headers and body are attached as a single text file</LI>
- * <LI>none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nothing is attached</LI>
- * <LI>message &nbsp;The original message is attached as type message/rfc822,
- * this means that it can, in many cases, be opened, resent, fw'd, replied
- * to etc by email client software.</LI>
- * </UL>
- * Default: &quot;none&quot;.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;passThrough&gt;</TD>
- * <TD width="80%">
- * true or false, if true the original message continues in the
- * mailet processor after this mailet is finished. False causes the original
- * to be stopped.<BR>
- * Default: false.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;fakeDomainCheck&gt;</TD>
- * <TD width="80%">
- * true or false, if true will check if the sender domain is valid.<BR>
- * Default: true.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;attachError&gt;</TD>
- * <TD width="80%">
- * true or false, if true any error message available to the
- * mailet is appended to the message body (except in the case of inline ==
- * unaltered).<BR>
- * Default: false.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;replyTo&gt;</TD>
- * <TD width="80%">
- * A single email address to appear in the Reply-To: header.<BR>
- * It can include constants &quot;sender&quot;, &quot;postmaster&quot; &quot;null&quot; and &quot;unaltered&quot;;
- * if &quot;null&quot; is specified it will remove this header.<BR>
- * Default: &quot;unaltered&quot;.
- * </TD>
- * </TR>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;reversePath&gt;</TD>
- * <TD width="80%">
- * A single email address to appear in the Return-Path: header.<BR>
- * It can include constants &quot;sender&quot;, &quot;postmaster&quot; and &quot;null&quot;;
- * if &quot;null&quot; is specified then it will set it to <>, meaning &quot;null return path&quot;.<BR>
- * Notice: the &quot;unaltered&quot; value is <I>not allowed</I>.<BR>
- * Default: the value of the <I>&lt;sender&gt;</I> parameter, if set, otherwise remains unaltered.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;subject&gt;</TD>
- * <TD width="80%">
- * An optional string to use as the subject.<BR>
- * Default: keep the original message subject.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;prefix&gt;</TD>
- * <TD width="80%">
- * An optional subject prefix prepended to the original message
- * subject, or to a new subject specified with the <I>&lt;subject&gt;</I> parameter.<BR>
- * For example: <I>[Undeliverable mail]</I>.<BR>
- * Default: &quot;&quot;.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;isReply&gt;</TD>
- * <TD width="80%">
- * true or false, if true the IN_REPLY_TO header will be set to the
- * id of the current message.<BR>
- * Default: false.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;debug&gt;</TD>
- * <TD width="80%">
- * true or false.  If this is true it tells the mailet to write some debugging
- * information to the mailet log.<BR>
- * Default: false.
- * </TD>
- * </TR>
- * <TR valign=top>
- * <TD width="20%">&lt;static&gt;</TD>
- * <TD width="80%">
- * true or false.  If this is true it tells the mailet that it can
- * reuse all the initial parameters (to, from, etc) without re-calculating
- * their values.  This will boost performance where a redirect task
- * doesn't contain any dynamic values.  If this is false, it tells the
- * mailet to recalculate the values for each e-mail processed.<BR>
- * Default: false.
- * </TD>
- * </TR>
- * </TABLE>
- *
- * <P>Example:</P>
- * <PRE><CODE>
+ * <p>
+ * A mailet providing configurable redirection services.
+ * </p>
+ * <p>
+ * Can produce listserver, forward and notify behaviour, with the original
+ * message intact, attached, appended or left out altogether.
+ * </p>
+ * <p>
+ * It differs from {@link Resend} because (i) some defaults are different,
+ * notably for the following parameters: <i>&lt;recipients&gt;</i>,
+ * <i>&lt;to&gt;</i>, <i>&lt;reversePath&gt;</i> and <i>&lt;inline&gt;</i>; (ii)
+ * because it allows the use of the <i>&lt;static&gt;</i> parameter;.<br>
+ * Use <code>Resend</code> if you need full control, <code>Redirect</code> if
+ * the more automatic behaviour of some parameters is appropriate.
+ * </p>
+ * <p>
+ * This built in functionality is controlled by the configuration as laid out
+ * below. In the table please note that the parameters controlling message
+ * headers accept the <b>&quot;unaltered&quot;</b> value, whose meaning is to
+ * keep the associated header unchanged and, unless stated differently,
+ * corresponds to the assumed default if the parameter is missing.
+ * </p>
+ * <p>
+ * The configuration parameters are:
+ * </p>
+ * <table width="75%" border="1" cellspacing="2" cellpadding="2">
+ * <tr valign=top>
+ * <td width="20%">&lt;recipients&gt;</td>
+ * <td width="80%">
+ * A comma delimited list of addresses for recipients of this message; it will
+ * use the &quot;to&quot; list if not specified, and &quot;unaltered&quot; if
+ * none of the lists is specified.<br>
+ * These addresses will only appear in the To: header if no &quot;to&quot; list
+ * is supplied.<br>
+ * Such addresses can contain &quot;full names&quot;, like <i>Mr. John D. Smith
+ * &lt;john.smith@xyz.com&gt;</i>.<br>
+ * The list can include constants &quot;sender&quot;, &quot;from&quot;,
+ * &quot;replyTo&quot;, &quot;postmaster&quot;, &quot;reversePath&quot;,
+ * &quot;recipients&quot;, &quot;to&quot;, &quot;null&quot; and
+ * &quot;unaltered&quot;; &quot;replyTo&quot; uses the ReplyTo header if
+ * available, otherwise the From header if available, otherwise the Sender
+ * header if available, otherwise the return-path; &quot;from&quot; is made
+ * equivalent to &quot;sender&quot;, and &quot;to&quot; is made equivalent to
+ * &quot;recipients&quot;; &quot;null&quot; is ignored.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;to&gt;</td>
+ * <td width="80%">
+ * A comma delimited list of addresses to appear in the To: header; the email
+ * will be delivered to any of these addresses if it is also in the recipients
+ * list.<br>
+ * The recipients list will be used if this list is not supplied; if none of the
+ * lists is specified it will be &quot;unaltered&quot;.<br>
+ * Such addresses can contain &quot;full names&quot;, like <i>Mr. John D. Smith
+ * &lt;john.smith@xyz.com&gt;</i>.<br>
+ * The list can include constants &quot;sender&quot;, &quot;from&quot;,
+ * &quot;replyTo&quot;, &quot;postmaster&quot;, &quot;reversePath&quot;,
+ * &quot;recipients&quot;, &quot;to&quot;, &quot;null&quot; and
+ * &quot;unaltered&quot;; &quot;from&quot; uses the From header if available,
+ * otherwise the Sender header if available, otherwise the return-path;
+ * &quot;replyTo&quot; uses the ReplyTo header if available, otherwise the From
+ * header if available, otherwise the Sender header if available, otherwise the
+ * return-path; &quot;recipients&quot; is made equivalent to &quot;to&quot;; if
+ * &quot;null&quot; is specified alone it will remove this header.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;sender&gt;</td>
+ * <td width="80%">
+ * A single email address to appear in the From: and Return-Path: headers and
+ * become the sender.<br>
+ * It can include constants &quot;sender&quot;, &quot;postmaster&quot; and
+ * &quot;unaltered&quot;; &quot;sender&quot; is equivalent to
+ * &quot;unaltered&quot;.<br>
+ * Default: &quot;unaltered&quot;.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;message&gt;</td>
+ * <td width="80%">
+ * A text message to insert into the body of the email.<br>
+ * Default: no message is inserted.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;inline&gt;</td>
+ * <td width="80%">
+ * <p>
+ * One of the following items:
+ * </p>
+ * <ul>
+ * <li>unaltered &nbsp;&nbsp;&nbsp;&nbsp;The original message is the new
+ * message, for forwarding/aliasing</li>
+ * <li>heads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The
+ * headers of the original message are appended to the message</li>
+ * <li>body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The
+ * body of the original is appended to the new message</li>
+ * <li>
+ * all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
+ * ;&nbsp;&nbsp;&nbsp;Both headers and body are appended</li>
+ * <li>none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ * Neither body nor headers are appended</li>
+ * </ul>
+ * Default: &quot;body&quot;.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;attachment&gt;</td>
+ * <td width="80%">
+ * <p>
+ * One of the following items:
+ * </p>
+ * <ul>
+ * <li>heads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The headers of the original are
+ * attached as text</li>
+ * <li>body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The body of the original is
+ * attached as text</li>
+ * <li>all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Both
+ * headers and body are attached as a single text file</li>
+ * <li>none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nothing is attached</li>
+ * <li>message &nbsp;The original message is attached as type message/rfc822,
+ * this means that it can, in many cases, be opened, resent, fw'd, replied to
+ * etc by email client software.</li>
+ * </ul>
+ * Default: &quot;none&quot;.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;passThrough&gt;</td>
+ * <td width="80%">
+ * true or false, if true the original message continues in the mailet processor
+ * after this mailet is finished. False causes the original to be stopped.<br>
+ * Default: false.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;fakeDomainCheck&gt;</td>
+ * <td width="80%">
+ * true or false, if true will check if the sender domain is valid.<br>
+ * Default: true.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;attachError&gt;</td>
+ * <td width="80%">
+ * true or false, if true any error message available to the mailet is appended
+ * to the message body (except in the case of inline == unaltered).<br>
+ * Default: false.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;replyTo&gt;</td>
+ * <td width="80%">
+ * A single email address to appear in the Reply-To: header.<br>
+ * It can include constants &quot;sender&quot;, &quot;postmaster&quot;
+ * &quot;null&quot; and &quot;unaltered&quot;; if &quot;null&quot; is specified
+ * it will remove this header.<br>
+ * Default: &quot;unaltered&quot;.</td>
+ * </tr>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;reversePath&gt;</td>
+ * <td width="80%">
+ * A single email address to appear in the Return-Path: header.<br>
+ * It can include constants &quot;sender&quot;, &quot;postmaster&quot; and
+ * &quot;null&quot;; if &quot;null&quot; is specified then it will set it to <>,
+ * meaning &quot;null return path&quot;.<br>
+ * Notice: the &quot;unaltered&quot; value is <i>not allowed</i>.<br>
+ * Default: the value of the <i>&lt;sender&gt;</i> parameter, if set, otherwise
+ * remains unaltered.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;subject&gt;</td>
+ * <td width="80%">
+ * An optional string to use as the subject.<br>
+ * Default: keep the original message subject.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;prefix&gt;</td>
+ * <td width="80%">
+ * An optional subject prefix prepended to the original message subject, or to a
+ * new subject specified with the <i>&lt;subject&gt;</i> parameter.<br>
+ * For example: <i>[Undeliverable mail]</i>.<br>
+ * Default: &quot;&quot;.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;isReply&gt;</td>
+ * <td width="80%">
+ * true or false, if true the IN_REPLY_TO header will be set to the id of the
+ * current message.<br>
+ * Default: false.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;debug&gt;</td>
+ * <td width="80%">
+ * true or false. If this is true it tells the mailet to write some debugging
+ * information to the mailet log.<br>
+ * Default: false.</td>
+ * </tr>
+ * <tr valign=top>
+ * <td width="20%">&lt;static&gt;</td>
+ * <td width="80%">
+ * true or false. If this is true it tells the mailet that it can reuse all the
+ * initial parameters (to, from, etc) without re-calculating their values. This
+ * will boost performance where a redirect task doesn't contain any dynamic
+ * values. If this is false, it tells the mailet to recalculate the values for
+ * each e-mail processed.<br>
+ * Default: false.</td>
+ * </tr>
+ * </table>
+ * 
+ * <p>
+ * Example:
+ * </p>
+ * 
+ * <pre>
+ * <code>
  *  &lt;mailet match=&quot;RecipientIs=test@localhost&quot; class=&quot;Redirect&quot;&gt;
  *    &lt;recipients&gt;x@localhost, y@localhost, z@localhost&lt;/recipients&gt;
  *    &lt;to&gt;list@localhost&lt;/to&gt;
@@ -244,11 +250,15 @@ import org.apache.mailet.MailAddress;
  *    &lt;!-- note the xml:space="preserve" to preserve whitespace --&gt;
  *    &lt;static&gt;TRUE&lt;/static&gt;
  * &lt;/mailet&gt;
- * </CODE></PRE>
+ * </code>
+ * </pre>
  * 
- * <P>and:</P>
- *
- * <PRE><CODE>
+ * <p>
+ * and:
+ * </p>
+ * 
+ * <pre>
+ * <code>
  *  &lt;mailet match=&quot;All&quot; class=&quot;Redirect&quot;&gt;
  *    &lt;recipients&gt;x@localhost&lt;/recipients&gt;
  *    &lt;sender&gt;postmaster&lt;/sender&gt;
@@ -261,18 +271,19 @@ import org.apache.mailet.MailAddress;
  *    &lt;prefix&gt;[spam notification]&lt;/prefix&gt;
  *    &lt;static&gt;TRUE&lt;/static&gt;
  *  &lt;/mailet&gt;
- * </CODE></PRE>
- * <P><I>replyto</I> can be used instead of
- * <I>replyTo</I>; such name is kept for backward compatibility.</P>
- *
- * @version CVS $Revision$ $Date$
+ * </code>
+ * </pre>
+ * <p>
+ * <i>replyto</i> can be used instead of <i>replyTo</i>; such name is kept for
+ * backward compatibility.
+ * </p>
  */
 
 public class Redirect extends AbstractRedirect {
 
     /**
      * Returns a string describing this mailet.
-     *
+     * 
      * @return a string describing this mailet
      */
     public String getMailetInfo() {
@@ -280,61 +291,38 @@ public class Redirect extends AbstractRe
     }
 
     /** Gets the expected init parameters. */
-    protected  String[] getAllowedInitParameters() {
-        String[] allowedArray = {
-            "static",
-            "debug",
-            "passThrough",
-            "fakeDomainCheck",
-            "inline",
-            "attachment",
-            "message",
-            "recipients",
-            "to",
-            "replyTo",
-            "replyto",
-            "reversePath",
-            "sender",
-            "subject",
-            "prefix",
-            "attachError",
-            "isReply"
-        };
+    protected String[] getAllowedInitParameters() {
+        String[] allowedArray = { "static", "debug", "passThrough", "fakeDomainCheck", "inline", "attachment", "message", "recipients", "to", "replyTo", "replyto", "reversePath", "sender", "subject", "prefix", "attachError", "isReply" };
         return allowedArray;
     }
 
-    /* ******************************************************************** */
-    /* ****************** Begin of getX and setX methods ****************** */
-    /* ******************************************************************** */
-
     /**
-     * @return the <CODE>static</CODE> init parameter
-    */
+     * @return the <code>static</code> init parameter
+     */
     protected boolean isStatic() {
         return isStatic;
     }
 
     /**
-     * @return the <CODE>inline</CODE> init parameter
+     * @return the <code>inline</code> init parameter
      */
     protected int getInLineType() throws MessagingException {
-        return getTypeCode(getInitParameter("inline","body"));
+        return getTypeCode(getInitParameter("inline", "body"));
     }
 
     /**
-     * @return the <CODE>recipients</CODE> init parameter
-     * or the postmaster address
-     * or <CODE>SpecialAddress.SENDER</CODE>
-     * or <CODE>SpecialAddress.REVERSE_PATH</CODE>
-     * or <CODE>SpecialAddress.UNALTERED</CODE>
-     * or the <CODE>to</CODE> init parameter if missing
-     * or <CODE>null</CODE> if also the latter is missing
+     * @return the <code>recipients</code> init parameter or the postmaster
+     *         address or <code>SpecialAddress.SENDER</code> or
+     *         <code>SpecialAddress.REVERSE_PATH</code> or
+     *         <code>SpecialAddress.UNALTERED</code> or the <code>to</code> init
+     *         parameter if missing or <code>null</code> if also the latter is
+     *         missing
      */
     protected Collection<MailAddress> getRecipients() throws MessagingException {
         Collection<MailAddress> newRecipients = new HashSet<MailAddress>();
-        String addressList = getInitParameter("recipients",getInitParameter("to"));
-                                 
-        // if nothing was specified, return <CODE>null</CODE> meaning no change
+        String addressList = getInitParameter("recipients", getInitParameter("to"));
+
+        // if nothing was specified, return <code>null</code> meaning no change
         if (addressList == null) {
             return null;
         }
@@ -343,8 +331,7 @@ public class Redirect extends AbstractRe
             InternetAddress[] iaarray = InternetAddress.parse(addressList, false);
             for (int i = 0; i < iaarray.length; i++) {
                 String addressString = iaarray[i].getAddress();
-                MailAddress specialAddress = getSpecialAddress(addressString,
-                new String[] {"postmaster", "sender", "from", "replyTo", "reversePath", "unaltered", "recipients", "to", "null"});
+                MailAddress specialAddress = getSpecialAddress(addressString, new String[] { "postmaster", "sender", "from", "replyTo", "reversePath", "unaltered", "recipients", "to", "null" });
                 if (specialAddress != null) {
                     newRecipients.add(specialAddress);
                 } else {
@@ -362,17 +349,16 @@ public class Redirect extends AbstractRe
     }
 
     /**
-     * @return the <CODE>to</CODE> init parameter
-     * or the postmaster address
-     * or <CODE>SpecialAddress.SENDER</CODE>
-     * or <CODE>SpecialAddress.REVERSE_PATH</CODE>
-     * or <CODE>SpecialAddress.UNALTERED</CODE>
-     * or the <CODE>recipients</CODE> init parameter if missing
-     * or <CODE>null</CODE> if also the latter is missing
+     * @return the <code>to</code> init parameter or the postmaster address or
+     *         <code>SpecialAddress.SENDER</code> or
+     *         <code>SpecialAddress.REVERSE_PATH</code> or
+     *         <code>SpecialAddress.UNALTERED</code> or the
+     *         <code>recipients</code> init parameter if missing or
+     *         <code>null</code> if also the latter is missing
      */
     protected InternetAddress[] getTo() throws MessagingException {
         InternetAddress[] iaarray = null;
-        String addressList = getInitParameter("to",getInitParameter("recipients"));
+        String addressList = getInitParameter("to", getInitParameter("recipients"));
 
         // if nothing was specified, return null meaning no change
         if (addressList == null) {
@@ -381,10 +367,9 @@ public class Redirect extends AbstractRe
 
         try {
             iaarray = InternetAddress.parse(addressList, false);
-            for(int i = 0; i < iaarray.length; ++i) {
+            for (int i = 0; i < iaarray.length; ++i) {
                 String addressString = iaarray[i].getAddress();
-                MailAddress specialAddress = getSpecialAddress(addressString,
-                                                new String[] {"postmaster", "sender", "from", "replyTo", "reversePath", "unaltered", "recipients", "to", "null"});
+                MailAddress specialAddress = getSpecialAddress(addressString, new String[] { "postmaster", "sender", "from", "replyTo", "reversePath", "unaltered", "recipients", "to", "null" });
                 if (specialAddress != null) {
                     iaarray[i] = specialAddress.toInternetAddress();
                 }
@@ -400,24 +385,21 @@ public class Redirect extends AbstractRe
     }
 
     /**
-     * @return the <CODE>reversePath</CODE> init parameter 
-     * or the postmaster address
-     * or <CODE>SpecialAddress.SENDER</CODE>
-     * or <CODE>SpecialAddress.NULL</CODE>
-     * or <CODE>null</CODE> if missing
+     * @return the <code>reversePath</code> init parameter or the postmaster
+     *         address or <code>SpecialAddress.SENDER</code> or
+     *         <code>SpecialAddress.NULL</code> or <code>null</code> if missing
      */
     protected MailAddress getReversePath() throws MessagingException {
         String addressString = getInitParameter("reversePath");
-        if(addressString != null) {
-            MailAddress specialAddress = getSpecialAddress(addressString,
-                                            new String[] {"postmaster", "sender", "null"});
+        if (addressString != null) {
+            MailAddress specialAddress = getSpecialAddress(addressString, new String[] { "postmaster", "sender", "null" });
             if (specialAddress != null) {
                 return specialAddress;
             }
 
             try {
                 return new MailAddress(addressString);
-            } catch(Exception e) {
+            } catch (Exception e) {
                 throw new MessagingException("Exception thrown in getReversePath() parsing: " + addressString, e);
             }
         }
@@ -426,9 +408,9 @@ public class Redirect extends AbstractRe
     }
 
     /**
-     * @return {@link AbstractRedirect#getReversePath()};
-     * if null return {@link AbstractRedirect#getSender(Mail)},
-     * meaning the new requested sender if any
+     * @return {@link AbstractRedirect#getReversePath()}; if null return
+     *         {@link AbstractRedirect#getSender(Mail)}, meaning the new
+     *         requested sender if any
      */
     protected MailAddress getReversePath(Mail originalMail) throws MessagingException {
         MailAddress reversePath = super.getReversePath(originalMail);
@@ -438,8 +420,4 @@ public class Redirect extends AbstractRe
         return reversePath;
     }
 
-    /* ******************************************************************** */
-    /* ******************* End of getX and setX methods ******************* */
-    /* ******************************************************************** */
-
 }



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