Java Doc for Redirect.java in  » Web-Mail » james-2.3.1 » org » apache » james » transport » mailets » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Mail » james 2.3.1 » org.apache.james.transport.mailets 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.james.transport.mailets.AbstractRedirect
   org.apache.james.transport.mailets.Redirect

Redirect
public class Redirect extends AbstractRedirect (Code)

A mailet providing configurable redirection services.

Can produce listserver, forward and notify behaviour, with the original message intact, attached, appended or left out altogether.

It differs from Resend because (i) some defaults are different, notably for the following parameters: <recipients>, <to>, <reversePath> and <inline>; (ii) because it allows the use of the <static> parameter;.
Use Resend if you need full control, Redirect if the more automatic behaviour of some parameters is appropriate.

This built in functionality is controlled by the configuration as laid out below. In the table please note that the parameters controlling message headers accept the "unaltered" value, whose meaning is to keep the associated header unchanged and, unless stated differently, corresponds to the assumed default if the parameter is missing.

The configuration parameters are:

<recipients> A comma delimited list of addresses for recipients of this message; it will use the "to" list if not specified, and "unaltered" if none of the lists is specified.
These addresses will only appear in the To: header if no "to" list is supplied.
Such addresses can contain "full names", like Mr. John D. Smith <john.smith@xyz.com>.
The list can include constants "sender", "from", "replyTo", "postmaster", "reversePath", "recipients", "to", "null" and "unaltered"; "replyTo" uses the ReplyTo header if available, otherwise the From header if available, otherwise the Sender header if available, otherwise the return-path; "from" is made equivalent to "sender", and "to" is made equivalent to "recipients"; "null" is ignored.
<to> A comma delimited list of addresses to appear in the To: header; the email will be delivered to any of these addresses if it is also in the recipients list.
The recipients list will be used if this list is not supplied; if none of the lists is specified it will be "unaltered".
Such addresses can contain "full names", like Mr. John D. Smith <john.smith@xyz.com>.
The list can include constants "sender", "from", "replyTo", "postmaster", "reversePath", "recipients", "to", "null" and "unaltered"; "from" uses the From header if available, otherwise the Sender header if available, otherwise the return-path; "replyTo" uses the ReplyTo header if available, otherwise the From header if available, otherwise the Sender header if available, otherwise the return-path; "recipients" is made equivalent to "to"; if "null" is specified alone it will remove this header.
<sender> A single email address to appear in the From: and Return-Path: headers and become the sender.
It can include constants "sender", "postmaster" and "unaltered"; "sender" is equivalent to "unaltered".
Default: "unaltered".
<message> A text message to insert into the body of the email.
Default: no message is inserted.
<inline>

One of the following items:

  • unaltered     The original message is the new message, for forwarding/aliasing
  • heads          The headers of the original message are appended to the message
  • body           The body of the original is appended to the new message
  • all               Both headers and body are appended
  • none           Neither body nor headers are appended
Default: "body".
<attachment>

One of the following items:

  • heads      The headers of the original are attached as text
  • body       The body of the original is attached as text
  • all           Both headers and body are attached as a single text file
  • none       Nothing is attached
  • message  The original message is attached as type message/rfc822, this means that it can, in many cases, be opened, resent, fw'd, replied to etc by email client software.
