|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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
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 missing
javax.mail.MessagingException
protected 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 appended
getInLineType in class AbstractRedirectinline init parameter, or NONE if missing
javax.mail.MessagingException
protected 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 attached
getAttachmentType in class AbstractRedirectattachment init parameter, or MESSAGE if missing
javax.mail.MessagingExceptionprotected java.lang.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 missing
protected java.lang.String getMessage(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.MessagingException
protected abstract java.util.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 missing
javax.mail.MessagingException
protected 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.MessagingException
protected 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:" header
javax.mail.MessagingException
protected MailAddress getReversePath(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 any
javax.mail.MessagingException
protected 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 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
AbstractRedirectsubject property.
Returns a string for the new message subject.
Is a "getX()" method.
getSubject in class AbstractRedirectjavax.mail.MessagingExceptionprotected java.lang.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 missing
protected void setSubjectPrefix(Mail newMail,
java.lang.String subjectPrefix,
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 AbstractRedirect
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||