Source Code Cross Referenced for Resend.java in  » Net » 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 » Net » james 2.3.1 » org.apache.james.transport.mailets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /****************************************************************
002:         * Licensed to the Apache Software Foundation (ASF) under one   *
003:         * or more contributor license agreements.  See the NOTICE file *
004:         * distributed with this work for additional information        *
005:         * regarding copyright ownership.  The ASF licenses this file   *
006:         * to you under the Apache License, Version 2.0 (the            *
007:         * "License"); you may not use this file except in compliance   *
008:         * with the License.  You may obtain a copy of the License at   *
009:         *                                                              *
010:         *   http://www.apache.org/licenses/LICENSE-2.0                 *
011:         *                                                              *
012:         * Unless required by applicable law or agreed to in writing,   *
013:         * software distributed under the License is distributed on an  *
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
015:         * KIND, either express or implied.  See the License for the    *
016:         * specific language governing permissions and limitations      *
017:         * under the License.                                           *
018:         ****************************************************************/package org.apache.james.transport.mailets;
019:
020:        /**
021:         * <P>A mailet providing configurable redirection services.</P>
022:         * <P>Can produce listserver, forward and notify behaviour, with the original
023:         * message intact, attached, appended or left out altogether.
024:         * Can be used as a replacement to {@link Redirect}, having more consistent defaults,
025:         * and new options available.<BR>
026:         * Use <CODE>Resend</CODE> if you need full control, <CODE>Redirect</CODE> if
027:         * the more automatic behaviour of some parameters is appropriate.</P>
028:         * <P>This built in functionality is controlled by the configuration as laid out below.
029:         * In the table please note that the parameters controlling message headers
030:         * accept the <B>&quot;unaltered&quot;</B> value, whose meaning is to keep the associated
031:         * header unchanged and, unless stated differently, corresponds to the assumed default
032:         * if the parameter is missing.</P>
033:         * <P>The configuration parameters are:</P>
034:         * <TABLE width="75%" border="1" cellspacing="2" cellpadding="2">
035:         * <TR valign=top>
036:         * <TD width="20%">&lt;recipients&gt;</TD>
037:         * <TD width="80%">
038:         * A comma delimited list of addresses for recipients of this message.<BR>
039:         * Such addresses can contain &quot;full names&quot;, like
040:         * <I>Mr. John D. Smith &lt;john.smith@xyz.com&gt;</I>.<BR>
041:         * The list can include constants &quot;sender&quot;, &quot;from&quot;, &quot;replyTo&quot;, &quot;postmaster&quot;, &quot;reversePath&quot;, &quot;recipients&quot;, &quot;to&quot;, &quot;null&quot; and &quot;unaltered&quot;;
042:         * &quot;replyTo&quot; uses the ReplyTo header if available, otherwise the
043:         * From header if available, otherwise the Sender header if available, otherwise the return-path;
044:         * &quot;from&quot; is made equivalent to &quot;sender&quot;, and &quot;to&quot; is made equivalent to &quot;recipients&quot;;
045:         * &quot;null&quot; is ignored.
046:         * Default: &quot;unaltered&quot;.
047:         * </TD>
048:         * </TR>
049:         * <TR valign=top>
050:         * <TD width="20%">&lt;to&gt;</TD>
051:         * <TD width="80%">
052:         * A comma delimited list of addresses to appear in the To: header.<BR>
053:         * Such addresses can contain &quot;full names&quot;, like
054:         * <I>Mr. John D. Smith &lt;john.smith@xyz.com&gt;</I>.<BR>
055:         * The list can include constants &quot;sender&quot;, &quot;from&quot;, &quot;replyTo&quot;, &quot;postmaster&quot;, &quot;reversePath&quot;, &quot;recipients&quot;, &quot;to&quot;, &quot;null&quot; and &quot;unaltered&quot;;
056:         * &quot;from&quot; uses the From header if available, otherwise the Sender header if available,
057:         * otherwise the return-path;
058:         * &quot;replyTo&quot; uses the ReplyTo header if available, otherwise the
059:         * From header if available, otherwise the Sender header if available, otherwise the return-path;
060:         * &quot;recipients&quot; is made equivalent to &quot;to&quot;;
061:         * if &quot;null&quot; is specified alone it will remove this header.
062:         * Default: &quot;unaltered&quot;.
063:         * </TD>
064:         * </TR>
065:         * <TR valign=top>
066:         * <TD width="20%">&lt;sender&gt;</TD>
067:         * <TD width="80%">
068:         * A single email address to appear in the From: header and become the sender.<BR>
069:         * It can include constants &quot;sender&quot;, &quot;postmaster&quot; and &quot;unaltered&quot;;
070:         * &quot;sender&quot; is equivalent to &quot;unaltered&quot;.<BR>
071:         * Default: &quot;unaltered&quot;.
072:         * </TD>
073:         * </TR>
074:         * <TR valign=top>
075:         * <TD width="20%">&lt;message&gt;</TD>
076:         * <TD width="80%">
077:         * A text message to insert into the body of the email.<BR>
078:         * Default: no message is inserted.
079:         * </TD>
080:         * </TR>
081:         * <TR valign=top>
082:         * <TD width="20%">&lt;inline&gt;</TD>
083:         * <TD width="80%">
084:         * <P>One of the following items:</P>
085:         * <UL>
086:         * <LI>unaltered &nbsp;&nbsp;&nbsp;&nbsp;The original message is the new
087:         * message, for forwarding/aliasing</LI>
088:         * <LI>heads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The
089:         * headers of the original message are appended to the message</LI>
090:         * <LI>body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The
091:         * body of the original is appended to the new message</LI>
092:         * <LI>all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Both
093:         * headers and body are appended</LI>
094:         * <LI>none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Neither
095:         * body nor headers are appended</LI>
096:         * </UL>
097:         * Default: &quot;unaltered&quot;.
098:         * </TD>
099:         * </TR>
100:         * <TR valign=top>
101:         * <TD width="20%">&lt;attachment&gt;</TD>
102:         * <TD width="80%">
103:         * <P>One of the following items:</P>
104:         * <UL>
105:         * <LI>heads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The headers of the original
106:         * are attached as text</LI>
107:         * <LI>body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The body of the original
108:         * is attached as text</LI>
109:         * <LI>all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Both
110:         * headers and body are attached as a single text file</LI>
111:         * <LI>none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nothing is attached</LI>
112:         * <LI>message &nbsp;The original message is attached as type message/rfc822,
113:         * this means that it can, in many cases, be opened, resent, fw'd, replied
114:         * to etc by email client software.</LI>
115:         * </UL>
116:         * Default: &quot;none&quot;.
117:         * </TD>
118:         * </TR>
119:         * <TR valign=top>
120:         * <TD width="20%">&lt;passThrough&gt;</TD>
121:         * <TD width="80%">
122:         * true or false, if true the original message continues in the
123:         * mailet processor after this mailet is finished. False causes the original
124:         * to be stopped.<BR>
125:         * Default: false.
126:         * </TD>
127:         * </TR>
128:         * <TR valign=top>
129:         * <TD width="20%">&lt;fakeDomainCheck&gt;</TD>
130:         * <TD width="80%">
131:         * true or false, if true will check if the sender domain is valid.<BR>
132:         * Default: true.
133:         * </TD>
134:         * </TR>
135:         * <TR valign=top>
136:         * <TD width="20%">&lt;attachError&gt;</TD>
137:         * <TD width="80%">
138:         * true or false, if true any error message available to the
139:         * mailet is appended to the message body (except in the case of inline ==
140:         * unaltered).<BR>
141:         * Default: false.
142:         * </TD>
143:         * </TR>
144:         * <TR valign=top>
145:         * <TD width="20%">&lt;replyTo&gt;</TD>
146:         * <TD width="80%">
147:         * A single email address to appear in the Reply-To: header.<BR>
148:         * It can include constants &quot;sender&quot;, &quot;postmaster&quot; &quot;null&quot; and &quot;unaltered&quot;;
149:         * if &quot;null&quot; is specified it will remove this header.<BR>
150:         * Default: &quot;unaltered&quot;.
151:         * </TD>
152:         * </TR>
153:         * <TR valign=top>
154:         * <TD width="20%">&lt;reversePath&gt;</TD>
155:         * <TD width="80%">
156:         * A single email address to appear in the Return-Path: header.<BR>
157:         * It can include constants &quot;sender&quot;, &quot;postmaster&quot; &quot;null&quot; and &quot;unaltered&quot;;
158:         * if &quot;null&quot; is specified then it will set it to <>, meaning &quot;null return path&quot;.<BR>
159:         * Default: &quot;unaltered&quot;.
160:         * </TD>
161:         * </TR>
162:         * <TR valign=top>
163:         * <TD width="20%">&lt;subject&gt;</TD>
164:         * <TD width="80%">
165:         * An optional string to use as the subject.<BR>
166:         * Default: keep the original message subject.
167:         * </TD>
168:         * </TR>
169:         * <TR valign=top>
170:         * <TD width="20%">&lt;prefix&gt;</TD>
171:         * <TD width="80%">
172:         * An optional subject prefix prepended to the original message
173:         * subject, or to a new subject specified with the <I>&lt;subject&gt;</I> parameter.<BR>
174:         * For example: <I>[Undeliverable mail]</I>.<BR>
175:         * Default: &quot;&quot;.
176:         * </TD>
177:         * </TR>
178:         * <TR valign=top>
179:         * <TD width="20%">&lt;isReply&gt;</TD>
180:         * <TD width="80%">
181:         * true or false, if true the IN_REPLY_TO header will be set to the
182:         * id of the current message.<BR>
183:         * Default: false.
184:         * </TD>
185:         * </TR>
186:         * <TR valign=top>
187:         * <TD width="20%">&lt;debug&gt;</TD>
188:         * <TD width="80%">
189:         * true or false.  If this is true it tells the mailet to write some debugging
190:         * information to the mailet log.<BR>
191:         * Default: false.
192:         * </TD>
193:         * </TR>
194:         * </TABLE>
195:         *
196:         * <P>Example:</P>
197:         * <PRE><CODE>
198:         *  &lt;mailet match=&quot;RecipientIs=test@localhost&quot; class=&quot;Resend&quot;&gt;
199:         *    &lt;recipients&gt;x@localhost, y@localhost, z@localhost&lt;/recipients&gt;
200:         *    &lt;to&gt;list@localhost&lt;/to&gt;
201:         *    &lt;sender&gt;owner@localhost&lt;/sender&gt;
202:         *    &lt;message&gt;sent on from James&lt;/message&gt;
203:         *    &lt;inline&gt;unaltered&lt;/inline&gt;
204:         *    &lt;passThrough&gt;FALSE&lt;/passThrough&gt;
205:         *    &lt;replyTo&gt;postmaster&lt;/replyTo&gt;
206:         *    &lt;prefix xml:space="preserve"&gt;[test mailing] &lt;/prefix&gt;
207:         *    &lt;!-- note the xml:space="preserve" to preserve whitespace --&gt;
208:         *    &lt;static&gt;TRUE&lt;/static&gt;
209:         * &lt;/mailet&gt;
210:         * </CODE></PRE>
211:         * 
212:         * <P>and:</P>
213:         *
214:         * <PRE><CODE>
215:         *  &lt;mailet match=&quot;All&quot; class=&quot;Resend&quot;&gt;
216:         *    &lt;recipients&gt;x@localhost&lt;/recipients&gt;
217:         *    &lt;sender&gt;postmaster&lt;/sender&gt;
218:         *    &lt;message xml:space="preserve"&gt;Message marked as spam:&lt;/message&gt;
219:         *    &lt;inline&gt;heads&lt;/inline&gt;
220:         *    &lt;attachment&gt;message&lt;/attachment&gt;
221:         *    &lt;passThrough&gt;FALSE&lt;/passThrough&gt;
222:         *    &lt;attachError&gt;TRUE&lt;/attachError&gt;
223:         *    &lt;replyTo&gt;postmaster&lt;/replyTo&gt;
224:         *    &lt;prefix&gt;[spam notification]&lt;/prefix&gt;
225:         *  &lt;/mailet&gt;
226:         * </CODE></PRE>
227:         *
228:         * <P>The following example forwards the message without any modification, based on the defaults:</P>
229:         * <PRE><CODE>
230:         *  &lt;mailet match=&quot;All&quot; class=&quot;Resend&quot/;&gt;
231:         * </CODE></PRE>
232:         * <P><I>replyto</I> can be used instead of
233:         * <I>replyTo</I>; such name is kept for backward compatibility.</P>
234:         * <P><B>WARNING: as the message (or a copy of it) is reinjected in the spool without any modification,
235:         * the preceding example is very likely to cause a "configuration loop" in your system,
236:         * unless some other mailet has previously modified something (a header for instance) that could force the resent
237:         * message follow a different path so that it does not return here unchanged.</B></P>
238:         *
239:         * @version CVS $Revision: 494012 $ $Date: 2007-01-08 11:23:58 +0100 (Mo, 08 Jan 2007) $
240:         * @since 2.2.0
241:         */
242:
243:        public class Resend extends AbstractRedirect {
244:
245:            /**
246:             * Returns a string describing this mailet.
247:             *
248:             * @return a string describing this mailet
249:             */
250:            public String getMailetInfo() {
251:                return "Redirect Mailet";
252:            }
253:
254:            /** Gets the expected init parameters. */
255:            protected String[] getAllowedInitParameters() {
256:                String[] allowedArray = {
257:                        //            "static",
258:                        "debug", "passThrough", "fakeDomainCheck", "inline",
259:                        "attachment", "message", "recipients", "to", "replyTo",
260:                        "replyto", "reversePath", "sender", "subject",
261:                        "prefix", "attachError", "isReply" };
262:                return allowedArray;
263:            }
264:
265:            /* ******************************************************************** */
266:            /* ****************** Begin of getX and setX methods ****************** */
267:            /* ******************************************************************** */
268:
269:            /* ******************************************************************** */
270:            /* ******************* End of getX and setX methods ******************* */
271:            /* ******************************************************************** */
272:
273:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.