Default: "none".
<passThrough> true or false, if true the original message continues in the mailet processor after this mailet is finished. False causes the original to be stopped.
Default: false.
<fakeDomainCheck> true or false, if true will check if the sender domain is valid.
Default: true.
<attachError> true or false, if true any error message available to the mailet is appended to the message body (except in the case of inline == unaltered).
Default: false.
<replyTo> A single email address to appear in the Reply-To: header.
It can include constants "sender", "postmaster" "null" and "unaltered"; if "null" is specified it will remove this header.
Default: "unaltered".
<reversePath> A single email address to appear in the Return-Path: header.
It can include constants "sender", "postmaster" and "null"; if "null" is specified then it will set it to <>, meaning "null return path".
Notice: the "unaltered" value is not allowed.
Default: the value of the <sender> parameter, if set, otherwise remains unaltered.
<subject> An optional string to use as the subject.
Default: keep the original message subject.
<prefix> An optional subject prefix prepended to the original message subject, or to a new subject specified with the <subject> parameter.
For example: [Undeliverable mail].
Default: "".
<isReply> true or false, if true the IN_REPLY_TO header will be set to the id of the current message.
Default: false.
<debug> true or false. If this is true it tells the mailet to write some debugging information to the mailet log.
Default: false.
<static> true or false. If this is true it tells the mailet that it can reuse all the initial parameters (to, from, etc) without re-calculating their values. This will boost performance where a redirect task doesn't contain any dynamic values. If this is false, it tells the mailet to recalculate the values for each e-mail processed.
Default: false.

Example:


 <mailet match="RecipientIs=test@localhost" class="Redirect">
 <recipients>x@localhost, y@localhost, z@localhost</recipients>
 <to>list@localhost</to>
 <sender>owner@localhost</sender>
 <message>sent on from James</message>
 <inline>unaltered</inline>
 <passThrough>FALSE</passThrough>
 <replyTo>postmaster</replyTo>
 <prefix xml:space="preserve">[test mailing] </prefix>
 <!-- note the xml:space="preserve" to preserve whitespace -->
 <static>TRUE</static>
 </mailet>
 

and:


 <mailet match="All" class="Redirect">
 <recipients>x@localhost</recipients>
 <sender>postmaster</sender>
 <message xml:space="preserve">Message marked as spam:</message>
 <inline>heads</inline>
 <attachment>message</attachment>
 <passThrough>FALSE</passThrough>
 <attachError>TRUE</attachError>
 <replyTo>postmaster</replyTo>
 <prefix>[spam notification]</prefix>
 <static>TRUE</static>
 </mailet>
 

replyto can be used instead of replyTo; such name is kept for backward compatibility.


version:
   CVS $Revision: 494012 $ $Date: 2007-01-08 11:23:58 +0100 (Mo, 08 Jan 2007) $




Method Summary
protected  String[]getAllowedInitParameters()
     Gets the expected init parameters.
protected  intgetInLineType()
    
public  StringgetMailetInfo()
     Returns a string describing this mailet.
protected  CollectiongetRecipients()
    
protected  MailAddressgetReversePath()
    
protected  MailAddressgetReversePath(Mail originalMail)
    
protected  InternetAddress[]getTo()
    
protected  booleanisStatic()
    



Method Detail
getAllowedInitParameters
protected String[] getAllowedInitParameters()(Code)
Gets the expected init parameters.



getInLineType
protected int getInLineType() throws MessagingException(Code)
the inline init parameter



getMailetInfo
public String getMailetInfo()(Code)
Returns a string describing this mailet. a string describing this mailet



getRecipients
protected Collection getRecipients() throws MessagingException(Code)
the recipients init parameteror the postmaster addressor SpecialAddress.SENDERor SpecialAddress.REVERSE_PATHor SpecialAddress.UNALTEREDor the to init parameter if missingor null if also the latter is missing



getReversePath
protected MailAddress getReversePath() throws MessagingException(Code)
the reversePath init parameter or the postmaster addressor SpecialAddress.SENDERor SpecialAddress.NULLor null if missing



getReversePath
protected MailAddress getReversePath(Mail originalMail) throws MessagingException(Code)
AbstractRedirect.getReversePath;if null return AbstractRedirect.getSender(Mail),meaning the new requested sender if any



getTo
protected InternetAddress[] getTo() throws MessagingException(Code)
the to init parameteror the postmaster addressor SpecialAddress.SENDERor SpecialAddress.REVERSE_PATHor SpecialAddress.UNALTEREDor the recipients init parameter if missingor null if also the latter is missing



isStatic
protected boolean isStatic()(Code)
the static init parameter



