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.
AbstractRedirect.SpecialAddress
Constructor and Description |
---|
Forward() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
attachError()
Gets the
attachError property. |
protected String[] |
getAllowedInitParameters()
Gets the expected init parameters.
|
protected int |
getAttachmentType()
Gets the
attachment property. |
protected int |
getInLineType()
Gets the
inline property. |
String |
getMailetInfo()
Return a string describing this mailet.
|
protected String |
getMessage()
Gets the
message property. |
protected Collection |
getRecipients()
Gets the
recipients property. |
protected org.apache.mailet.MailAddress |
getReplyTo()
Gets the
replyto property. |
protected org.apache.mailet.MailAddress |
getReversePath()
Gets the
reversePath property. |
protected org.apache.mailet.MailAddress |
getSender()
Gets the
sender property. |
protected String |
getSubject()
Gets the
subject property. |
protected String |
getSubjectPrefix()
Gets the
prefix property. |
protected javax.mail.internet.InternetAddress[] |
getTo()
Gets the
to property. |
protected boolean |
isReply()
Gets the
isReply property. |
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, setDNSService, setIsReply, setRecipients, setReplyTo, setReversePath, setSender, setSubjectPrefix, setTo
public String getMailetInfo()
getMailetInfo
in interface org.apache.mailet.Mailet
getMailetInfo
in class org.apache.mailet.base.GenericMailet
protected String[] getAllowedInitParameters()
getAllowedInitParameters
in class AbstractRedirect
protected int getInLineType() throws javax.mail.MessagingException
AbstractRedirect
inline
property. May return one of the following
values to indicate how to append the original message to build the new
message:
UNALTERED
: original message is the new message bodyBODY
: original message body is appended to the new
messageHEADS
: original message headers are appended to the new
messageALL
: original is appended with all headersNONE
: original is not appendedgetInLineType
in class AbstractRedirect
javax.mail.MessagingException
protected int getAttachmentType() throws javax.mail.MessagingException
AbstractRedirect
attachment
property. May return one of the
following values to indicate how to attach the original message to the
new message:
BODY
: original message body is attached as plain text
to the new messageHEADS
: original message headers are attached as plain
text to the new messageALL
: original is attached as plain text with all
headersMESSAGE
: original message is attached as type
message/rfc822, a complete mail message.NONE
: original is not attachedgetAttachmentType
in class AbstractRedirect
javax.mail.MessagingException
protected String getMessage() throws javax.mail.MessagingException
AbstractRedirect
message
property. Returns a message to which the
original message can be attached/appended to build the new message. Is a
"getX()" method.getMessage
in class AbstractRedirect
javax.mail.MessagingException
protected Collection getRecipients() throws javax.mail.MessagingException
AbstractRedirect
recipients
property. Returns the collection of
recipients of the new message, or null if no change is requested. Is a
"getX()" method.getRecipients
in class AbstractRedirect
recipients
init parameter or null if missingjavax.mail.MessagingException
protected javax.mail.internet.InternetAddress[] getTo() throws javax.mail.MessagingException
AbstractRedirect
to
property. Returns the "To:" recipients of the
new message. or null if no change is requested. Is a "getX()" method.getTo
in class AbstractRedirect
javax.mail.MessagingException
protected org.apache.mailet.MailAddress getReplyTo() throws javax.mail.MessagingException
AbstractRedirect
replyto
property. Returns the Reply-To address of
the new message, or null if no change is requested. Is a "getX()" method.getReplyTo
in class AbstractRedirect
javax.mail.MessagingException
protected org.apache.mailet.MailAddress getReversePath() throws javax.mail.MessagingException
AbstractRedirect
reversePath
property. Returns the reverse-path of
the new message, or null if no change is requested. Is a "getX()" method.getReversePath
in class AbstractRedirect
javax.mail.MessagingException
protected org.apache.mailet.MailAddress getSender() throws javax.mail.MessagingException
AbstractRedirect
sender
property. Returns the new sender as a
MailAddress, or null if no change is requested. Is a "getX()" method.getSender
in class AbstractRedirect
javax.mail.MessagingException
protected String getSubject() throws javax.mail.MessagingException
AbstractRedirect
subject
property. Returns a string for the new
message subject. Is a "getX()" method.getSubject
in class AbstractRedirect
javax.mail.MessagingException
protected String getSubjectPrefix() throws javax.mail.MessagingException
AbstractRedirect
prefix
property. Returns a prefix for the new
message subject. Is a "getX()" method.getSubjectPrefix
in class AbstractRedirect
javax.mail.MessagingException
protected boolean attachError()
AbstractRedirect
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.attachError
in class AbstractRedirect
protected boolean isReply() throws javax.mail.MessagingException
AbstractRedirect
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.isReply
in class AbstractRedirect
javax.mail.MessagingException
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.