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, setTo
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 missingjavax.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 appendedgetInLineType
in class AbstractRedirect
inline
init parameter, or NONE
if
missingjavax.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
attachment
init parameter, or
MESSAGE
if missingjavax.mail.MessagingException
protected 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 String getMessage(org.apache.mailet.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 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
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
SpecialAddress.NULL
, that will remove the "ReplyTo:"
headerjavax.mail.MessagingException
protected org.apache.mailet.MailAddress getReversePath(org.apache.mailet.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 anyjavax.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
sendingAddress
init parameter or the
sender
init parameter or the postmaster address if
both are missing; possible special addresses returned are
SpecialAddress.SENDER
and
SpecialAddress.UNALTERED
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()
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(org.apache.mailet.Mail newMail, String subjectPrefix, org.apache.mailet.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
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.