public class NotifySender extends AbstractNotify
Sends a notification message to the sender of a message.
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 sender of the notified message.
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="NotifySender">
<sender>an address or postmaster or sender or unaltered, default=postmaster</sender>
<attachError>true or false, default=false</attachError>
<prefix>optional subject prefix prepended to the original message</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 or sender or from(optional, defaults to sender)</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</passThrough>
<fakeDomainCheck>true or false</fakeDomainCheck>
<to>unaltered or sender or from</to>
<recipients>sender</recipients>
<inline>none</inline>
<attachment>message</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.
AbstractRedirect.SpecialAddress
Constructor and Description |
---|
NotifySender() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
attachError()
Gets the
attachError property. |
protected String[] |
getAllowedInitParameters()
Gets the expected init parameters.
|
String |
getMailetInfo()
Return a string describing this mailet.
|
protected Collection<org.apache.mailet.MailAddress> |
getRecipients()
Gets the
recipients property. |
protected javax.mail.internet.InternetAddress[] |
getTo()
Gets the
to property. |
getAttachmentType, getInLineType, getMessage, getMessage, getPassThrough, getReplyTo, getReversePath, getSender, getSubject, getSubjectPrefix, isReply, setSubjectPrefix
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, setDNSService, setIsReply, setRecipients, setReplyTo, setReversePath, setSender, setTo
public String getMailetInfo()
getMailetInfo
in interface org.apache.mailet.Mailet
getMailetInfo
in class org.apache.mailet.base.GenericMailet
protected String[] getAllowedInitParameters()
getAllowedInitParameters
in class AbstractRedirect
protected Collection<org.apache.mailet.MailAddress> 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
SpecialAddress.SENDER
, indicating the sender of the
current mailprotected 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
SpecialAddress.SENDER
if missingjavax.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
missingjavax.mail.MessagingException
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.