org.apache.james.transport.mailets
Class Forward

java.lang.Object
  extended by org.apache.mailet.GenericMailet
      extended by org.apache.james.transport.mailets.AbstractRedirect
          extended by org.apache.james.transport.mailets.Forward
All Implemented Interfaces:
Mailet, MailetConfig

public class Forward
extends AbstractRedirect

Replaces incoming recipients with those specified, and resends the message unaltered.

Can be totally replaced by an equivalent usage of Resend (see below), simply replacing <forwardto> with <recipients>.

Sample configuration:


 <mailet match="All" class="Forward">
   <forwardTo>comma delimited list of email addresses</forwardTo>
   <passThrough>true or false, default=false</passThrough>
   <fakeDomainCheck>true or false, default=true</fakeDomainCheck>
   <debug>true or false, default=false</debug>
 </mailet>
 

The behaviour of this mailet is equivalent to using Resend with the following configuration:


 <mailet match="All" class="Resend">
   <recipients>comma delimited list of email addresses</recipients>
   <passThrough>true or false</passThrough>
   <fakeDomainCheck>true or false</fakeDomainCheck>
   <debug>true or false</debug>
 </mailet>
 

forwardto can be used instead of forwardTo; such name is kept for backward compatibility.

Version:
CVS $Revision: 494012 $ $Date: 2007-01-08 10:23:58 +0000 (lun, 08 gen 2007) $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.james.transport.mailets.AbstractRedirect
AbstractRedirect.SpecialAddress
 
Field Summary
 
Fields inherited from class org.apache.james.transport.mailets.AbstractRedirect
ALL, BODY, HEADS, isDebug, isStatic, MESSAGE, NONE, UNALTERED
 
Constructor Summary
Forward()
           
 
Method Summary
protected  boolean attachError()
          Gets the attachError property.
protected  java.lang.String[] getAllowedInitParameters()
          Gets the expected init parameters.
protected  int getAttachmentType()
          Gets the attachment property.
protected  int getInLineType()
          Gets the inline property.
 java.lang.String getMailetInfo()
          Return a string describing this mailet.
protected  java.lang.String getMessage()
          Gets the message property.
protected  java.util.Collection getRecipients()
          Gets the recipients property.
protected  MailAddress getReplyTo()
          Gets the replyto property.
protected  MailAddress getReversePath()
          Gets the reversePath property.
protected  MailAddress getSender()
          Gets the sender property.
protected  java.lang.String getSubject()
          Gets the subject property.
protected  java.lang.String getSubjectPrefix()
          Gets the prefix property.
protected  javax.mail.internet.InternetAddress[] getTo()
          Gets the to property.
protected  boolean isReply()
          Gets the isReply property.
 
Methods inherited from class org.apache.james.transport.mailets.AbstractRedirect
attachError, buildAlteredMessage, changeSubject, getAttachmentType, getFakeDomainCheck, getFakeDomainCheck, getInLineType, getMessage, getMessageHeaders, getPassThrough, getPassThrough, getRecipients, getReplyTo, getReversePath, getSender, getSpecialAddress, getSubject, getSubjectPrefix, getTo, getTypeCode, init, isReply, isStatic, replaceInternetAddresses, replaceMailAddresses, senderDomainIsValid, service, setIsReply, setRecipients, setReplyTo, setReversePath, setSender, setSubjectPrefix, setTo
 
Methods inherited from class org.apache.mailet.GenericMailet
destroy, getInitParameter, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Forward

public Forward()
Method Detail

getMailetInfo

public java.lang.String getMailetInfo()
Return a string describing this mailet.

Specified by:
getMailetInfo in interface Mailet
Overrides:
getMailetInfo in class GenericMailet
Returns:
a string describing this mailet

getAllowedInitParameters

protected java.lang.String[] getAllowedInitParameters()
Gets the expected init parameters.

Overrides:
getAllowedInitParameters in class AbstractRedirect
Returns:
null meaning no check

getInLineType

protected int getInLineType()
                     throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the inline property. May return one of the following values to indicate how to append the original message to build the new message: Is a "getX()" method.

Overrides:
getInLineType in class AbstractRedirect
Returns:
UNALTERED
Throws:
javax.mail.MessagingException

getAttachmentType

protected int getAttachmentType()
                         throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the attachment property. May return one of the following values to indicate how to attach the original message to the new message: Is a "getX()" method.

Overrides:
getAttachmentType in class AbstractRedirect
Returns:
NONE
Throws:
javax.mail.MessagingException

getMessage

protected java.lang.String getMessage()
                               throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the message property. Returns a message to which the original message can be attached/appended to build the new message. Is a "getX()" method.

Overrides:
getMessage in class AbstractRedirect
Returns:
""
Throws:
javax.mail.MessagingException

getRecipients

protected java.util.Collection getRecipients()
                                      throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the recipients property. Returns the collection of recipients of the new message, or null if no change is requested. Is a "getX()" method.

Overrides:
getRecipients in class AbstractRedirect
Returns:
the recipients init parameter or null if missing
Throws:
javax.mail.MessagingException

getTo

protected javax.mail.internet.InternetAddress[] getTo()
                                               throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the to property. Returns the "To:" recipients of the new message. or null if no change is requested. Is a "getX()" method.

Overrides:
getTo in class AbstractRedirect
Returns:
null
Throws:
javax.mail.MessagingException

getReplyTo

protected MailAddress getReplyTo()
                          throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the replyto property. Returns the Reply-To address of the new message, or null if no change is requested. Is a "getX()" method.

Overrides:
getReplyTo in class AbstractRedirect
Returns:
null
Throws:
javax.mail.MessagingException

getReversePath

protected MailAddress getReversePath()
                              throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the reversePath property. Returns the reverse-path of the new message, or null if no change is requested. Is a "getX()" method.

Overrides:
getReversePath in class AbstractRedirect
Returns:
null
Throws:
javax.mail.MessagingException

getSender

protected MailAddress getSender()
                         throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the sender property. Returns the new sender as a MailAddress, or null if no change is requested. Is a "getX()" method.

Overrides:
getSender in class AbstractRedirect
Returns:
null
Throws:
javax.mail.MessagingException

getSubject

protected java.lang.String getSubject()
                               throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the subject property. Returns a string for the new message subject. Is a "getX()" method.

Overrides:
getSubject in class AbstractRedirect
Returns:
null
Throws:
javax.mail.MessagingException

getSubjectPrefix

protected java.lang.String getSubjectPrefix()
                                     throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the prefix property. Returns a prefix for the new message subject. Is a "getX()" method.

Overrides:
getSubjectPrefix in class AbstractRedirect
Returns:
""
Throws:
javax.mail.MessagingException

attachError

protected boolean attachError()
Description copied from class: AbstractRedirect
Gets the attachError property. Returns a boolean indicating whether to append a description of any error to the main body part of the new message, if getInlineType does not return "UNALTERED". Is a "getX()" method.

Overrides:
attachError in class AbstractRedirect
Returns:
false

isReply

protected boolean isReply()
                   throws javax.mail.MessagingException
Description copied from class: AbstractRedirect
Gets the isReply property. Returns a boolean indicating whether the new message must be considered a reply to the original message, setting the IN_REPLY_TO header of the new message to the id of the original message. Is a "getX()" method.

Overrides:
isReply in class AbstractRedirect
Returns:
false
Throws:
javax.mail.MessagingException


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.