james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets AbstractNotify.java AbstractRedirect.java Bounce.java Forward.java NotifyPostmaster.java NotifySender.java Redirect.java
Date Sun, 15 Jun 2003 18:33:43 GMT
noel        2003/06/15 11:33:43

  Modified:    src/java/org/apache/james/transport/mailets Tag:
                        branch_2_1_fcs AbstractNotify.java
                        AbstractRedirect.java Bounce.java Forward.java
                        NotifyPostmaster.java NotifySender.java
                        Redirect.java
  Log:
  1) The sender domain check now is optional, controlled by <fakeDomainCheck>, that
defaults to true.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.4   +58 -13    jakarta-james/src/java/org/apache/james/transport/mailets/AbstractNotify.java
  
  Index: AbstractNotify.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/AbstractNotify.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- AbstractNotify.java	6 Jun 2003 23:55:04 -0000	1.1.2.3
  +++ AbstractNotify.java	15 Jun 2003 18:33:42 -0000	1.1.2.4
  @@ -96,7 +96,7 @@
    * is set to true, such error message will be attached to the notification message.</LI>
    * <LI>The notified messages are attached in their entirety (headers and
    * content) and the resulting MIME part type is "message/rfc822".</LI>
  - * <LI>passThrough is <B>true</B>.</LI>
  + * <LI>Supports by default the <CODE>passThrough</CODE> init parameter
