|
||||||||||
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 org.apache.james.transport.mailets.NotifyPostmaster
public class NotifyPostmaster
Sends a notification message to the Postmaster.
A sender of the notification message can optionally be specified.
If one is not specified, the postmaster's address will be used.
The "To:" header of the notification message can be set to "unaltered";
if missing will be set to the postmaster.
A notice text can be specified, and in such case will be inserted into the
notification inline text.
If the notified message has an "error message" set, it will be inserted into the
notification inline text. If the attachStackTrace
init parameter
is set to true, such error message will be attached to the notification message.
The notified messages are attached in their entirety (headers and
content) and the resulting MIME part type is "message/rfc822".
Supports the passThrough
init parameter (true if missing).
Sample configuration:
<mailet match="All" class="NotifyPostmaster">
<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, default="Re:"</prefix>
<inline>see Resend
, default=none</inline>
<attachment>see Resend
, default=message</attachment>
<passThrough>true or false, default=true</passThrough>
<fakeDomainCheck>true or false, default=true</fakeDomainCheck>
<to>unaltered (optional, defaults to postmaster)</to>
<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">
<sender>an address or postmaster or sender or unaltered</sender>
<attachError>true or false</attachError>
<message>dynamically built</message>
<prefix>a string</prefix>
<passThrough>true or false</passThrough>
<fakeDomainCheck>true or false</fakeDomainCheck>
<to>unaltered or postmaster</to>
<recipients>postmaster</recipients>
<inline>see Resend
</inline>
<attachment>see Resend
</attachment>
<isReply>true</isReply>
<debug>true or false</debug>
</mailet>
notice, sendingAddress and attachStackTrace can be used instead of message, sender and attachError; 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 | |
---|---|
NotifyPostmaster()
|
Method Summary | |
---|---|
protected boolean |
attachError()
Gets the attachError property. |
protected java.lang.String[] |
getAllowedInitParameters()
Gets the expected init parameters. |
java.lang.String |
getMailetInfo()
Return a string describing this mailet. |
protected java.util.Collection |
getRecipients()
Gets the recipients property. |
protected javax.mail.internet.InternetAddress[] |
getTo()
Gets the to property. |
Methods inherited from class org.apache.james.transport.mailets.AbstractNotify |
---|
getAttachmentType, getInLineType, getMessage, getMessage, getPassThrough, getReplyTo, getReversePath, getSender, getSubject, getSubjectPrefix, isReply, setSubjectPrefix |
Methods inherited from class org.apache.james.transport.mailets.AbstractRedirect |
---|
attachError, buildAlteredMessage, changeSubject, 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, 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 NotifyPostmaster()
Method Detail |
---|
public java.lang.String getMailetInfo()
getMailetInfo
in interface Mailet
getMailetInfo
in class GenericMailet
protected java.lang.String[] getAllowedInitParameters()
getAllowedInitParameters
in class AbstractRedirect
protected java.util.Collection getRecipients()
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 AbstractNotify
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 AbstractNotify
SpecialAddress.UNALTERED
if specified or postmaster if missing
javax.mail.MessagingException
protected boolean attachError() throws javax.mail.MessagingException
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
attachStackTrace
init parameter,
or the attachError
init parameter if missing,
or false if missing
javax.mail.MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |