| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mailet.base.GenericMailet
org.apache.james.transport.mailets.AbstractRedirect
org.apache.james.transport.mailets.AbstractNotify
org.apache.james.transport.mailets.DSNBounce
public class 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/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 | |
|---|---|
| DSNBounce() | |
| Method Summary | |
|---|---|
| protected  javax.mail.internet.MimeBodyPart | createAttachedOriginal(org.apache.mailet.Mail originalMail,
                       int attachmentType)Create a MimeBodyPart with the original Mail as Attachment | 
| protected  javax.mail.internet.MimeBodyPart | createDSN(org.apache.mailet.Mail originalMail)creates the DSN-bodypart for automated processing | 
| protected  javax.mail.internet.MimeBodyPart | createTextMsg(org.apache.mailet.Mail originalMail)Create a MimeBodyPart with a textual description for human readers. | 
| protected  java.lang.String[] | getAllowedInitParameters()Gets the expected init parameters. | 
| protected  int | getAttachmentType()Gets the attachmentproperty. | 
| protected  java.lang.String | getErrorMsg(javax.mail.MessagingException me)Utility method for getting the error message from the (nested) exception. | 
|  java.lang.String | getMailetInfo() | 
| protected  java.util.Collection | getRecipients()Gets the recipientsproperty. | 
| protected  org.apache.mailet.MailAddress | getReversePath(org.apache.mailet.Mail originalMail)Gets the reversePathproperty,
 built dynamically using the original Mail object. | 
| protected  java.lang.String | getStatus(javax.mail.MessagingException me)Guessing status code by the exception provided. | 
| protected  javax.mail.internet.InternetAddress[] | getTo()Gets the toproperty. | 
|  void | init()Initialize the mailet | 
|  void | service(org.apache.mailet.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.base.GenericMailet | 
|---|
| arrayToString, checkInitParameters, destroy, getInitParameter, 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 javax.mail.MessagingException
init in class AbstractRedirectjavax.mail.MessagingException
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 bounce
javax.mail.MessagingException - if a problem arises formulating the redirected mailMailet.service(org.apache.mailet.Mail)
protected javax.mail.internet.MimeBodyPart createTextMsg(org.apache.mailet.Mail originalMail)
                                                  throws javax.mail.MessagingException
originalMail - 
javax.mail.MessagingException
protected javax.mail.internet.MimeBodyPart createDSN(org.apache.mailet.Mail originalMail)
                                              throws javax.mail.MessagingException
originalMail - 
javax.mail.MessagingException
protected javax.mail.internet.MimeBodyPart createAttachedOriginal(org.apache.mailet.Mail originalMail,
                                                                  int attachmentType)
                                                           throws javax.mail.MessagingException
originalMail - 
javax.mail.MessagingExceptionprotected java.lang.String getStatus(javax.mail.MessagingException me)
me - the MessagingException of which the statusCode should be generated
protected java.lang.String getErrorMsg(javax.mail.MessagingException me)
me - MessagingException
public java.lang.String getMailetInfo()
getMailetInfo in interface org.apache.mailet.MailetgetMailetInfo in class org.apache.mailet.base.GenericMailetprotected java.lang.String[] getAllowedInitParameters()
getAllowedInitParameters in class AbstractRedirect
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 AbstractNotifyattachment init parameter, or MESSAGE if missing
javax.mail.MessagingExceptionprotected java.util.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)| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||