public class Bounce extends AbstractNotify
Generates a response to the reverse-path address. Note that this is different than a mail-client's reply, which would use the Reply-To or From header.
Bounced messages are attached in their entirety (headers and content) and the
resulting MIME part type is "message/rfc822".
The reverse-path and the Return-Path header of the response is set to "null"
("<>"), meaning that no reply should be sent.
A sender of the notification message can optionally be specified. If one is
not specified, the postmaster's address will be used.
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.
Supports the passThrough init parameter (true if missing).
Sample configuration:
<mailet match="All" class="Bounce">
<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 Resend, default=none</inline>
<attachment>see Resend, 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>
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>
<recipients>sender</recipients>
<reversePath>null</reversePath>
<inline>see Resend</inline>
<attachment>see Resend</attachment>
<isReply>true</isReply>
<debug>true or false</debug>
</mailet>
notice and sendingAddress can be used instead of message and sender; such names are kept for backward compatibility.
AbstractRedirect.SpecialAddress| Constructor and Description |
|---|
Bounce() |
| Modifier and Type | Method and Description |
|---|---|
protected String[] |
getAllowedInitParameters()
Gets the expected init parameters.
|
String |
getMailetInfo()
Return a string describing this mailet.
|
protected Collection |
getRecipients()
Gets the
recipients property. |
protected org.apache.mailet.MailAddress |
getReversePath(org.apache.mailet.Mail originalMail)
Gets the
reversePath property, built dynamically using the
original Mail object. |
protected javax.mail.internet.InternetAddress[] |
getTo()
Gets the
to property. |
void |
service(org.apache.mailet.Mail originalMail)
Service does the hard work,and redirects the originalMail in the form
specified.
|
getAttachmentType, getInLineType, getMessage, getMessage, getPassThrough, getReplyTo, getSender, getSubject, getSubjectPrefix, isReply, setSubjectPrefixattachError, attachError, buildAlteredMessage, changeSubject, getAttachmentType, getFakeDomainCheck, getFakeDomainCheck, getInLineType, getMessageHeaders, getPassThrough, getRecipients, getReplyTo, getReversePath, getSender, getSpecialAddress, getSubject, getSubjectPrefix, getTo, getTypeCode, init, isReply, isStatic, replaceInternetAddresses, replaceMailAddresses, senderDomainIsValid, setDNSService, setIsReply, setRecipients, setReplyTo, setReversePath, setSender, setTopublic String getMailetInfo()
getMailetInfo in interface org.apache.mailet.MailetgetMailetInfo in class org.apache.mailet.base.GenericMailetprotected String[] getAllowedInitParameters()
getAllowedInitParameters in class AbstractRedirectprotected Collection getRecipients()
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 AbstractNotifySpecialAddress.REVERSE_PATHprotected javax.mail.internet.InternetAddress[] getTo()
AbstractRedirectto property. Returns the "To:" recipients of the
new message. or null if no change is requested. Is a "getX()" method.getTo in class AbstractNotifySpecialAddress.REVERSE_PATHprotected org.apache.mailet.MailAddress getReversePath(org.apache.mailet.Mail originalMail)
AbstractRedirectreversePath property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getReversePath in class AbstractNotifySpecialAddress.NULL (the meaning of bounce)public void service(org.apache.mailet.Mail originalMail)
throws javax.mail.MessagingException
service in interface org.apache.mailet.Mailetservice in class AbstractRedirectoriginalMail - the mail to process and redirectjavax.mail.MessagingException - if a problem arises formulating the redirected mailCopyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.