Source Code Cross Referenced for AddHabeasWarrantMark.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:        import org.apache.james.transport.matchers.HasHabeasWarrantMark;
021:        import org.apache.mailet.GenericMailet;
022:        import org.apache.mailet.Mail;
023:
024:        /*
025:         * This matcher adds the Hebeas Warrant Mark to a message.
026:         * For details see: http://www.hebeas.com
027:         *
028:         * Usage: <mailet match="<suitable-matcher>" class="AddHabeasWarrantMark" />
029:         *
030:         * NOTE: Although this mailet is covered by the Apache Software License,
031:         * the Habeas Warrant Mark is copyright.  A separate license from Habeas
032:         * is required in order to legally attach the Habeas Warrant Mark to
033:         * e-mail messages.  Each James Administrator is responsible for
034:         * ensuring that James is configured to attach the Habeas Warrant Mark
035:         * only to e-mail covered by a suitable license received from Habeas.
036:         * 
037:         * Because the Habeas Warrant Mark is copyright material, I have asked
038:         * for and received the following explicit statement from Habeas:
039:         *
040:         * -----------------------------------
041:         * From: Lindsey Pettit [mailto:support@habeas.com]
042:         * Sent: Sunday, September 29, 2002 5:51
043:         * To: Noel J. Bergman
044:         * Subject: RE: Habeas and Apache James
045:         *
046:         * Dear Noel,
047:         * 
048:         * > FURTHERMORE, if James is to be capable of sending Habeas SWE, I need
049:         * > to write a Mailet that attaches the headers.  As with any MTA, it
050:         * > would be up to the administrator to properly configure James and make
051:         * > sure that licenses are acquired.  Since the Habeas Warrant Mark is
052:         * > copyright, I believe that I require authorization from you for that
053:         * > Mailet, especially since it attaches the Habeas Warrant Mark.  For my
054:         * > own protection, please show me why such authorization is unnecessary,
055:         * > send me a digitally signed e-mail, or FAX a signed authorization
056:         * 
057:         * You do not yourself need the authorization to build the functionality 
058:         * into the [mailet];  what one needs authorization, in the form of a 
059:         * license, for, is to use the mark *in headers*, in outgoing email.
060:         * However, please let me know if you would like something more 
061:         * formal, and I can try to have something faxed to you.
062:         * 
063:         * > The Mailet docs would reference the Habeas website, and inform
064:         * > administrators that in order to USE the mailet, they need to ensure
065:         * > that they have whatever licenses are required from you as appropriate
066:         * > to your licensing terms.
067:         * 
068:         * That's absolutely perfect!
069:         * -----------------------------------
070:         *
071:         */
072:
073:        public class AddHabeasWarrantMark extends GenericMailet {
074:            /**
075:             * Called by the mailet container to allow the mailet to process to
076:             * a message message.
077:             *
078:             * This method adds the Habeas Warrant Mark headers to the message,
079:             * saves the changes, and then allows the message to fall through
080:             * in the pipeline.
081:             *
082:             * @param mail - the Mail object that contains the message and routing information
083:             * @throws javax.mail.MessagingException - if an message or address parsing exception occurs or
084:             *      an exception that interferes with the mailet's normal operation
085:             */
086:            public void service(Mail mail) throws javax.mail.MessagingException {
087:                try {
088:                    javax.mail.internet.MimeMessage message = mail.getMessage();
089:
090:                    for (int i = 0; i < HasHabeasWarrantMark.warrantMark.length; i++) {
091:                        message.setHeader(
092:                                HasHabeasWarrantMark.warrantMark[i][0],
093:                                HasHabeasWarrantMark.warrantMark[i][1]);
094:                    }
095:
096:                    message.saveChanges();
097:                } catch (javax.mail.MessagingException me) {
098:                    log(me.getMessage());
099:                }
100:            }
101:
102:            /*
103:             * Return a string describing this mailet.
104:             *
105:             * @return a string describing this mailet
106:             */
107:            public String getMailetInfo() {
108:                return "Add Habeas Warrant Mark.  Must be used in accordance with a license from Habeas (see http://www.habeas.com for details).";
109:            }
110:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.