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 @@
* <sendingAddress><I>an address or postmaster</I></sendingAddress>
* <attachStackTrace><I>true or false,
default=false</I></attachStackTrace>
* <notice><I>notice attached to the message (optional)</I></notice>
+ * <prefix><I>optional subject prefix prepended to the original
message</I></prefix>
+ * <inline><I>see [EMAIL PROTECTED] Redirect},
default=none</I></inline>
+ * <attachment><I>see [EMAIL PROTECTED] Redirect},
default=message</I></attachment>
+ * <passThrough><I>true or false, default=true</I></passThrough>
+ * <fakeDomainCheck><I>true or false,
default=true</I></fakeDomainCheck>
* </mailet>
* </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 [EMAIL PROTECTED]
#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 [EMAIL PROTECTED] #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 [EMAIL PROTECTED] #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>
- * <mailet match="All" class="NotifyPostmaster">
+ * <mailet match="All" class="Bounce">
* <sendingAddress><I>an address or postmaster</I></sendingAddress>
* <attachStackTrace><I>true or false,
default=false</I></attachStackTrace>
* <notice><I>notice attached to the message (optional)</I></notice>
+ * <prefix><I>optional subject prefix prepended to the original
message</I></prefix>
+ * <inline><I>see [EMAIL PROTECTED] Redirect},
default=none</I></inline>
+ * <attachment><I>see [EMAIL PROTECTED] Redirect},
default=message</I></attachment>
+ * <passThrough><I>true or false, default=true</I></passThrough>
+ * <fakeDomainCheck><I>true or false,
default=true</I></fakeDomainCheck>
* </mailet>
* </CODE></PRE>
*
@@ -116,16 +121,21 @@
* <sender><I>an address or postmaster</I></sender>
* <attachError><I>true or false, default=false</I></attachError>
* <message><I><B>dynamically built</B></I></message>
- * <passThrough>true</passThrough>
+ * <prefix><I>a string</I></prefix>
+ * <passThrough>true or false, default=true</passThrough>
+ * <fakeDomainCheck><I>true or false,
default=true</I></fakeDomainCheck>
* <recipients><B>sender</B></recipients>
* <returnPath>null</returnPath>
- * <inline>none</inline>
- * <attachment>message</attachment>
+ * <inline>see [EMAIL PROTECTED] Redirect}, default=NONE</inline>
+ * <attachment>see [EMAIL PROTECTED] Redirect},
default=message</attachment>
* <isReply>true</isReply>
* <static>true</static>
* </mailet>
* </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>
* <mailet match="All" class="Redirect">
* <passThrough>true or false</passThrough>
+ * <fakeDomainCheck><I>true or false,
default=true</I></fakeDomainCheck>
* <recipients>comma delimited list of email addresses</recipients>
* <inline>unaltered</inline>
* </mailet>
* </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>
* <mailet match="All" class="NotifyPostmaster">
- * <sendingAddress><I>an address or postmaster or sender,
default=postmaster</I></sendingAddress>
+ * <sendingAddress><I>an address or postmaster</I></sendingAddress>
* <attachStackTrace><I>true or false,
default=false</I></attachStackTrace>
* <notice><I>notice attached to the message (optional)</I></notice>
+ * <prefix><I>optional subject prefix prepended to the original message,
default="Re:"</I></prefix>
+ * <inline><I>see [EMAIL PROTECTED] Redirect},
default=none</I></inline>
+ * <attachment><I>see [EMAIL PROTECTED] Redirect},
default=message</I></attachment>
+ * <passThrough><I>true or false, default=true</I></passThrough>
+ * <fakeDomainCheck><I>true or false,
default=true</I></fakeDomainCheck>
* <to><I>unaltered (optional, defaults to postmaster)</I></to>
* </mailet>
* </CODE></PRE>
@@ -112,16 +117,20 @@
* <sender><I>an address or postmaster or sender,
default=postmaster</I></sender>
* <attachError><I>true or false, default=false</I></attachError>
* <message><I><B>dynamically built</B></I></message>
- * <passThrough>true</passThrough>
- * <to><I>unaltered or postmaster<</I>;/to>
+ * <prefix><I>a string</I></prefix>
+ * <passThrough><I>true or false, default=true</I></passThrough>
+ * <fakeDomainCheck><I>true or false,
default=true</I></fakeDomainCheck>
+ * <to><I><B>unaltered or postmaster</B></I></to>
* <recipients><B>postmaster</B></recipients>
- * <inline>none</inline>
- * <attachment>message</attachment>
+ * <inline>see [EMAIL PROTECTED] Redirect}, default=none</inline>
+ * <attachment>see [EMAIL PROTECTED] Redirect},
default=message</attachment>
* <isReply>true</isReply>
* <static>true</static>
* </mailet>
* </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 @@
* <sendingAddress><I>an address or postmaster</I></sendingAddress>
* <attachStackTrace><I>true or false,
default=false</I></attachStackTrace>
* <notice><I>notice attached to the message (optional)</I></notice>
+ * <prefix><I>optional subject prefix prepended to the original
message</I></prefix>
+ * <inline><I>see [EMAIL PROTECTED] Redirect},
default=none</I></inline>
+ * <attachment><I>see [EMAIL PROTECTED] Redirect},
default=message</I></attachment>
+ * <passThrough><I>true or false, default=true</I></passThrough>
+ * <fakeDomainCheck><I>true or false,
default=true</I></fakeDomainCheck>
* <to><I>unaltered (optional, defaults to sender)</I></to>
* </mailet>
* </CODE></PRE>
@@ -112,7 +117,9 @@
* <sender><I>an address or postmaster</I></sender>
* <attachError><I>true or false, default=false</I></attachError>
* <message><I><B>dynamically built</B></I></message>
+ * <prefix><I>a string</I></prefix>
* <passThrough>true</passThrough>
+ * <fakeDomainCheck><I>true or false,
default=true</I></fakeDomainCheck>
* <to><I>unaltered or sender<</I>;/to>
* <recipients><B>sender</B></recipients>
* <inline>none</inline>
@@ -122,6 +129,8 @@
* </mailet>
* </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%"><recipients></TD>
-*<TD width="80%">A comma delimited list of email addresses for recipients of
-*this message, it will use the "to" list if not specified. These
-*addresses will only appear in the To: header if no "to" list is
-*supplied.<BR>
-*It can include constants "sender", "postmaster" and
"returnPath"</TD>
-*</TR>
-*<TR>
-*<TD width="20%"><to></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 "sender", "postmaster",
"returnPath" and "unaltered"</TD>
-*</TR>
-*<TR>
-*<TD width="20%"><sender></TD>
-*<TD width="80%">A single email address to appear in the From: header <BR>
-*It can include constants "sender" and "postmaster"</TD>
-*</TR>
-*<TR>
-*<TD width="20%"><message></TD>
-*<TD width="80%">A text message to be the body of the email. Can be omitted.</TD>
-*</TR>
-*<TR>
-*<TD width="20%"><inline></TD>
-*<TD width="80%">
-*<P>One of the following items:</P>
-*<UL>
-*<LI>unaltered The original message is the new
-* message, for forwarding/aliasing</LI>
-*<LI>heads The
-* headers of the original message are appended to the message</LI>
-*<LI>body The
-* body of the original is appended to the new message</LI>
-*<LI>all Both
-* headers and body are appended</LI>
-*<LI>none Neither
-* body nor headers are appended</LI>
-*</UL>
-*</TD>
-*</TR>
-*<TR>
-*<TD width="20%"><attachment></TD>
-*<TD width="80%">
-*<P>One of the following items:</P>
-*<UL>
-*<LI>heads The headers of the original
-* are attached as text</LI>
-*<LI>body The body of the original
-* is attached as text</LI>
-*<LI>all Both
-* headers and body are attached as a single text file</LI>
-*<LI>none Nothing is attached</LI>
-*<LI>message 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%"><passThrough></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%"><attachError></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%"><replyto></TD>
-*<TD width="80%">A single email address to appear in the Reply-To: header, can
-*also be "sender" or "postmaster", this header is not
-*set if this is omitted.</TD>
-*</TR>
-*<TR>
-*<TD width="20%"><returnPath></TD>
-*<TD width="80%">A single email address to appear in the Return-Path: header, can
-*also be "sender" or "postmaster" or "null"; this
header is not
-*set if this parameter is omitted.</TD>
-*</TR>
-*<TR>
-*<TD width="20%"><prefix></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%"><isReply></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%"><static></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> <mailet match="[EMAIL PROTECTED]"
class="Redirect"><BR>
-*<recipients>[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL
PROTECTED]</recipients><BR>
-*<to>[EMAIL PROTECTED]</to><BR>
-*<sender>[EMAIL PROTECTED]</sender><BR>
-*<message>sent on from James</message><BR>
-*<inline>unaltered</inline><BR>
-*<passThrough>FALSE</passThrough><BR>
-*<replyto>postmaster</replyto><BR>
-*<prefix xml:space="preserve">[test mailing] </prefix><BR>
-*<!-- note the xml:space="preserve" to preserve whitespace --><BR>
-*<static>TRUE</static><BR>
-*</mailet><BR>
-*</P>
-*<P>and:</P>
-*<P> <mailet match="All" class="Redirect"><BR>
-*<recipients>[EMAIL PROTECTED]</recipients><BR>
-*<sender>postmaster</sender><BR>
-*<message xml:space="preserve">Message marked as spam:<BR>
-*</message><BR>
-*<inline>heads</inline><BR>
-*<attachment>message</attachment><BR>
-*<passThrough>FALSE</passThrough><BR>
-*<attachError>TRUE</attachError><BR>
-*<replyto>postmaster</replyto><BR>
-*<prefix>[spam notification]</prefix><BR>
-*<static>TRUE</static><BR>
-*</mailet></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%"><recipients></TD>
+ * <TD width="80%">A comma delimited list of email addresses for recipients of
+ * this message, it will use the "to" list if not specified. These
+ * addresses will only appear in the To: header if no "to" list is
+ * supplied.<BR>
+ * It can include constants "sender", "postmaster" and
"returnPath"</TD>
+ * </TR>
+ * <TR>
+ * <TD width="20%"><to></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 "sender", "postmaster",
"returnPath" and "unaltered"</TD>
+ * </TR>
+ * <TR>
+ * <TD width="20%"><sender></TD>
+ * <TD width="80%">A single email address to appear in the From: header <BR>
+ * It can include constants "sender" and "postmaster"</TD>
+ * </TR>
+ * <TR>
+ * <TD width="20%"><message></TD>
+ * <TD width="80%">A text message to be the body of the email. Can be omitted.</TD>
+ * </TR>
+ * <TR>
+ * <TD width="20%"><inline></TD>
+ * <TD width="80%">
+ * <P>One of the following items:</P>
+ * <UL>
+ * <LI>unaltered The original message is the new
+ * message, for forwarding/aliasing</LI>
+ * <LI>heads The
+ * headers of the original message are appended to the message</LI>
+ * <LI>body The
+ * body of the original is appended to the new message</LI>
+ *
<LI>all Both
+ * headers and body are appended</LI>
+ * <LI>none Neither
+ * body nor headers are appended</LI>
+ * </UL>
+ * </TD>
+ * </TR>
+ * <TR>
+ * <TD width="20%"><attachment></TD>
+ * <TD width="80%">
+ * <P>One of the following items:</P>
+ * <UL>
+ * <LI>heads The headers of the original
+ * are attached as text</LI>
+ * <LI>body The body of the original
+ * is attached as text</LI>
+ * <LI>all Both
+ * headers and body are attached as a single text file</LI>
+ * <LI>none Nothing is attached</LI>
+ * <LI>message 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%"><passThrough></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%"><fakeDomainCheck></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%"><attachError></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%"><replyto></TD>
+ * <TD width="80%">A single email address to appear in the Reply-To: header, can
+ * also be "sender" or "postmaster", this header is not
+ * set if this is omitted.</TD>
+ * </TR>
+ * <TR>
+ * <TD width="20%"><returnPath></TD>
+ * <TD width="80%">A single email address to appear in the Return-Path: header, can
+ * also be "sender" or "postmaster" or "null"; this
header is not
+ * set if this parameter is omitted.</TD>
+ * </TR>
+ * <TR>
+ * <TD width="20%"><prefix></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%"><isReply></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%"><static></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> <mailet match="[EMAIL PROTECTED]"
class="Redirect"><BR>
+ * <recipients>[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL
PROTECTED]</recipients><BR>
+ * <to>[EMAIL PROTECTED]</to><BR>
+ * <sender>[EMAIL PROTECTED]</sender><BR>
+ * <message>sent on from James</message><BR>
+ * <inline>unaltered</inline><BR>
+ * <passThrough>FALSE</passThrough><BR>
+ * <replyto>postmaster</replyto><BR>
+ * <prefix xml:space="preserve">[test mailing] </prefix><BR>
+ * <!-- note the xml:space="preserve" to preserve whitespace --><BR>
+ * <static>TRUE</static><BR>
+ * </mailet><BR>
+ * </P>
+ * <P>and:</P>
+ * <P> <mailet match="All" class="Redirect"><BR>
+ * <recipients>[EMAIL PROTECTED]</recipients><BR>
+ * <sender>postmaster</sender><BR>
+ * <message xml:space="preserve">Message marked as spam:<BR>
+ * </message><BR>
+ * <inline>heads</inline><BR>
+ * <attachment>message</attachment><BR>
+ * <passThrough>FALSE</passThrough><BR>
+ * <attachError>TRUE</attachError><BR>
+ * <replyto>postmaster</replyto><BR>
+ * <prefix>[spam notification]</prefix><BR>
+ * <static>TRUE</static><BR>
+ * </mailet></P>
*
+ * <P>CVS $Id$</P>
+ * @version 2.2.0
*/
public class Redirect extends AbstractRedirect {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]