|
|||||||||||
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
org.apache.james.transport.mailets.DSNBounce
Generates a Delivery Status Notification (DSN) 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.
Supports the passThrough
init parameter (true if missing).
Sample configuration:
<mailet match="All" class="DSNBounce">
<sender>an address or postmaster or sender or unaltered,
default=postmaster</sender>
<prefix>optional subject prefix prepended to the original
message</prefix>
<attachment>message, heads or none, default=message</attachment>
<messageString>the message sent in the bounce, the first occurrence of the pattern [machine] is replaced with the name of the executing machine, default=Hi. This is the James mail server at [machine] ... </messageString>
<passThrough>true or false, default=true</passThrough>
<debug>true or false, default=false</debug>
</mailet>
AbstractNotify
Nested Class Summary |
Nested classes 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 | |
DSNBounce()
|
Method Summary | |
protected MimeBodyPart |
createAttachedOriginal(Mail originalMail,
int attachmentType)
Create a MimeBodyPart with the original Mail as Attachment |
protected MimeBodyPart |
createDSN(Mail originalMail)
creates the DSN-bodypart for automated processing |
protected MimeBodyPart |
createTextMsg(Mail originalMail)
Create a MimeBodyPart with a textual description for human readers. |
protected String[] |
getAllowedInitParameters()
Gets the expected init parameters. |
protected int |
getAttachmentType()
Gets the attachment property.
|
protected String |
getErrorMsg(MessagingException me)
Utility method for getting the error message from the (nested) exception. |
String |
getMailetInfo()
Returns information about the mailet, such as author, version, and copyright. |
protected Collection |
getRecipients()
Gets the recipients property.
|
protected MailAddress |
getReversePath(Mail originalMail)
Gets the reversePath property,
built dynamically using the original Mail object.
|
protected String |
getStatus(MessagingException me)
Guessing status code by the exception provided. |
protected InternetAddress[] |
getTo()
Gets the to property.
|
void |
init()
Initialize the mailet |
protected String |
newName(Mail mail)
Create a unique new primary key name. |
void |
service(Mail originalMail)
Service does the hard work and bounces the originalMail in the format specified by RFC3464. |
Methods inherited from class org.apache.james.transport.mailets.AbstractNotify |
getInLineType, getMessage, getMessage, getPassThrough, getReplyTo, getSender, getSubject, getSubjectPrefix, isReply, setSubjectPrefix |
Methods inherited from class org.apache.james.transport.mailets.AbstractRedirect |
attachError, attachError, buildAlteredMessage, changeSubject, getAttachmentType, getFakeDomainCheck, getFakeDomainCheck, getInLineType, getMessageHeaders, getPassThrough, getRecipients, getReplyTo, getReversePath, getSender, getSpecialAddress, getSubject, getSubjectPrefix, getTo, getTypeCode, isReply, isStatic, replaceInternetAddresses, replaceMailAddresses, senderDomainIsValid, 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 DSNBounce()
Method Detail |
public void init() throws MessagingException
init
in class AbstractRedirect
MessagingException
public void service(Mail originalMail) throws MessagingException
service
in interface Mailet
service
in class AbstractRedirect
originalMail
- the mail to bounce
MessagingException
- if a problem arises formulating the redirected mailMailet.service(org.apache.mailet.Mail)
protected MimeBodyPart createTextMsg(Mail originalMail) throws MessagingException
originalMail
-
MessagingException
protected MimeBodyPart createDSN(Mail originalMail) throws MessagingException
originalMail
-
MessagingException
protected MimeBodyPart createAttachedOriginal(Mail originalMail, int attachmentType) throws MessagingException
originalMail
-
MessagingException
protected String getStatus(MessagingException me)
protected String getErrorMsg(MessagingException me)
protected String newName(Mail mail) throws MessagingException
mail
- the mail to use as the basis for the new mail name
MessagingException
public String getMailetInfo()
GenericMailet
getMailetInfo
in interface Mailet
getMailetInfo
in class GenericMailet
protected String[] getAllowedInitParameters()
getAllowedInitParameters
in class AbstractRedirect
protected int getAttachmentType() throws 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 attached
getAttachmentType
in class AbstractNotify
attachment
init parameter, or MESSAGE
if missing
MessagingException
protected 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
SpecialAddress.REVERSE_PATH
protected InternetAddress[] getTo()
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.REVERSE_PATH
protected MailAddress getReversePath(Mail originalMail)
AbstractRedirect
reversePath
property,
built dynamically using the original Mail object.
Is a "getX(Mail)" method.
getReversePath
in class AbstractNotify
SpecialAddress.NULL
(the meaning of bounce)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |