public abstract class AbstractNotify extends AbstractRedirect
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.
AbstractRedirect.SpecialAddress| Constructor and Description |
|---|
AbstractNotify() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
getAttachmentType()
Gets the
attachment property. |
protected int |
getInLineType()
Gets the
inline property. |
protected String |
getMessage()
Gets the
message property. |
protected String |
getMessage(org.apache.mailet.Mail originalMail)
Gets the
message property, built dynamically using the
original Mail object. |
protected boolean |
getPassThrough()
Gets the
passThrough property. |
protected abstract Collection |
getRecipients()
Gets the
recipients property. |
protected org.apache.mailet.MailAddress |
getReplyTo()
Gets the
replyto property. |
protected org.apache.mailet.MailAddress |
getReversePath(org.apache.mailet.Mail originalMail)
Gets the
reversePath property, built dynamically using the
original Mail object. |
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. |
protected void |
setSubjectPrefix(org.apache.mailet.Mail newMail,
String subjectPrefix,
org.apache.mailet.Mail originalMail)
Builds the subject of newMail appending the subject of
originalMail to subjectPrefix, but avoiding a duplicate.
|
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, setDNSService, setIsReply, setRecipients, setReplyTo, setReversePath, setSender, setToprotected boolean getPassThrough()
throws javax.mail.MessagingException
AbstractRedirectpassThrough property. Return true to allow the
original message to continue through the processor, false to GHOST it. Is
a "getX()" method.getPassThrough in class AbstractRedirectpassThrough init parameter, or true if missingjavax.mail.MessagingExceptionprotected int getInLineType()
throws javax.mail.MessagingException
AbstractRedirectinline 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 AbstractRedirectinline init parameter, or NONE if
missingjavax.mail.MessagingExceptionprotected int getAttachmentType()
throws javax.mail.MessagingException
AbstractRedirectattachment 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 AbstractRedirectattachment init parameter, or
MESSAGE if missingjavax.mail.MessagingExceptionprotected String getMessage()
AbstractRedirectmessage 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 AbstractRedirectnotice init parameter, or the
message init parameter if missing, or a default
string if both are missingprotected String getMessage(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
AbstractRedirectmessage property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getMessage in class AbstractRedirectjavax.mail.MessagingExceptionprotected abstract Collection getRecipients() throws javax.mail.MessagingException
AbstractRedirectrecipients property. Returns the collection of
recipients of the new message, or null if no change is requested. Is a
"getX()" method.getRecipients in class AbstractRedirectrecipients 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
missingjavax.mail.MessagingExceptionprotected javax.mail.internet.InternetAddress[] getTo()
throws javax.mail.MessagingException
AbstractRedirectto property. Returns the "To:" recipients of the
new message. or null if no change is requested. Is a "getX()" method.getTo in class AbstractRedirectjavax.mail.MessagingExceptionprotected org.apache.mailet.MailAddress getReplyTo()
throws javax.mail.MessagingException
AbstractRedirectreplyto property. Returns the Reply-To address of
the new message, or null if no change is requested. Is a "getX()" method.getReplyTo in class AbstractRedirectSpecialAddress.NULL, that will remove the "ReplyTo:"
headerjavax.mail.MessagingExceptionprotected org.apache.mailet.MailAddress getReversePath(org.apache.mailet.Mail originalMail)
throws javax.mail.MessagingException
AbstractRedirectreversePath property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getReversePath in class AbstractRedirectAbstractRedirect.getSender(Mail), meaning the new
requested sender if anyjavax.mail.MessagingExceptionprotected org.apache.mailet.MailAddress getSender()
throws javax.mail.MessagingException
AbstractRedirectsender property. Returns the new sender as a
MailAddress, or null if no change is requested. Is a "getX()" method.getSender in class AbstractRedirectsendingAddress init parameter or the
sender init parameter or the postmaster address if
both are missing; possible special addresses returned are
SpecialAddress.SENDER and
SpecialAddress.UNALTEREDjavax.mail.MessagingExceptionprotected String getSubject() throws javax.mail.MessagingException
AbstractRedirectsubject property. Returns a string for the new
message subject. Is a "getX()" method.getSubject in class AbstractRedirectjavax.mail.MessagingExceptionprotected String getSubjectPrefix()
AbstractRedirectprefix property. Returns a prefix for the new
message subject. Is a "getX()" method.getSubjectPrefix in class AbstractRedirectprefix init parameter or "Re:" if missingprotected void setSubjectPrefix(org.apache.mailet.Mail newMail,
String subjectPrefix,
org.apache.mailet.Mail originalMail)
throws javax.mail.MessagingException
setSubjectPrefix in class AbstractRedirectjavax.mail.MessagingExceptionprotected boolean isReply()
AbstractRedirectisReply 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 AbstractRedirectCopyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.