Fields inherited from org.apache.james.transport.mailets.AbstractRedirect
final protected static int ALL(Code)(Java Doc)
final protected static int BODY(Code)(Java Doc)
final protected static int HEADS(Code)(Java Doc)
final protected static int MESSAGE(Code)(Java Doc)
final protected static int NONE(Code)(Java Doc)
final protected static int UNALTERED(Code)(Java Doc)
protected boolean isDebug(Code)(Java Doc)
protected boolean isStatic(Code)(Java Doc)

Methods inherited from org.apache.james.transport.mailets.AbstractRedirect
protected boolean attachError() throws MessagingException(Code)(Java Doc)
protected boolean attachError(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected void buildAlteredMessage(Mail newMail, Mail originalMail) throws MessagingException(Code)(Java Doc)
public static void changeSubject(MimeMessage message, String newValue) throws MessagingException(Code)(Java Doc)
protected String[] getAllowedInitParameters()(Code)(Java Doc)
protected int getAttachmentType() throws MessagingException(Code)(Java Doc)
protected int getAttachmentType(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected boolean getFakeDomainCheck() throws MessagingException(Code)(Java Doc)
protected boolean getFakeDomainCheck(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected int getInLineType() throws MessagingException(Code)(Java Doc)
protected int getInLineType(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected String getMessage() throws MessagingException(Code)(Java Doc)
protected String getMessage(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected String getMessageHeaders(MimeMessage message) throws MessagingException(Code)(Java Doc)
protected boolean getPassThrough() throws MessagingException(Code)(Java Doc)
protected boolean getPassThrough(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected Collection getRecipients() throws MessagingException(Code)(Java Doc)
protected Collection getRecipients(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected MailAddress getReplyTo() throws MessagingException(Code)(Java Doc)
protected MailAddress getReplyTo(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected MailAddress getReversePath() throws MessagingException(Code)(Java Doc)
protected MailAddress getReversePath(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected MailAddress getSender() throws MessagingException(Code)(Java Doc)
protected MailAddress getSender(Mail originalMail) throws MessagingException(Code)(Java Doc)
final protected MailAddress getSpecialAddress(String addressString, String[] allowedSpecials) throws MessagingException(Code)(Java Doc)
protected String getSubject() throws MessagingException(Code)(Java Doc)
protected String getSubject(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected String getSubjectPrefix() throws MessagingException(Code)(Java Doc)
protected String getSubjectPrefix(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected InternetAddress[] getTo() throws MessagingException(Code)(Java Doc)
protected InternetAddress[] getTo(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected int getTypeCode(String param)(Code)(Java Doc)
public void init() throws MessagingException(Code)(Java Doc)
protected boolean isReply() throws MessagingException(Code)(Java Doc)
protected boolean isReply(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected boolean isStatic()(Code)(Java Doc)
protected Collection replaceInternetAddresses(Mail mail, Collection list) throws MessagingException(Code)(Java Doc)
protected Collection replaceMailAddresses(Mail mail, Collection list)(Code)(Java Doc)
final protected boolean senderDomainIsValid(Mail mail) throws MessagingException(Code)(Java Doc)
public void service(Mail originalMail) throws MessagingException(Code)(Java Doc)
protected void setIsReply(Mail newMail, boolean isReply, Mail originalMail) throws MessagingException(Code)(Java Doc)
protected void setRecipients(Mail newMail, Collection recipients, Mail originalMail) throws MessagingException(Code)(Java Doc)
protected void setReplyTo(Mail newMail, MailAddress replyTo, Mail originalMail) throws MessagingException(Code)(Java Doc)
protected void setReversePath(MailImpl newMail, MailAddress reversePath, Mail originalMail) throws MessagingException(Code)(Java Doc)
protected void setSender(Mail newMail, MailAddress sender, Mail originalMail) throws MessagingException(Code)(Java Doc)
protected void setSubjectPrefix(Mail newMail, String subjectPrefix, Mail originalMail) throws MessagingException(Code)(Java Doc)
protected void setTo(Mail newMail, InternetAddress[] to, Mail originalMail) throws MessagingException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.