(true if missing).</LI>
    * </UL>
    *
    * <P>Sample configuration common to all notification mailet subclasses:</P>
  @@ -105,9 +105,19 @@
    *   &lt;sendingAddress&gt;<I>an address or postmaster</I>&lt;/sendingAddress&gt;
    *   &lt;attachStackTrace&gt;<I>true or false, default=false</I>&lt;/attachStackTrace&gt;
    *   &lt;notice&gt;<I>notice attached to the message (optional)</I>&lt;/notice&gt;
  + *   &lt;prefix&gt;<I>optional subject prefix prepended to the original message</I>&lt;/prefix&gt;
  + *   &lt;inline&gt;<I>see {@link Redirect}, default=none</I>&lt;/inline&gt;
  + *   &lt;attachment&gt;<I>see {@link Redirect}, default=message</I>&lt;/attachment&gt;
  + *   &lt;passThrough&gt;<I>true or false, default=true</I>&lt;/passThrough&gt;
  + *   &lt;fakeDomainCheck&gt;<I>true or false, default=true</I>&lt;/fakeDomainCheck&gt;
    * &lt;/mailet&gt;
    * </CODE></PRE>
  + * <I>message</I> and <I>attachError</I> can be used instead of
  + * <I>notice and </I> and <I>attachStackTrace</I>.
    *
  + * <P>CVS $Id$</P>
  + * @version 2.2.0
  + * @since 2.2.0
    */
   public abstract class AbstractNotify extends AbstractRedirect {
   
  @@ -116,32 +126,49 @@
       /* ******************************************************************** */
   
       /**
  -     * @return true, as all notifications should
  +     * @return the <CODE>passThrough</CODE> init parameter, or true if missing
        */
       protected boolean getPassThrough() throws MessagingException {
  -        return true;
  +        if(getInitParameter("passThrough") == null) {
  +            return true;
  +        } else {
  +            return new Boolean(getInitParameter("passThrough")).booleanValue();
  +        }
       }
   
       /**
  -     * @return <CODE>NONE</CODE>
  +     * @return the <CODE>inline</CODE> init parameter, or <CODE>NONE</CODE>
if missing
        */
  -    protected int getInLineType() {
  -        return NONE;
  +    protected int getInLineType() throws MessagingException {
  +        if(getInitParameter("inline") == null) {
  +            return NONE;
  +        } else {
  +            return getTypeCode(getInitParameter("inline"));
  +        }
       }
   
       /**
  -     * @return <CODE>MESSAGE</CODE>
  +     * @return the <CODE>attachment</CODE> init parameter, or <CODE>MESSAGE</CODE>
if missing
        */
  -    protected int getAttachmentType() {
  -        return MESSAGE;
  +    protected int getAttachmentType() throws MessagingException {
  +        if(getInitParameter("attachment") == null) {
  +            return MESSAGE;
  +        } else {
  +            return getTypeCode(getInitParameter("attachment"));
  +        }
       }
   
       /**
  -     * @return the <CODE>notice</CODE> init parameter
  +     * @return the <CODE>notice</CODE> init parameter, or the <CODE>message</CODE>
init parameter if missing,
  +     * or a default string if both are missing
        */
       protected String getMessage() {
           if(getInitParameter("notice") == null) {
  -            return "We were unable to deliver the attached message because of an error
in the mail server.";
  +            if(getInitParameter("message") == null) {
  +                return "We were unable to deliver the attached message because of an error
in the mail server.";
  +            } else {
  +                return getInitParameter("message");
  +            }
           } else {
               return getInitParameter("notice");
           }
  @@ -225,14 +252,32 @@
       }
   
       /**
  -     * @return the <CODE>attachStackTrace</CODE> init parameter
  +     * @return the <CODE>prefix</CODE> init parameter or an empty string if
missing
  +     */
  +    protected String getSubjectPrefix() throws MessagingException {
  +        if(getInitParameter("prefix") == null) {
  +            return "";
  +        } else {
  +            return getInitParameter("prefix");
  +        }
  +    }
  +
  +    /**
  +     * @return the <CODE>attachStackTrace</CODE> init parameter, 
  +     * or the <CODE>attachError</CODE> init parameter if missing,
  +     * or false if missing 
        */
       protected boolean attachError() {
           boolean attachStackTrace = false;
           try {
               attachStackTrace = new Boolean(getInitParameter("attachStackTrace")).booleanValue();
           } catch (Exception e) {
  -            // Ignore exception, default to false
  +            // try with attachError
  +            try {
  +                attachStackTrace = new Boolean(getInitParameter("attachError")).booleanValue();
  +            } catch (Exception e2) {
  +                // Ignore exception, default to false
  +            }
           }
           return attachStackTrace;
       }
  
  
  
  1.1.2.8   +74 -6     jakarta-james/src/java/org/apache/james/transport/mailets/AbstractRedirect.java
  
  Index: AbstractRedirect.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/AbstractRedirect.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- AbstractRedirect.java	8 Jun 2003 20:17:24 -0000	1.1.2.7
  +++ AbstractRedirect.java	15 Jun 2003 18:33:42 -0000	1.1.2.8
  @@ -107,6 +107,7 @@
    * <LI>getTo(), a list of people to whom the mail is *apparently* sent</LI>
    * <LI>isReply(), should this mailet set the IN_REPLY_TO header to the id of the
current message</LI>
    * <LI>getPassThrough(), should this mailet allow the original message to continue
processing or GHOST it.</LI>
  + * <LI>getFakeDomainCheck(), should this mailet check if the sender domain address
is valid.</LI>
    * <LI>isStatic(), should this mailet run the get methods for every mail, or just
once.</LI>
    * </UL>
    * <P>For each of the methods above (generically called "getX()" methods in this
class
  @@ -161,6 +162,9 @@
    * <P>Supports by default the <CODE>passThrough</CODE> init parameter
(false if missing).
    * Subclasses can override this behaviour overriding {@link #getPassThrough()}.</P>
    *
  + * <P>CVS $Id$</P>
  + * @version 2.2.0
  + * @since 2.2.0
    */
   
   public abstract class AbstractRedirect extends GenericMailet {
  @@ -229,6 +233,7 @@
       protected static final int MESSAGE          = 5;
   
       private boolean passThrough = false;
  +    private boolean fakeDomainCheck = true;
       private int attachmentType = NONE;
       private int inLineType = BODY;
       private String messageText;
  @@ -294,6 +299,33 @@
       }
   
       /**
  +     * Gets the <CODE>fakeDomainCheck</CODE> property.
  +     * Return true to check if the sender domain is valid.
  +     * Is a "getX()" method.
  +     *
  +     * @return the <CODE>fakeDomainCheck</CODE> init parameter, or true if
missing
  +     */
  +    protected boolean getFakeDomainCheck() throws MessagingException {
  +        if(getInitParameter("fakeDomainCheck") == null) {
  +            return true;
  +        } else {
  +            return new Boolean(getInitParameter("fakeDomainCheck")).booleanValue();
  +        }
  +    }
  +
  +    /**
  +     * Gets the <CODE>fakeDomainCheck</CODE> property,
  +     * built dynamically using the original Mail object.
  +     * Is a "getX(Mail)" method.
  +     *
  +     * @return {@link #getFakeDomainCheck()}
  +     */
  +    protected boolean getFakeDomainCheck(Mail originalMail) throws MessagingException {
  +        boolean fakeDomainCheck = (isStatic()) ? this.fakeDomainCheck : getFakeDomainCheck();
  +        return fakeDomainCheck;
  +    }
  +
  +    /**
        * Gets the <CODE>inline</CODE> property.
        * May return one of the following values to indicate how to append the original message
        * to build the new message:
  @@ -736,6 +768,7 @@
   
           if(isStatic()) {
               passThrough     = getPassThrough();
  +            fakeDomainCheck = getFakeDomainCheck();
               attachmentType  = getAttachmentType();
               inLineType      = getInLineType();
               messageText     = getMessage();
  @@ -752,11 +785,12 @@
                       new StringBuffer(1024)
                               .append("static")
                               .append(", passThrough=").append(passThrough)
  +                            .append(", fakeDomainCheck=").append(fakeDomainCheck)
                               .append(", sender=").append(sender)
                               .append(", replyTo=").append(replyTo)
                               .append(", returnPath=").append(returnPath)
                               .append(", message=").append(messageText)
  -                            .append(", recipients=").append(arrayToString(recipients.toArray()))
  +                            .append(", recipients=").append(arrayToString(recipients ==
null ? null : recipients.toArray()))
                               .append(", subjectPrefix=").append(subjectPrefix)
                               .append(", apparentlyTo=").append(arrayToString(apparentlyTo))
                               .append(", attachError=").append(attachError)
  @@ -807,7 +841,7 @@
           //Create the message
           if(getInLineType(originalMail) != UNALTERED) {
               if (isDebug) {
  -                log("Alter message inline=:" + getInLineType(originalMail));
  +                log("Alter message");
               }
               newMail.setMessage(new MimeMessage(Session.getDefaultInstance(System.getProperties(),
                                                                  null)));
  @@ -887,10 +921,32 @@
        * @param mail the mail to use as the basis for the new mail name
        * @return a new name
        */
  -    private String newName(MailImpl mail) {
  +    private String newName(MailImpl mail) throws MessagingException {
  +        String oldName = mail.getName();
  +        
  +        // Checking if the original mail name is too long, perhaps because of a
  +        // loop caused by a configuration error.
  +        // it could cause a "null pointer exception" in AvalonMailRepository much
  +        // harder to understand.
  +        if (oldName.length() > 76) {
  +            int count = 0;
  +            int index = 0;
  +            while ((index = oldName.indexOf('!', index)) >= 0) {
  +                count++;
  +            }
  +            // It looks like a configuration loop. It's better to stop.
  +            if (count > 7) {
  +                throw new MessagingException("Unable to create a new message name: too
long."
  +                                             + " Possible loop in config.xml.");
  +            }
  +            else {
  +                oldName = oldName.substring(0, 76);
  +            }
  +        }
  +        
           StringBuffer nameBuffer =
                                    new StringBuffer(64)
  -                                 .append(mail.getName())
  +                                 .append(oldName)
                                    .append("-!")
                                    .append(random.nextInt(1048576));
           return nameBuffer.toString();
  @@ -953,6 +1009,9 @@
        * Utility method for obtaining a string representation of an array of Objects.
        */
       private String arrayToString(Object[] array) {
  +        if (array == null) {
  +            return "null";
  +        }
           StringBuffer sb = new StringBuffer(1024);
           sb.append("[");
           for (int i = 0; i < array.length; i++) {
  @@ -1075,6 +1134,9 @@
               out.println(messageText);
           }
   
  +        if (isDebug) {
  +            log("inline:" + getInLineType(originalMail));
  +        }
           switch(getInLineType(originalMail)) {
               case ALL: //ALL:
                   all = true;
  @@ -1112,6 +1174,9 @@
               part.setText(sout.toString());
               part.setDisposition("inline");
               mpContent.addBodyPart(part);
  +            if (isDebug) {
  +                log("attachmentType:" + getAttachmentType(originalMail));
  +            }
               if(getAttachmentType(originalMail) != NONE) {
                   part = new MimeBodyPart();
                   switch(getAttachmentType(originalMail)) {
  @@ -1254,8 +1319,11 @@
        * Although this can be viewed as a configuration error, the
        * consequences of such a mis-configuration are severe enough
        * to warrant protecting against the infinite loop.</P>
  +     * <P>This check can be skipped if {@link #getFakeDomainCheck(Mail)} returns
true.</P> 
        */
  -    protected final boolean senderDomainIsValid(Mail mail) {
  -        return mail.getSender() == null || getMailetContext().getMailServers(mail.getSender().getHost()).size()
!= 0;
  +    protected final boolean senderDomainIsValid(Mail mail) throws MessagingException {
  +        if (getFakeDomainCheck(mail)) {
  +            return mail.getSender() == null || getMailetContext().getMailServers(mail.getSender().getHost()).size()
!= 0;
  +        } else return true;
       }
   }
  
  
  
  1.1.2.4   +15 -5     jakarta-james/src/java/org/apache/james/transport/mailets/Bounce.java
  
  Index: Bounce.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/Bounce.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- Bounce.java	6 Jun 2003 23:55:04 -0000	1.1.2.3
  +++ Bounce.java	15 Jun 2003 18:33:42 -0000	1.1.2.4
  @@ -98,14 +98,19 @@
    * If the notified message has an "error message" set, it will be inserted into the
    * notification inline text. If the <CODE>attachStackTrace</CODE> init parameter
    * is set to true, such error message will be attached to the notification message.<BR>
  - * <P>passThrough is <B>true</B>.</P>
  + * <P>Supports the <CODE>passThrough</CODE> init parameter (true if missing).</P>
    *
    * <P>Sample configuration:</P>
    * <PRE><CODE>
  - * &lt;mailet match="All" class="NotifyPostmaster">
  + * &lt;mailet match="All" class="Bounce">
    *   &lt;sendingAddress&gt;<I>an address or postmaster</I>&lt;/sendingAddress&gt;
    *   &lt;attachStackTrace&gt;<I>true or false, default=false</I>&lt;/attachStackTrace&gt;
    *   &lt;notice&gt;<I>notice attached to the message (optional)</I>&lt;/notice&gt;
  + *   &lt;prefix&gt;<I>optional subject prefix prepended to the original message</I>&lt;/prefix&gt;
  + *   &lt;inline&gt;<I>see {@link Redirect}, default=none</I>&lt;/inline&gt;
  + *   &lt;attachment&gt;<I>see {@link Redirect}, default=message</I>&lt;/attachment&gt;
  + *   &lt;passThrough&gt;<I>true or false, default=true</I>&lt;/passThrough&gt;
  + *   &lt;fakeDomainCheck&gt;<I>true or false, default=true</I>&lt;/fakeDomainCheck&gt;
    * &lt;/mailet&gt;
    * </CODE></PRE>
    *
  @@ -116,16 +121,21 @@
    *   &lt;sender&gt;<I>an address or postmaster</I>&lt;/sender&gt;
    *   &lt;attachError&gt;<I>true or false, default=false</I>&lt;/attachError&gt;
    *   &lt;message&gt;<I><B>dynamically built</B></I>&lt;/message&gt;
  - *   &lt;passThrough&gt;true&lt;/passThrough&gt;
  + *   &lt;prefix&gt;<I>a string</I>&lt;/prefix&gt;
  + *   &lt;passThrough&gt;true or false, default=true&lt;/passThrough&gt;
  + *   &lt;fakeDomainCheck&gt;<I>true or false, default=true</I>&lt;/fakeDomainCheck&gt;
    *   &lt;recipients&gt;<B>sender</B>&lt;/recipients&gt;
    *   &lt;returnPath&gt;null&lt;/returnPath&gt;
  - *   &lt;inline&gt;none&lt;/inline&gt;
  - *   &lt;attachment&gt;message&lt;/attachment&gt;
  + *   &lt;inline&gt;see {@link Redirect}, default=NONE&lt;/inline&gt;
  + *   &lt;attachment&gt;see {@link Redirect}, default=message&lt;/attachment&gt;
    *   &lt;isReply&gt;true&lt;/isReply&gt;
    *   &lt;static&gt;true&lt;/static&gt;
    * &lt;/mailet&gt;
    * </CODE></PRE>
    *
  + * <P>CVS $Id$</P>
  + * @version 2.2.0
  + * @since 2.2.0
    */
   public class Bounce extends AbstractNotify {
   
  
  
  
  1.6.4.5   +3 -0      jakarta-james/src/java/org/apache/james/transport/mailets/Forward.java
  
  Index: Forward.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/Forward.java,v
  retrieving revision 1.6.4.4
  retrieving revision 1.6.4.5
  diff -u -r1.6.4.4 -r1.6.4.5
  --- Forward.java	6 Jun 2003 23:55:04 -0000	1.6.4.4
  +++ Forward.java	15 Jun 2003 18:33:42 -0000	1.6.4.5
  @@ -83,11 +83,14 @@
    * <PRE><CODE>
    * &lt;mailet match="All" class="Redirect">
    *   &lt;passThrough&gt;true or false&lt;/passThrough&gt;
  + *   &lt;fakeDomainCheck&gt;<I>true or false, default=true</I>&lt;/fakeDomainCheck&gt;
    *   &lt;recipients&gt;comma delimited list of email addresses&lt;/recipients&gt;
    *   &lt;inline&gt;unaltered&lt;/inline&gt;
    * &lt;/mailet&gt;
    * </CODE></PRE>
    *
  + * <P>CVS $Id$</P>
  + * @version 2.2.0
    */
   public class Forward extends AbstractRedirect {
   
  
  
  
  1.9.4.6   +21 -8     jakarta-james/src/java/org/apache/james/transport/mailets/NotifyPostmaster.java
  
  Index: NotifyPostmaster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/NotifyPostmaster.java,v
  retrieving revision 1.9.4.5
  retrieving revision 1.9.4.6
  diff -u -r1.9.4.5 -r1.9.4.6
  --- NotifyPostmaster.java	6 Jun 2003 23:55:04 -0000	1.9.4.5
  +++ NotifyPostmaster.java	15 Jun 2003 18:33:42 -0000	1.9.4.6
  @@ -93,14 +93,19 @@
    * is set to true, such error message will be attached to the notification message.<BR>
    * The notified messages are attached in their entirety (headers and
    * content) and the resulting MIME part type is "message/rfc822".</P>
  - * <P>passThrough is <B>true</B>.</P>
  + * <P>Supports the <CODE>passThrough</CODE> init parameter (true if missing).</P>
    *
    * <P>Sample configuration:</P>
    * <PRE><CODE>
    * &lt;mailet match="All" class="NotifyPostmaster">
  - *   &lt;sendingAddress&gt;<I>an address or postmaster or sender, default=postmaster</I>&lt;/sendingAddress&gt;
  + *   &lt;sendingAddress&gt;<I>an address or postmaster</I>&lt;/sendingAddress&gt;
    *   &lt;attachStackTrace&gt;<I>true or false, default=false</I>&lt;/attachStackTrace&gt;
    *   &lt;notice&gt;<I>notice attached to the message (optional)</I>&lt;/notice&gt;
  + *   &lt;prefix&gt;<I>optional subject prefix prepended to the original message,
default="Re:"</I>&lt;/prefix&gt;
  + *   &lt;inline&gt;<I>see {@link Redirect}, default=none</I>&lt;/inline&gt;
  + *   &lt;attachment&gt;<I>see {@link Redirect}, default=message</I>&lt;/attachment&gt;
  + *   &lt;passThrough&gt;<I>true or false, default=true</I>&lt;/passThrough&gt;
  + *   &lt;fakeDomainCheck&gt;<I>true or false, default=true</I>&lt;/fakeDomainCheck&gt;
    *   &lt;to&gt;<I>unaltered (optional, defaults to postmaster)</I>&lt;/to&gt;
    * &lt;/mailet&gt;
    * </CODE></PRE>
  @@ -112,16 +117,20 @@
    *   &lt;sender&gt;<I>an address or postmaster or sender, default=postmaster</I>&lt;/sender&gt;
    *   &lt;attachError&gt;<I>true or false, default=false</I>&lt;/attachError&gt;
    *   &lt;message&gt;<I><B>dynamically built</B></I>&lt;/message&gt;
  - *   &lt;passThrough&gt;true&lt;/passThrough&gt;
  - *   &lt;to&gt;<I>unaltered or postmaster&lt</I>;/to&gt;
  + *   &lt;prefix&gt;<I>a string</I>&lt;/prefix&gt;
  + *   &lt;passThrough&gt;<I>true or false, default=true</I>&lt;/passThrough&gt;
  + *   &lt;fakeDomainCheck&gt;<I>true or false, default=true</I>&lt;/fakeDomainCheck&gt;
  + *   &lt;to&gt;<I><B>unaltered or postmaster</B></I>&lt;/to&gt;
    *   &lt;recipients&gt;<B>postmaster</B>&lt;/recipients&gt;
  - *   &lt;inline&gt;none&lt;/inline&gt;
  - *   &lt;attachment&gt;message&lt;/attachment&gt;
  + *   &lt;inline&gt;see {@link Redirect}, default=none&lt;/inline&gt;
  + *   &lt;attachment&gt;see {@link Redirect}, default=message&lt;/attachment&gt;
    *   &lt;isReply&gt;true&lt;/isReply&gt;
    *   &lt;static&gt;true&lt;/static&gt;
    * &lt;/mailet&gt;
    * </CODE></PRE>
    *
  + * <P>CVS $Id$</P>
  + * @version 2.2.0
    */
   public class NotifyPostmaster extends AbstractNotify {
   
  @@ -166,10 +175,14 @@
       }
   
       /**
  -     * @return "Re:"
  +     * @return the <CODE>prefix</CODE> init parameter or "Re:" if missing
        */
       protected String getSubjectPrefix() {
  -        return "Re:";
  +        if(getInitParameter("prefix") == null) {
  +            return "Re:";
  +        } else {
  +            return getInitParameter("prefix");
  +        }
       }
   
       /**
  
  
  
  1.10.4.7  +10 -1     jakarta-james/src/java/org/apache/james/transport/mailets/NotifySender.java
  
  Index: NotifySender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/NotifySender.java,v
  retrieving revision 1.10.4.6
  retrieving revision 1.10.4.7
  diff -u -r1.10.4.6 -r1.10.4.7
  --- NotifySender.java	6 Jun 2003 23:55:04 -0000	1.10.4.6
  +++ NotifySender.java	15 Jun 2003 18:33:42 -0000	1.10.4.7
  @@ -93,7 +93,7 @@
    * is set to true, such error message will be attached to the notification message.<BR>
    * The notified messages are attached in their entirety (headers and
    * content) and the resulting MIME part type is "message/rfc822".</P>
  - * <P>passThrough is <B>true</B>.</P>
  + * <P>Supports the <CODE>passThrough</CODE> init parameter (true if missing).</P>
    *
    * <P>Sample configuration:</P>
    * <PRE><CODE>
  @@ -101,6 +101,11 @@
    *   &lt;sendingAddress&gt;<I>an address or postmaster</I>&lt;/sendingAddress&gt;
    *   &lt;attachStackTrace&gt;<I>true or false, default=false</I>&lt;/attachStackTrace&gt;
    *   &lt;notice&gt;<I>notice attached to the message (optional)</I>&lt;/notice&gt;
  + *   &lt;prefix&gt;<I>optional subject prefix prepended to the original message</I>&lt;/prefix&gt;
  + *   &lt;inline&gt;<I>see {@link Redirect}, default=none</I>&lt;/inline&gt;
  + *   &lt;attachment&gt;<I>see {@link Redirect}, default=message</I>&lt;/attachment&gt;
  + *   &lt;passThrough&gt;<I>true or false, default=true</I>&lt;/passThrough&gt;
  + *   &lt;fakeDomainCheck&gt;<I>true or false, default=true</I>&lt;/fakeDomainCheck&gt;
    *   &lt;to&gt;<I>unaltered (optional, defaults to sender)</I>&lt;/to&gt;
    * &lt;/mailet&gt;
    * </CODE></PRE>
  @@ -112,7 +117,9 @@
    *   &lt;sender&gt;<I>an address or postmaster</I>&lt;/sender&gt;
    *   &lt;attachError&gt;<I>true or false, default=false</I>&lt;/attachError&gt;
    *   &lt;message&gt;<I><B>dynamically built</B></I>&lt;/message&gt;
  + *   &lt;prefix&gt;<I>a string</I>&lt;/prefix&gt;
    *   &lt;passThrough&gt;true&lt;/passThrough&gt;
  + *   &lt;fakeDomainCheck&gt;<I>true or false, default=true</I>&lt;/fakeDomainCheck&gt;
    *   &lt;to&gt;<I>unaltered or sender&lt</I>;/to&gt;
    *   &lt;recipients&gt;<B>sender</B>&lt;/recipients&gt;
    *   &lt;inline&gt;none&lt;/inline&gt;
  @@ -122,6 +129,8 @@
    * &lt;/mailet&gt;
    * </CODE></PRE>
    *
  + * <P>CVS $Id$</P>
  + * @version 2.2.0
    */
   public class NotifySender extends AbstractNotify {
   
  
  
  
  1.18.4.10 +149 -143  jakarta-james/src/java/org/apache/james/transport/mailets/Redirect.java
  
  Index: Redirect.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/Redirect.java,v
  retrieving revision 1.18.4.9
  retrieving revision 1.18.4.10
  diff -u -r1.18.4.9 -r1.18.4.10
  --- Redirect.java	6 Jun 2003 23:55:04 -0000	1.18.4.9
  +++ Redirect.java	15 Jun 2003 18:33:43 -0000	1.18.4.10
  @@ -87,151 +87,157 @@
   
   
   /**
  -*<P>A mailet providing configurable redirection services<BR>
  -*This mailet can produce listserver, forward and notify behaviour, with the original
  -*message intact, attached, appended or left out altogether.<BR>
  -*This built in functionality is controlled by the configuration as laid out below.</P>
  -*<P>The configuration parameters are:</P>
  -*<TABLE width="75%" border="0" cellspacing="2" cellpadding="2">
  -*<TR>
  -*<TD width="20%">&lt;recipients&gt;</TD>
  -*<TD width="80%">A comma delimited list of email addresses for recipients of
  -*this message, it will use the &quot;to&quot; list if not specified. These
  -*addresses will only appear in the To: header if no &quot;to&quot; list is
  -*supplied.<BR>
  -*It can include constants &quot;sender&quot;, &quot;postmaster&quot; and
&quot;returnPath&quot;</TD>
  -*</TR>
  -*<TR>
  -*<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 only be delivered to these addresses if they are in the recipients
  -*list.<BR>
  -*The recipients list will be used if this is not supplied.<BR>
  -*It can include constants &quot;sender&quot;, &quot;postmaster&quot;, &quot;returnPath&quot;
and &quot;unaltered&quot;</TD>
  -*</TR>
  -*<TR>
  -*<TD width="20%">&lt;sender&gt;</TD>
  -*<TD width="80%">A single email address to appear in the From: header <BR>
  -*It can include constants &quot;sender&quot; and &quot;postmaster&quot;</TD>
  -*</TR>
  -*<TR>
  -*<TD width="20%">&lt;message&gt;</TD>
  -*<TD width="80%">A text message to be the body of the email. Can be omitted.</TD>
  -*</TR>
  -*<TR>
  -*<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>
  -*</TD>
  -*</TR>
  -*<TR>
  -*<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>
  -*</TD>
  -*</TR>
  -*<TR>
  -*<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.</TD>
  -*</TR>
  -*<TR>
  -*<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)</TD>
  -*</TR>
  -*<TR>
  -*<TD width="20%">&lt;replyto&gt;</TD>
  -*<TD width="80%">A single email address to appear in the Reply-To: header, can
  -*also be &quot;sender&quot; or &quot;postmaster&quot;, this header is not
  -*set if this is omitted.</TD>
  -*</TR>
  -*<TR>
  -*<TD width="20%">&lt;returnPath&gt;</TD>
  -*<TD width="80%">A single email address to appear in the Return-Path: header, can
  -*also be &quot;sender&quot; or &quot;postmaster&quot; or &quot;null&quot;;
this header is not
  -*set if this parameter is omitted.</TD>
  -*</TR>
  -*<TR>
  -*<TD width="20%">&lt;prefix&gt;</TD>
  -*<TD width="80%">An optional subject prefix prepended to the original message
  -*subject, for example:<BR>
  -*Undeliverable mail: </TD>
  -*</TR>
  -*<TR>
  -*<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.</TD>
  -*</TR>
  -*<TR>
  -*<TD width="20%">&lt;static&gt;</TD>
  -*<TD width="80%">
  -*<P>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.</P>
  -*<P>This defaults to false.<BR>
  -*</TD>
  -*</TR>
  -*</TABLE>
  -*
  -*<P>Example:</P>
  -*<P> &lt;mailet match=&quot;RecipientIs=test@localhost&quot; class=&quot;Redirect&quot;&gt;<BR>
  -*&lt;recipients&gt;x@localhost, y@localhost, z@localhost&lt;/recipients&gt;<BR>
  -*&lt;to&gt;list@localhost&lt;/to&gt;<BR>
  -*&lt;sender&gt;owner@localhost&lt;/sender&gt;<BR>
  -*&lt;message&gt;sent on from James&lt;/message&gt;<BR>
  -*&lt;inline&gt;unaltered&lt;/inline&gt;<BR>
  -*&lt;passThrough&gt;FALSE&lt;/passThrough&gt;<BR>
  -*&lt;replyto&gt;postmaster&lt;/replyto&gt;<BR>
  -*&lt;prefix xml:space="preserve"&gt;[test mailing] &lt;/prefix&gt;<BR>
  -*&lt;!-- note the xml:space="preserve" to preserve whitespace --&gt;<BR>
  -*&lt;static&gt;TRUE&lt;/static&gt;<BR>
  -*&lt;/mailet&gt;<BR>
  -*</P>
  -*<P>and:</P>
  -*<P> &lt;mailet match=&quot;All&quot; class=&quot;Redirect&quot;&gt;<BR>
  -*&lt;recipients&gt;x@localhost&lt;/recipients&gt;<BR>
  -*&lt;sender&gt;postmaster&lt;/sender&gt;<BR>
  -*&lt;message xml:space="preserve"&gt;Message marked as spam:<BR>
  -*&lt;/message&gt;<BR>
  -*&lt;inline&gt;heads&lt;/inline&gt;<BR>
  -*&lt;attachment&gt;message&lt;/attachment&gt;<BR>
  -*&lt;passThrough&gt;FALSE&lt;/passThrough&gt;<BR>
  -*&lt;attachError&gt;TRUE&lt;/attachError&gt;<BR>
  -*&lt;replyto&gt;postmaster&lt;/replyto&gt;<BR>
  -*&lt;prefix&gt;[spam notification]&lt;/prefix&gt;<BR>
  -*&lt;static&gt;TRUE&lt;/static&gt;<BR>
  -*&lt;/mailet&gt;</P>
  + * <P>A mailet providing configurable redirection services<BR>
  + * This mailet can produce listserver, forward and notify behaviour, with the original
  + * message intact, attached, appended or left out altogether.<BR>
  + * This built in functionality is controlled by the configuration as laid out below.</P>
  + * <P>The configuration parameters are:</P>
  + * <TABLE width="75%" border="0" cellspacing="2" cellpadding="2">
  + * <TR>
  + * <TD width="20%">&lt;recipients&gt;</TD>
  + * <TD width="80%">A comma delimited list of email addresses for recipients of
  + * this message, it will use the &quot;to&quot; list if not specified. These
  + * addresses will only appear in the To: header if no &quot;to&quot; list is
  + * supplied.<BR>
  + * It can include constants &quot;sender&quot;, &quot;postmaster&quot;
and &quot;returnPath&quot;</TD>
  + * </TR>
  + * <TR>
  + * <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 only be delivered to these addresses if they are in the recipients
  + * list.<BR>
  + * The recipients list will be used if this is not supplied.<BR>
  + * It can include constants &quot;sender&quot;, &quot;postmaster&quot;,
&quot;returnPath&quot; and &quot;unaltered&quot;</TD>
  + * </TR>
  + * <TR>
  + * <TD width="20%">&lt;sender&gt;</TD>
  + * <TD width="80%">A single email address to appear in the From: header <BR>
  + * It can include constants &quot;sender&quot; and &quot;postmaster&quot;</TD>
  + * </TR>
  + * <TR>
  + * <TD width="20%">&lt;message&gt;</TD>
  + * <TD width="80%">A text message to be the body of the email. Can be omitted.</TD>
  + * </TR>
  + * <TR>
  + * <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>
  + * </TD>
  + * </TR>
  + * <TR>
  + * <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>
  + * </TD>
  + * </TR>
  + * <TR>
  + * <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. The default is false.</TD>
  + * </TR>
  + * <TR>
  + * <TD width="20%">&lt;fakeDomainCheck&gt;</TD>
  + * <TD width="80%">TRUE or FALSE, if true will check if the sender domain is valid.
  + * The default is true.</TD>
  + * </TR>
  + * <TR>
  + * <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)</TD>
  + * </TR>
  + * <TR>
  + * <TD width="20%">&lt;replyto&gt;</TD>
  + * <TD width="80%">A single email address to appear in the Reply-To: header, can
  + * also be &quot;sender&quot; or &quot;postmaster&quot;, this header is
not
  + * set if this is omitted.</TD>
  + * </TR>
  + * <TR>
  + * <TD width="20%">&lt;returnPath&gt;</TD>
  + * <TD width="80%">A single email address to appear in the Return-Path: header, can
  + * also be &quot;sender&quot; or &quot;postmaster&quot; or &quot;null&quot;;
this header is not
  + * set if this parameter is omitted.</TD>
  + * </TR>
  + * <TR>
  + * <TD width="20%">&lt;prefix&gt;</TD>
  + * <TD width="80%">An optional subject prefix prepended to the original message
  + * subject, for example:<BR>
  + * Undeliverable mail: </TD>
  + * </TR>
  + * <TR>
  + * <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.</TD>
  + * </TR>
  + * <TR>
  + * <TD width="20%">&lt;static&gt;</TD>
  + * <TD width="80%">
  + * <P>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.</P>
  + * <P>This defaults to false.<BR>
  + * </TD>
  + * </TR>
  + * </TABLE>
    *
  + * <P>Example:</P>
  + * <P> &lt;mailet match=&quot;RecipientIs=test@localhost&quot; class=&quot;Redirect&quot;&gt;<BR>
  + * &lt;recipients&gt;x@localhost, y@localhost, z@localhost&lt;/recipients&gt;<BR>
  + * &lt;to&gt;list@localhost&lt;/to&gt;<BR>
  + * &lt;sender&gt;owner@localhost&lt;/sender&gt;<BR>
  + * &lt;message&gt;sent on from James&lt;/message&gt;<BR>
  + * &lt;inline&gt;unaltered&lt;/inline&gt;<BR>
  + * &lt;passThrough&gt;FALSE&lt;/passThrough&gt;<BR>
  + * &lt;replyto&gt;postmaster&lt;/replyto&gt;<BR>
  + * &lt;prefix xml:space="preserve"&gt;[test mailing] &lt;/prefix&gt;<BR>
  + * &lt;!-- note the xml:space="preserve" to preserve whitespace --&gt;<BR>
  + * &lt;static&gt;TRUE&lt;/static&gt;<BR>
  + * &lt;/mailet&gt;<BR>
  + * </P>
  + * <P>and:</P>
  + * <P> &lt;mailet match=&quot;All&quot; class=&quot;Redirect&quot;&gt;<BR>
  + * &lt;recipients&gt;x@localhost&lt;/recipients&gt;<BR>
  + * &lt;sender&gt;postmaster&lt;/sender&gt;<BR>
  + * &lt;message xml:space="preserve"&gt;Message marked as spam:<BR>
  + * &lt;/message&gt;<BR>
  + * &lt;inline&gt;heads&lt;/inline&gt;<BR>
  + * &lt;attachment&gt;message&lt;/attachment&gt;<BR>
  + * &lt;passThrough&gt;FALSE&lt;/passThrough&gt;<BR>
  + * &lt;attachError&gt;TRUE&lt;/attachError&gt;<BR>
  + * &lt;replyto&gt;postmaster&lt;/replyto&gt;<BR>
  + * &lt;prefix&gt;[spam notification]&lt;/prefix&gt;<BR>
  + * &lt;static&gt;TRUE&lt;/static&gt;<BR>
  + * &lt;/mailet&gt;</P>
    *
  + * <P>CVS $Id$</P>
  + * @version 2.2.0
    */
   
   public class Redirect extends AbstractRedirect {
  
  
  

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


Mime
View raw message