|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.mailet.GenericMailet org.apache.james.transport.mailets.AbstractRedirect org.apache.james.transport.mailets.AbstractNotify
public abstract class AbstractNotify
Abstract mailet providing configurable notification services.
This mailet can be subclassed to make authoring notification mailets simple.
Provides the following functionalities to all notification subclasses:
attachStackTrace
init parameter
is set to true, such error message will be attached to the notification message.passThrough
init parameter (true if missing).Sample configuration common to all notification mailet subclasses:
<mailet match="All" class="a notification mailet">
<sender>an address or postmaster or sender or unaltered, default=postmaster</sender>
<attachError>true or false, default=false</attachError>
<message>notice attached to the original message text (optional)</message>
<prefix>optional subject prefix prepended to the original message</prefix>
<inline>see Redirect
, default=none</inline>
<attachment>see Redirect
, default=message</attachment>
<passThrough>true or false, default=true</passThrough>
<fakeDomainCheck>true or false, default=true</fakeDomainCheck>
<debug>true or false, default=false</debug>
</mailet>
notice and senderAddress can be used instead of message and sender; such names are kept for backward compatibility.
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 | |
---|---|
AbstractNotify()
|
Method Summary | |
---|---|
protected int |
getAttachmentType()
Gets the attachment property. |
protected int |
getInLineType()
Gets the inline property. |
protected java.lang.String |
getMessage()
Gets the message property. |
protected java.lang.String |
getMessage(Mail originalMail)
Gets the message property,
built dynamically using the original Mail object. |
protected boolean |
getPassThrough()
Gets the passThrough property. |
protected abstract java.util.Collection |
getRecipients()
Gets the recipients property. |
protected MailAddress |
getReplyTo()
Gets the replyto property. |
protected MailAddress |
getReversePath(Mail originalMail)
Gets the reversePath property,
built dynamically using the original Mail object. |
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. |
protected void |
setSubjectPrefix(Mail newMail,
java.lang.String subjectPrefix,
Mail originalMail)
Builds the subject of newMail appending the subject of originalMail to subjectPrefix, but avoiding a duplicate. |
Methods inherited from class org.apache.james.transport.mailets.AbstractRedirect |
---|
attachError, attachError, buildAlteredMessage, changeSubject, getAllowedInitParameters, getAttachmentType, getFakeDomainCheck, getFakeDomainCheck, getInLineType, getMessageHeaders, getPassThrough, getRecipients, getReplyTo, getReversePath, getSender, getSpecialAddress, getSubject, getSubjectPrefix, getTo, getTypeCode, init, isReply, isStatic, replaceInternetAddresses, replaceMailAddresses, senderDomainIsValid, service, setIsReply, setRecipients, setReplyTo, setReversePath, setSender, setTo |
Methods inherited from class org.apache.mailet.GenericMailet |
---|
destroy, getInitParameter, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetInfo, getMailetName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractNotify()
Method Detail |
---|
protected boolean getPassThrough() throws javax.mail.MessagingException
AbstractRedirect
passThrough
property.
Return true to allow the original message to continue through the processor, false to GHOST it.
Is a "getX()" method.
getPassThrough
in class AbstractRedirect
passThrough
init parameter, or true if missing
javax.mail.MessagingException
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 appended
getInLineType
in class AbstractRedirect
inline
init parameter, or NONE
if missing
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 attached
getAttachmentType
in class AbstractRedirect
attachment
init parameter, or MESSAGE
if missing
javax.mail.MessagingException
protected java.lang.String getMessage()
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
notice
init parameter,
or the message
init parameter if missing,
or a default string if both are missingprotected java.lang.String getMessage(Mail originalMail) throws javax.mail.MessagingException
AbstractRedirect
message
property,
built dynamically using the original Mail object.
Is a "getX(Mail)" method.
getMessage
in class AbstractRedirect
javax.mail.MessagingException
protected abstract java.util.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 the postmaster address
or SpecialAddress.SENDER
or SpecialAddress.FROM
or SpecialAddress.REPLY_TO
or SpecialAddress.REVERSE_PATH
or SpecialAddress.UNALTERED
or SpecialAddress.RECIPIENTS
or null
if missing
javax.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 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
SpecialAddress.NULL
, that will remove the "ReplyTo:" header
javax.mail.MessagingException
protected MailAddress getReversePath(Mail originalMail) throws javax.mail.MessagingException
AbstractRedirect
reversePath
property,
built dynamically using the original Mail object.
Is a "getX(Mail)" method.
getReversePath
in class AbstractRedirect
AbstractRedirect.getSender(Mail)
, meaning the new requested sender if any
javax.mail.MessagingException
protected 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
sendingAddress
init parameter,
or the value of the sender
init parameter if missing,
or the postmaster address if both are missing
javax.mail.MessagingException
protected java.lang.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 java.lang.String getSubjectPrefix()
AbstractRedirect
prefix
property.
Returns a prefix for the new message subject.
Is a "getX()" method.
getSubjectPrefix
in class AbstractRedirect
prefix
init parameter or "Re:" if missingprotected void setSubjectPrefix(Mail newMail, java.lang.String subjectPrefix, Mail originalMail) throws javax.mail.MessagingException
setSubjectPrefix
in class AbstractRedirect
javax.mail.MessagingException
protected boolean isReply()
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |