You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ad...@apache.org on 2016/10/05 06:35:57 UTC

[1/5] james-project git commit: JAMES-1830 Use unique version across the project

Repository: james-project
Updated Branches:
  refs/heads/master 7f381abff -> ad5950abc


JAMES-1830 Use unique version across the project


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/1fd9be99
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/1fd9be99
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/1fd9be99

Branch: refs/heads/master
Commit: 1fd9be99e1cf3fb8f6bd3c4223740b94877eb425
Parents: 396a950
Author: Benoit Tellier <bt...@linagora.com>
Authored: Tue Oct 4 11:48:19 2016 +0200
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Tue Oct 4 15:57:27 2016 +0200

----------------------------------------------------------------------
 backends-common/cassandra/pom.xml            |  2 +-
 backends-common/pom.xml                      |  2 +-
 mailbox/api/pom.xml                          |  4 +-
 mailbox/caching/pom.xml                      |  2 +-
 mailbox/cassandra/pom.xml                    |  2 +-
 mailbox/elasticsearch/pom.xml                |  2 +-
 mailbox/hbase/pom.xml                        |  2 +-
 mailbox/jcr/pom.xml                          |  2 +-
 mailbox/jpa/pom.xml                          |  2 +-
 mailbox/kafka/pom.xml                        |  2 +-
 mailbox/lucene/pom.xml                       |  2 +-
 mailbox/maildir/pom.xml                      |  2 +-
 mailbox/memory/pom.xml                       |  2 +-
 mailbox/pom.xml                              | 11 ++-
 mailbox/scanning-search/pom.xml              |  2 +-
 mailbox/spring/pom.xml                       |  2 +-
 mailbox/store/pom.xml                        |  2 +-
 mailbox/tika/pom.xml                         |  2 +-
 mailbox/tool/pom.xml                         |  2 +-
 mailbox/zoo-seq-provider/pom.xml             |  2 +-
 mailet/ai/pom.xml                            |  2 +-
 mailet/api/pom.xml                           |  2 +-
 mailet/base/pom.xml                          |  2 +-
 mailet/crypto/pom.xml                        |  2 +-
 mailet/mailetdocs-maven-plugin/pom.xml       |  2 +-
 mailet/pom.xml                               |  3 +-
 mailet/standard/pom.xml                      |  2 +-
 mpt/all/pom.xml                              |  2 +-
 mpt/antlib/pom.xml                           |  2 +-
 mpt/app/pom.xml                              |  2 +-
 mpt/core/pom.xml                             |  2 +-
 mpt/impl/imap-mailbox/cassandra/pom.xml      |  2 +-
 mpt/impl/imap-mailbox/core/pom.xml           |  2 +-
 mpt/impl/imap-mailbox/cyrus/pom.xml          |  2 +-
 mpt/impl/imap-mailbox/elasticsearch/pom.xml  |  2 +-
 mpt/impl/imap-mailbox/external-james/pom.xml |  2 +-
 mpt/impl/imap-mailbox/hbase/pom.xml          |  2 +-
 mpt/impl/imap-mailbox/inmemory/pom.xml       |  2 +-
 mpt/impl/imap-mailbox/jcr/pom.xml            |  2 +-
 mpt/impl/imap-mailbox/jpa/pom.xml            |  2 +-
 mpt/impl/imap-mailbox/maildir/pom.xml        |  2 +-
 mpt/impl/imap-mailbox/pom.xml                |  2 +-
 mpt/impl/managesieve/cassandra/pom.xml       |  2 +-
 mpt/impl/managesieve/core/pom.xml            |  3 +-
 mpt/impl/managesieve/file/pom.xml            |  4 +-
 mpt/impl/managesieve/pom.xml                 |  9 +--
 mpt/impl/smtp/cassandra/pom.xml              |  2 +-
 mpt/impl/smtp/core/pom.xml                   |  2 +-
 mpt/impl/smtp/pom.xml                        |  2 +-
 mpt/mavenplugin/pom.xml                      |  2 +-
 mpt/pom.xml                                  | 68 +++++++++++--------
 pom.xml                                      |  2 +-
 protocols/api/pom.xml                        |  2 +-
 protocols/imap/pom.xml                       |  2 +-
 protocols/lmtp/pom.xml                       |  2 +-
 protocols/managesieve/pom.xml                |  2 +-
 protocols/netty/pom.xml                      |  2 +-
 protocols/pom.xml                            | 13 ++--
 protocols/pop3/pom.xml                       |  2 +-
 protocols/smtp/pom.xml                       |  2 +-
 server/pom.xml                               | 82 +++++++++++------------
 61 files changed, 146 insertions(+), 155 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/backends-common/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/backends-common/cassandra/pom.xml b/backends-common/cassandra/pom.xml
index af87114..cc4d7cf 100644
--- a/backends-common/cassandra/pom.xml
+++ b/backends-common/cassandra/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <artifactId>james-backends-common</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.8.3-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-backends-cassandra</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/backends-common/pom.xml
----------------------------------------------------------------------
diff --git a/backends-common/pom.xml b/backends-common/pom.xml
index fc83424..d412c0d 100644
--- a/backends-common/pom.xml
+++ b/backends-common/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>james-project</artifactId>
-        <version>1.8.3-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>james-backends-common</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/api/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/api/pom.xml b/mailbox/api/pom.xml
index 0092d05..1b56a99 100644
--- a/mailbox/api/pom.xml
+++ b/mailbox/api/pom.xml
@@ -23,8 +23,8 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
+        <version>3.0.0-beta5-SNAPSHOT</version>
+        <relativePath>..</relativePath>
     </parent>
 
     <artifactId>apache-james-mailbox-api</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/caching/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/caching/pom.xml b/mailbox/caching/pom.xml
index 01501b1..78f7670 100644
--- a/mailbox/caching/pom.xml
+++ b/mailbox/caching/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/pom.xml b/mailbox/cassandra/pom.xml
index 2712b76..5695d41 100644
--- a/mailbox/cassandra/pom.xml
+++ b/mailbox/cassandra/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/elasticsearch/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/pom.xml b/mailbox/elasticsearch/pom.xml
index 5e43f4f..f107e22 100644
--- a/mailbox/elasticsearch/pom.xml
+++ b/mailbox/elasticsearch/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/hbase/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/hbase/pom.xml b/mailbox/hbase/pom.xml
index f173594..6ffd295 100644
--- a/mailbox/hbase/pom.xml
+++ b/mailbox/hbase/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/jcr/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/jcr/pom.xml b/mailbox/jcr/pom.xml
index e6a0c24..dbb6ac0 100644
--- a/mailbox/jcr/pom.xml
+++ b/mailbox/jcr/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/jpa/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/jpa/pom.xml b/mailbox/jpa/pom.xml
index b2627ea..995f0b2 100644
--- a/mailbox/jpa/pom.xml
+++ b/mailbox/jpa/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/kafka/pom.xml b/mailbox/kafka/pom.xml
index 66177e9..caf8d11 100644
--- a/mailbox/kafka/pom.xml
+++ b/mailbox/kafka/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/lucene/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/lucene/pom.xml b/mailbox/lucene/pom.xml
index 5edac5e..6cde6e2 100644
--- a/mailbox/lucene/pom.xml
+++ b/mailbox/lucene/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/maildir/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/maildir/pom.xml b/mailbox/maildir/pom.xml
index 699abef..3d8c864 100644
--- a/mailbox/maildir/pom.xml
+++ b/mailbox/maildir/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/memory/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/memory/pom.xml b/mailbox/memory/pom.xml
index a164e25..59df83a 100644
--- a/mailbox/memory/pom.xml
+++ b/mailbox/memory/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/pom.xml b/mailbox/pom.xml
index 1a23088..b3cde40 100644
--- a/mailbox/pom.xml
+++ b/mailbox/pom.xml
@@ -23,11 +23,10 @@
     <parent>
         <artifactId>james-project</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.8.3-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mailbox</artifactId>
-    <version>0.6-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <repositories>
@@ -112,7 +111,6 @@
         <xml-apis.version>1.3.04</xml-apis.version>
         <geronimo-annotation-spec.version>1.1.1</geronimo-annotation-spec.version>
         <geronimo-activation-spec.version>1.1</geronimo-activation-spec.version>
-        <apache-mailet.version>2.5.1-SNAPSHOT</apache-mailet.version>
         <slf4j.version>1.7.7</slf4j.version>
         <junit.version>4.11</junit.version>
         <mockito-core.version>1.9.0</mockito-core.version>
@@ -122,7 +120,6 @@
         <jackson-databinding.version>2.6.3</jackson-databinding.version>
         <cassandra-driver-core.version>2.1.8</cassandra-driver-core.version>
         <cassandra-unit.version>2.1.9.2</cassandra-unit.version>
-        <apache-backends-cassandra.version>1.8.3-SNAPSHOT</apache-backends-cassandra.version>
         <assertj-1.version>1.7.1</assertj-1.version>
         <assertj-3.version>3.2.0</assertj-3.version>
         <logback.version>1.1.7</logback.version>
@@ -275,7 +272,7 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-mailet-api</artifactId>
-                <version>${apache-mailet.version}</version>
+                <version>${project.version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>javax.mail</groupId>
@@ -290,12 +287,12 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-backends-cassandra</artifactId>
-                <version>${apache-backends-cassandra.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-backends-cassandra</artifactId>
-                <version>${apache-backends-cassandra.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
             </dependency>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/scanning-search/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/scanning-search/pom.xml b/mailbox/scanning-search/pom.xml
index 90eacb9..24bb906 100644
--- a/mailbox/scanning-search/pom.xml
+++ b/mailbox/scanning-search/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/spring/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/spring/pom.xml b/mailbox/spring/pom.xml
index 5f17057..216c958 100644
--- a/mailbox/spring/pom.xml
+++ b/mailbox/spring/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/store/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/store/pom.xml b/mailbox/store/pom.xml
index 60ebc49..635b6d0 100644
--- a/mailbox/store/pom.xml
+++ b/mailbox/store/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/tika/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/tika/pom.xml b/mailbox/tika/pom.xml
index 419479c..506f151 100644
--- a/mailbox/tika/pom.xml
+++ b/mailbox/tika/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
 
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/tool/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/tool/pom.xml b/mailbox/tool/pom.xml
index 75af67d..90467a1 100644
--- a/mailbox/tool/pom.xml
+++ b/mailbox/tool/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailbox/zoo-seq-provider/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/zoo-seq-provider/pom.xml b/mailbox/zoo-seq-provider/pom.xml
index 303aafe..0383f3d 100644
--- a/mailbox/zoo-seq-provider/pom.xml
+++ b/mailbox/zoo-seq-provider/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.6-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailet/ai/pom.xml
----------------------------------------------------------------------
diff --git a/mailet/ai/pom.xml b/mailet/ai/pom.xml
index 6d38c2f..c9cd5b7 100644
--- a/mailet/ai/pom.xml
+++ b/mailet/ai/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>apache-mailet</artifactId>
-        <version>2.5.1-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailet/api/pom.xml
----------------------------------------------------------------------
diff --git a/mailet/api/pom.xml b/mailet/api/pom.xml
index ba1cbea..4d45217 100644
--- a/mailet/api/pom.xml
+++ b/mailet/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>apache-mailet</artifactId>
-        <version>2.5.1-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailet/base/pom.xml
----------------------------------------------------------------------
diff --git a/mailet/base/pom.xml b/mailet/base/pom.xml
index d67639f..d7f89da 100644
--- a/mailet/base/pom.xml
+++ b/mailet/base/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>apache-mailet</artifactId>
-        <version>2.5.1-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailet/crypto/pom.xml
----------------------------------------------------------------------
diff --git a/mailet/crypto/pom.xml b/mailet/crypto/pom.xml
index 622004c..ac140ad 100644
--- a/mailet/crypto/pom.xml
+++ b/mailet/crypto/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>apache-mailet</artifactId>
-        <version>2.5.1-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailet/mailetdocs-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/mailet/mailetdocs-maven-plugin/pom.xml b/mailet/mailetdocs-maven-plugin/pom.xml
index 6076865..b529f03 100644
--- a/mailet/mailetdocs-maven-plugin/pom.xml
+++ b/mailet/mailetdocs-maven-plugin/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>apache-mailet</artifactId>
-        <version>2.5.1-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailet/pom.xml
----------------------------------------------------------------------
diff --git a/mailet/pom.xml b/mailet/pom.xml
index 8ddde4a..a7c1047 100644
--- a/mailet/pom.xml
+++ b/mailet/pom.xml
@@ -24,11 +24,10 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>james-project</artifactId>
-        <version>1.8.3-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-mailet</artifactId>
-    <version>2.5.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache James :: Mailets parent and aggregator</name>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mailet/standard/pom.xml
----------------------------------------------------------------------
diff --git a/mailet/standard/pom.xml b/mailet/standard/pom.xml
index 1ca1f89..c48b981 100644
--- a/mailet/standard/pom.xml
+++ b/mailet/standard/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>apache-mailet</artifactId>
-        <version>2.5.1-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/all/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/all/pom.xml b/mpt/all/pom.xml
index ca51990..64b9ea5 100644
--- a/mpt/all/pom.xml
+++ b/mpt/all/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <artifactId>apache-james-mpt</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>apache-james-mpt-all</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/antlib/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/antlib/pom.xml b/mpt/antlib/pom.xml
index ff82fdd..13182f5 100644
--- a/mpt/antlib/pom.xml
+++ b/mpt/antlib/pom.xml
@@ -26,7 +26,7 @@
     <parent>
         <artifactId>apache-james-mpt</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/app/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/app/pom.xml b/mpt/app/pom.xml
index f855e4d..7206858 100644
--- a/mpt/app/pom.xml
+++ b/mpt/app/pom.xml
@@ -26,7 +26,7 @@
     <parent>
         <artifactId>apache-james-mpt</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/core/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/core/pom.xml b/mpt/core/pom.xml
index 2b02d9f..86f9bde 100644
--- a/mpt/core/pom.xml
+++ b/mpt/core/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <artifactId>apache-james-mpt</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>apache-james-mpt-core</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/cassandra/pom.xml b/mpt/impl/imap-mailbox/cassandra/pom.xml
index 07759f7..3669bad 100644
--- a/mpt/impl/imap-mailbox/cassandra/pom.xml
+++ b/mpt/impl/imap-mailbox/cassandra/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-imapmailbox-cassandra</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/core/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/core/pom.xml b/mpt/impl/imap-mailbox/core/pom.xml
index e6a728f..8a5d72d 100644
--- a/mpt/impl/imap-mailbox/core/pom.xml
+++ b/mpt/impl/imap-mailbox/core/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-imapmailbox-core</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/cyrus/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/cyrus/pom.xml b/mpt/impl/imap-mailbox/cyrus/pom.xml
index 843c07e..2c7f71a 100644
--- a/mpt/impl/imap-mailbox/cyrus/pom.xml
+++ b/mpt/impl/imap-mailbox/cyrus/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-imapmailbox-cyrus</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/elasticsearch/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/elasticsearch/pom.xml b/mpt/impl/imap-mailbox/elasticsearch/pom.xml
index d5a3a3f..4bd3ac1 100644
--- a/mpt/impl/imap-mailbox/elasticsearch/pom.xml
+++ b/mpt/impl/imap-mailbox/elasticsearch/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-imapmailbox-elasticsearch</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/external-james/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/external-james/pom.xml b/mpt/impl/imap-mailbox/external-james/pom.xml
index b971d54..2e017fc 100644
--- a/mpt/impl/imap-mailbox/external-james/pom.xml
+++ b/mpt/impl/imap-mailbox/external-james/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-external-james</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/hbase/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/hbase/pom.xml b/mpt/impl/imap-mailbox/hbase/pom.xml
index cdbbae0..4cf9652 100644
--- a/mpt/impl/imap-mailbox/hbase/pom.xml
+++ b/mpt/impl/imap-mailbox/hbase/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-imapmailbox-hbase</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/inmemory/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/pom.xml b/mpt/impl/imap-mailbox/inmemory/pom.xml
index 5b66916..08b354e 100644
--- a/mpt/impl/imap-mailbox/inmemory/pom.xml
+++ b/mpt/impl/imap-mailbox/inmemory/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-imapmailbox-inmemory</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/jcr/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jcr/pom.xml b/mpt/impl/imap-mailbox/jcr/pom.xml
index 9100b33..431a3ba 100644
--- a/mpt/impl/imap-mailbox/jcr/pom.xml
+++ b/mpt/impl/imap-mailbox/jcr/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-imapmailbox-jcr</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/jpa/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/pom.xml b/mpt/impl/imap-mailbox/jpa/pom.xml
index 859a2b5..7abd64c 100644
--- a/mpt/impl/imap-mailbox/jpa/pom.xml
+++ b/mpt/impl/imap-mailbox/jpa/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-imapmailbox-jpa</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/maildir/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/pom.xml b/mpt/impl/imap-mailbox/maildir/pom.xml
index e9e58ae..4ce2f09 100644
--- a/mpt/impl/imap-mailbox/maildir/pom.xml
+++ b/mpt/impl/imap-mailbox/maildir/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <artifactId>apache-james-mpt-imapmailbox</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt-imapmailbox-maildir</artifactId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/imap-mailbox/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/pom.xml b/mpt/impl/imap-mailbox/pom.xml
index d326e69..05a59a0 100644
--- a/mpt/impl/imap-mailbox/pom.xml
+++ b/mpt/impl/imap-mailbox/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <artifactId>apache-james-mpt</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/managesieve/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/pom.xml b/mpt/impl/managesieve/cassandra/pom.xml
index b51dbd2..8ad45df 100644
--- a/mpt/impl/managesieve/cassandra/pom.xml
+++ b/mpt/impl/managesieve/cassandra/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mpt-managesieve</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/managesieve/core/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/core/pom.xml b/mpt/impl/managesieve/core/pom.xml
index 05caab6..823d741 100644
--- a/mpt/impl/managesieve/core/pom.xml
+++ b/mpt/impl/managesieve/core/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mpt-managesieve</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
@@ -43,7 +43,6 @@
         <dependency>
             <groupId>org.apache.james.protocols</groupId>
             <artifactId>protocols-managesieve</artifactId>
-            <version>1.6.4-SNAPSHOT</version>
         </dependency>
 
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/managesieve/file/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/file/pom.xml b/mpt/impl/managesieve/file/pom.xml
index 4fa2df9..60000fb 100644
--- a/mpt/impl/managesieve/file/pom.xml
+++ b/mpt/impl/managesieve/file/pom.xml
@@ -23,7 +23,8 @@
     <parent>
         <artifactId>apache-james-mpt-managesieve</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
+        <relativePath>..</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
@@ -39,7 +40,6 @@
         <dependency>
             <groupId>org.apache.james</groupId>
             <artifactId>james-server-data-file</artifactId>
-            <version>${james.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.james</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/managesieve/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/pom.xml b/mpt/impl/managesieve/pom.xml
index e90a229..55b0366 100644
--- a/mpt/impl/managesieve/pom.xml
+++ b/mpt/impl/managesieve/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>apache-james-mpt</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -56,12 +56,7 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mpt-managesieve-core</artifactId>
-                <version>0.2-SNAPSHOT</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.james</groupId>
-                <artifactId>james-server-data-memory</artifactId>
-                <version>${james.version}</version>
+                <version>${project.version}</version>
             </dependency>
         </dependencies>
     </dependencyManagement>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/smtp/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/cassandra/pom.xml b/mpt/impl/smtp/cassandra/pom.xml
index e7a87d0..78a378a 100644
--- a/mpt/impl/smtp/cassandra/pom.xml
+++ b/mpt/impl/smtp/cassandra/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <artifactId>apache-james-mpt-smtp</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/smtp/core/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/core/pom.xml b/mpt/impl/smtp/core/pom.xml
index 4cbc12b..97f0419 100644
--- a/mpt/impl/smtp/core/pom.xml
+++ b/mpt/impl/smtp/core/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <artifactId>apache-james-mpt-smtp</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/impl/smtp/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/pom.xml b/mpt/impl/smtp/pom.xml
index cf5b088..583d625 100644
--- a/mpt/impl/smtp/pom.xml
+++ b/mpt/impl/smtp/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <artifactId>apache-james-mpt</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../..</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/mavenplugin/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/mavenplugin/pom.xml b/mpt/mavenplugin/pom.xml
index 644cf4f..6bc6ef8 100644
--- a/mpt/mavenplugin/pom.xml
+++ b/mpt/mavenplugin/pom.xml
@@ -26,7 +26,7 @@
     <parent>
         <artifactId>apache-james-mpt</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>0.2-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/mpt/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/pom.xml b/mpt/pom.xml
index 48ac44d..3b06028 100644
--- a/mpt/pom.xml
+++ b/mpt/pom.xml
@@ -26,11 +26,10 @@
     <parent>
         <artifactId>james-project</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.8.3-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-james-mpt</artifactId>
-    <version>0.2-SNAPSHOT</version>
 
     <packaging>pom</packaging>
 
@@ -96,8 +95,6 @@
         <hadoop.version>1.0.1</hadoop.version>
         <hbase.version>0.94.27</hbase.version>
         <jackrabbit-core.version>2.5.2</jackrabbit-core.version>
-        <james-protocols.version>1.6.4-SNAPSHOT</james-protocols.version>
-        <james-mailbox.version>0.6-SNAPSHOT</james-mailbox.version>
         <javax.mail.version>1.4.1</javax.mail.version>
         <jmock.version>2.6.0</jmock.version>
         <junit.version>4.11</junit.version>
@@ -110,8 +107,6 @@
 
         <javax.mail.groupId>javax.mail</javax.mail.groupId>
         <javax.mail.artifactId>mail</javax.mail.artifactId>
-        <backends.version>1.8.3-SNAPSHOT</backends.version>
-        <james.version>3.0.0-beta5-SNAPSHOT</james.version>
         <logback.version>1.1.7</logback.version>
     </properties>
 
@@ -162,126 +157,141 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-backends-cassandra</artifactId>
-                <version>${backends.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-backends-cassandra</artifactId>
                 <type>test-jar</type>
-                <version>${backends.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-api</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-cassandra</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-elasticsearch</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-elasticsearch</artifactId>
                 <type>test-jar</type>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-cassandra</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-hbase</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-jcr</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-jpa</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-maildir</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-memory</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-store</artifactId>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-store</artifactId>
                 <type>test-jar</type>
-                <version>${james-mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>james-server-cassandra-guice</artifactId>
-                <version>${james.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>james-server-cassandra-guice</artifactId>
-                <version>${james.version}</version>
+                <version>${project.version}</version>
                 <scope>test</scope>
                 <type>test-jar</type>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>james-server-data-api</artifactId>
-                <version>${james.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>james-server-data-cassandra</artifactId>
-                <version>${james.version}</version>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>james-server-data-file</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>james-server-data-memory</artifactId>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>james-server-dnsservice-api</artifactId>
-                <version>${james.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>james-server-guice-common</artifactId>
-                <version>${james.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>james-server-util-java8</artifactId>
-                <version>${james.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-imap</artifactId>
-                <version>${james-protocols.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-imap</artifactId>
                 <type>test-jar</type>
-                <version>${james-protocols.version}</version>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james.protocols</groupId>
+                <artifactId>protocols-managesieve</artifactId>
+                <version>${project.version}</version>
             </dependency>
             <!-- Other dependencies -->
             <dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e112713..fb67816 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
 
     <groupId>org.apache.james</groupId>
     <artifactId>james-project</artifactId>
-    <version>1.8.3-SNAPSHOT</version>
+    <version>3.0.0-beta5-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache James Project</name>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/protocols/api/pom.xml
----------------------------------------------------------------------
diff --git a/protocols/api/pom.xml b/protocols/api/pom.xml
index bd2b44d..ae985b7 100644
--- a/protocols/api/pom.xml
+++ b/protocols/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>protocols</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.6.4-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/protocols/imap/pom.xml
----------------------------------------------------------------------
diff --git a/protocols/imap/pom.xml b/protocols/imap/pom.xml
index 810ca87..804ebda 100644
--- a/protocols/imap/pom.xml
+++ b/protocols/imap/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>protocols</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.6.4-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/protocols/lmtp/pom.xml
----------------------------------------------------------------------
diff --git a/protocols/lmtp/pom.xml b/protocols/lmtp/pom.xml
index c1b6b34..529a0ea 100644
--- a/protocols/lmtp/pom.xml
+++ b/protocols/lmtp/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>protocols</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.6.4-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/protocols/managesieve/pom.xml
----------------------------------------------------------------------
diff --git a/protocols/managesieve/pom.xml b/protocols/managesieve/pom.xml
index 87e8dfa..a34c5e9 100644
--- a/protocols/managesieve/pom.xml
+++ b/protocols/managesieve/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>protocols</artifactId>
-        <version>1.6.4-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/protocols/netty/pom.xml
----------------------------------------------------------------------
diff --git a/protocols/netty/pom.xml b/protocols/netty/pom.xml
index 7d20396..aa4ca6c 100644
--- a/protocols/netty/pom.xml
+++ b/protocols/netty/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>protocols</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.6.4-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/protocols/pom.xml
----------------------------------------------------------------------
diff --git a/protocols/pom.xml b/protocols/pom.xml
index ee5d7d2..2d750ad 100644
--- a/protocols/pom.xml
+++ b/protocols/pom.xml
@@ -23,11 +23,10 @@
     <parent>
         <artifactId>james-project</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.8.3-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>protocols</artifactId>
-    <version>1.6.4-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache James :: Protocols</name>
@@ -50,7 +49,6 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <netty.version>3.10.5.Final</netty.version>
         <apache-mime4j.version>0.8.0-SNAPSHOT</apache-mime4j.version>
-        <mailbox.version>0.6-SNAPSHOT</mailbox.version>
         <commons-net.version>3.2</commons-net.version>
         <commons-lang.version>2.6</commons-lang.version>
         <commons-codec.version>1.7</commons-codec.version>
@@ -60,7 +58,6 @@
         <jutf7.version>1.0.0</jutf7.version>
         <junit.version>4.10</junit.version>
         <slf4j.version>1.6.3</slf4j.version>
-        <james-server-data-api.version>3.0.0-beta5-SNAPSHOT</james-server-data-api.version>
         <jsieve.version>0.6-SNAPSHOT</jsieve.version>
         <mockito-core.version>1.9.0</mockito-core.version>
         <assertj-1.version>1.7.1</assertj-1.version>
@@ -169,19 +166,19 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-api</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-api</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
                 <scope>test</scope>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>james-server-data-api</artifactId>
-                <version>${james-server-data-api.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
@@ -243,7 +240,7 @@
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-store</artifactId>
                 <scope>test</scope>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>javax.mail</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/protocols/pop3/pom.xml
----------------------------------------------------------------------
diff --git a/protocols/pop3/pom.xml b/protocols/pop3/pom.xml
index 6aefeb5..8d42f39 100644
--- a/protocols/pop3/pom.xml
+++ b/protocols/pop3/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>protocols</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.6.4-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/protocols/smtp/pom.xml
----------------------------------------------------------------------
diff --git a/protocols/smtp/pom.xml b/protocols/smtp/pom.xml
index cd3c4ef..5ed3571 100644
--- a/protocols/smtp/pom.xml
+++ b/protocols/smtp/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>protocols</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.6.4-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/1fd9be99/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 35f91bd..b6cc72b 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -27,11 +27,10 @@
     <parent>
         <artifactId>james-project</artifactId>
         <groupId>org.apache.james</groupId>
-        <version>1.8.3-SNAPSHOT</version>
+        <version>3.0.0-beta5-SNAPSHOT</version>
     </parent>
 
     <artifactId>james-server</artifactId>
-    <version>3.0.0-beta5-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache James :: Server</name>
@@ -131,9 +130,6 @@
         <javax.activation.artifactId>activation</javax.activation.artifactId>
         <jackrabbit.version>2.5.2</jackrabbit.version>
         <jsieve.version>0.6-SNAPSHOT</jsieve.version>
-        <mailbox.version>0.6-SNAPSHOT</mailbox.version>
-        <mailet.version>2.5.1-SNAPSHOT</mailet.version>
-        <protocols.version>1.6.4-SNAPSHOT</protocols.version>
         <spring.version>3.2.14.RELEASE</spring.version>
         <geronimo-jms-spec.version>1.1.1</geronimo-jms-spec.version>
         <h2.version>1.3.170</h2.version>
@@ -183,8 +179,6 @@
         <karaf.tooling.exam.container.version>2.3.0</karaf.tooling.exam.container.version>
         <pax-logging-api.version>1.6.4</pax-logging-api.version>
         <mockito-core.version>1.9.0</mockito-core.version>
-        <backends.version>1.8.3-SNAPSHOT</backends.version>
-        <apache-backends-cassandra.version>1.8.3-SNAPSHOT</apache-backends-cassandra.version>
         <jackson-data.version>2.6.3</jackson-data.version>
         <jetty.version>9.3.5.v20151012</jetty.version>
         <cassandra-unit.version>2.1.9.2</cassandra-unit.version>
@@ -330,18 +324,18 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-backends-cassandra</artifactId>
-                <version>${apache-backends-cassandra.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-backends-cassandra</artifactId>
-                <version>${apache-backends-cassandra.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-mailet-api</artifactId>
-                <version>${mailet.version}</version>
+                <version>${project.version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>javax.mail</groupId>
@@ -352,7 +346,7 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-mailet-base</artifactId>
-                <version>${mailet.version}</version>
+                <version>${project.version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>javax.mail</groupId>
@@ -367,7 +361,7 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-mailet-base</artifactId>
-                <version>${mailet.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
                 <scope>test</scope>
             </dependency>
@@ -379,7 +373,7 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-mailet-base</artifactId>
-                <version>${mailet.version}</version>
+                <version>${project.version}</version>
                 <classifier>tests</classifier>
                 <scope>test</scope>
                 <exclusions>
@@ -392,7 +386,7 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-mailet-standard</artifactId>
-                <version>${mailet.version}</version>
+                <version>${project.version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>javax.mail</groupId>
@@ -403,7 +397,7 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-mailet-standard</artifactId>
-                <version>${mailet.version}</version>
+                <version>${project.version}</version>
                 <classifier>tests</classifier>
                 <scope>test</scope>
                 <exclusions>
@@ -417,44 +411,44 @@
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-api</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-api</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
                 <scope>test</scope>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-netty</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-pop3</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-smtp</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-lmtp</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-managesieve</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-managesieve</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
                 <scope>test</scope>
             </dependency>
@@ -616,64 +610,64 @@
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-smtp</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
                 <scope>test</scope>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-memory</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-memory</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
                 <scope>test</scope>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-cassandra</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-cassandra</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-kafka</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-api</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-api</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-elasticsearch</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-elasticsearch</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-tika</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>org.apache.pdfbox</groupId>
@@ -696,17 +690,17 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-spring</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-lucene</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-imap</artifactId>
-                <version>${protocols.version}</version>
+                <version>${project.version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>commons-logging</groupId>
@@ -718,7 +712,7 @@
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-hbase</artifactId>
                 <classifier>tests</classifier>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
                 <scope>test</scope>
             </dependency>
             <dependency>
@@ -777,27 +771,27 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-maildir</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-jpa</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-tool</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-jcr</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-store</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>commons-collections</groupId>
@@ -812,7 +806,7 @@
             <dependency>
                 <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-store</artifactId>
-                <version>${mailbox.version}</version>
+                <version>${project.version}</version>
                 <type>test-jar</type>
                 <exclusions>
                     <exclusion>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[2/5] james-project git commit: JAMES-1830 Remove duplication of mockito in mailet/standard POM

Posted by ad...@apache.org.
JAMES-1830 Remove duplication of mockito in mailet/standard POM


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/396a950a
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/396a950a
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/396a950a

Branch: refs/heads/master
Commit: 396a950af6de5204ec81d4a93b996a70b58218bb
Parents: 0501c99
Author: Benoit Tellier <bt...@linagora.com>
Authored: Tue Oct 4 10:18:19 2016 +0200
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Tue Oct 4 15:57:27 2016 +0200

----------------------------------------------------------------------
 mailet/standard/pom.xml                             |  5 -----
 server/mailet/mailets/pom.xml                       | 16 ++++++++--------
 .../transport/mailets/ResourceLocatorImpl.java      |  2 +-
 server/pom.xml                                      |  2 +-
 4 files changed, 10 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/396a950a/mailet/standard/pom.xml
----------------------------------------------------------------------
diff --git a/mailet/standard/pom.xml b/mailet/standard/pom.xml
index 3acf94b..1ca1f89 100644
--- a/mailet/standard/pom.xml
+++ b/mailet/standard/pom.xml
@@ -63,11 +63,6 @@
             <artifactId>mail</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/james-project/blob/396a950a/server/mailet/mailets/pom.xml
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/pom.xml b/server/mailet/mailets/pom.xml
index ee2dc9d..192f208 100644
--- a/server/mailet/mailets/pom.xml
+++ b/server/mailet/mailets/pom.xml
@@ -36,14 +36,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.james</groupId>
-            <artifactId>apache-mime4j-dom</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>apache-mime4j-james-utils</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.james</groupId>
             <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
@@ -118,6 +110,14 @@
             <artifactId>apache-jspf-resolver</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-mime4j-dom</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-mime4j-james-utils</artifactId>
+        </dependency>
+        <dependency>
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/396a950a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java
index b1041fb..bf8978e 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java
@@ -21,9 +21,9 @@ package org.apache.james.transport.mailets;
 
 import org.apache.james.sieverepository.api.SieveRepository;
 import org.apache.james.sieverepository.api.exception.SieveRepositoryException;
+import org.apache.james.transport.mailets.jsieve.ResourceLocator;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.james.user.api.UsersRepositoryException;
-import org.apache.jsieve.mailet.ResourceLocator;
 import org.joda.time.DateTime;
 
 import javax.mail.MessagingException;

http://git-wip-us.apache.org/repos/asf/james-project/blob/396a950a/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 7a8b9fe..35f91bd 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -986,7 +986,7 @@
                         <groupId>xerces</groupId>
                         <artifactId>xerces</artifactId>
                     </exclusion>
-                    <exclusion>Mime4J
+                    <exclusion>
                         <groupId>xml-apis</groupId>
                         <artifactId>xml-apis</artifactId>
                     </exclusion>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[5/5] james-project git commit: Merge remote-tracking branch 'btellier/JAMES-1830-2'

Posted by ad...@apache.org.
Merge remote-tracking branch 'btellier/JAMES-1830-2'


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/ad5950ab
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/ad5950ab
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/ad5950ab

Branch: refs/heads/master
Commit: ad5950abc7f67ac2d52956c559a46c32be96c96e
Parents: 7f381ab 1fd9be9
Author: Antoine Duprat <ad...@apache.org>
Authored: Wed Oct 5 08:31:40 2016 +0200
Committer: Antoine Duprat <ad...@apache.org>
Committed: Wed Oct 5 08:31:40 2016 +0200

----------------------------------------------------------------------
 backends-common/cassandra/pom.xml               |   2 +-
 backends-common/pom.xml                         |   2 +-
 mailbox/api/pom.xml                             |   4 +-
 mailbox/caching/pom.xml                         |   2 +-
 mailbox/cassandra/pom.xml                       |   2 +-
 mailbox/elasticsearch/pom.xml                   |   2 +-
 mailbox/hbase/pom.xml                           |   2 +-
 mailbox/jcr/pom.xml                             |   2 +-
 mailbox/jpa/pom.xml                             |   2 +-
 mailbox/kafka/pom.xml                           |   2 +-
 mailbox/lucene/pom.xml                          |   2 +-
 mailbox/maildir/pom.xml                         |   2 +-
 mailbox/memory/pom.xml                          |   2 +-
 mailbox/pom.xml                                 |  11 +-
 mailbox/scanning-search/pom.xml                 |   2 +-
 mailbox/spring/pom.xml                          |   2 +-
 mailbox/store/pom.xml                           |   2 +-
 mailbox/tika/pom.xml                            |   2 +-
 mailbox/tool/pom.xml                            |   2 +-
 mailbox/zoo-seq-provider/pom.xml                |   2 +-
 mailet/ai/pom.xml                               |   2 +-
 mailet/api/pom.xml                              |   2 +-
 mailet/base/pom.xml                             |   2 +-
 mailet/crypto/pom.xml                           |   2 +-
 mailet/mailetdocs-maven-plugin/pom.xml          |   2 +-
 mailet/pom.xml                                  |   3 +-
 mailet/standard/pom.xml                         |   7 +-
 mpt/all/pom.xml                                 |   2 +-
 mpt/antlib/pom.xml                              |   2 +-
 mpt/app/pom.xml                                 |   2 +-
 mpt/core/pom.xml                                |   2 +-
 mpt/impl/imap-mailbox/cassandra/pom.xml         |   2 +-
 mpt/impl/imap-mailbox/core/pom.xml              |   2 +-
 mpt/impl/imap-mailbox/cyrus/pom.xml             |   2 +-
 mpt/impl/imap-mailbox/elasticsearch/pom.xml     |   2 +-
 mpt/impl/imap-mailbox/external-james/pom.xml    |   2 +-
 mpt/impl/imap-mailbox/hbase/pom.xml             |   2 +-
 mpt/impl/imap-mailbox/inmemory/pom.xml          |   2 +-
 mpt/impl/imap-mailbox/jcr/pom.xml               |   2 +-
 mpt/impl/imap-mailbox/jpa/pom.xml               |   2 +-
 mpt/impl/imap-mailbox/maildir/pom.xml           |   2 +-
 mpt/impl/imap-mailbox/pom.xml                   |   2 +-
 mpt/impl/managesieve/cassandra/pom.xml          |   2 +-
 mpt/impl/managesieve/core/pom.xml               |   3 +-
 mpt/impl/managesieve/file/pom.xml               |   4 +-
 mpt/impl/managesieve/pom.xml                    |   9 +-
 mpt/impl/smtp/cassandra/pom.xml                 |   2 +-
 mpt/impl/smtp/core/pom.xml                      |   2 +-
 mpt/impl/smtp/pom.xml                           |   2 +-
 mpt/mavenplugin/pom.xml                         |   2 +-
 mpt/pom.xml                                     |  68 +--
 pom.xml                                         |   2 +-
 protocols/api/pom.xml                           |   2 +-
 protocols/imap/pom.xml                          |   2 +-
 protocols/lmtp/pom.xml                          |   2 +-
 protocols/managesieve/pom.xml                   |   2 +-
 protocols/netty/pom.xml                         |   2 +-
 protocols/pom.xml                               |  13 +-
 protocols/pop3/pom.xml                          |   2 +-
 protocols/smtp/pom.xml                          |   2 +-
 server/mailet/mailets/pom.xml                   |  18 +-
 .../transport/mailets/ResourceLocatorImpl.java  |   2 +-
 .../james/transport/mailets/SieveMailet.java    |   6 +-
 .../transport/mailets/jsieve/ActionContext.java |  81 +++
 .../mailets/jsieve/ActionDispatcher.java        | 103 ++++
 .../transport/mailets/jsieve/ActionUtils.java   |  80 +++
 .../mailets/jsieve/CommonsLoggingAdapter.java   | 142 ++++++
 .../mailets/jsieve/FileIntoAction.java          | 142 ++++++
 .../transport/mailets/jsieve/KeepAction.java    |  65 +++
 .../transport/mailets/jsieve/MailAction.java    |  40 ++
 .../james/transport/mailets/jsieve/Poster.java  |  40 ++
 .../mailets/jsieve/RedirectAction.java          |  72 +++
 .../transport/mailets/jsieve/RejectAction.java  | 144 ++++++
 .../mailets/jsieve/ResourceLocator.java         |  92 ++++
 .../mailets/jsieve/SieveMailAdapter.java        | 504 +++++++++++++++++++
 .../mailets/jsieve/SieveMailboxMailet.java      | 464 +++++++++++++++++
 .../mailets/jsieve/VacationAction.java          | 100 ++++
 .../transport/mailets/jsieve/VacationReply.java | 169 +++++++
 .../mailets/jsieve/mdn/ActionModeAutomatic.java |  42 ++
 .../mailets/jsieve/mdn/ActionModeManual.java    |  47 ++
 .../mailets/jsieve/mdn/Disposition.java         | 176 +++++++
 .../jsieve/mdn/DispositionActionMode.java       |  29 ++
 .../mailets/jsieve/mdn/DispositionModifier.java |  29 ++
 .../jsieve/mdn/DispositionSendingMode.java      |  29 ++
 .../mailets/jsieve/mdn/DispositionType.java     |  29 ++
 .../mailets/jsieve/mdn/MDNFactory.java          | 115 +++++
 .../mailets/jsieve/mdn/ModifierError.java       |  44 ++
 .../mailets/jsieve/mdn/ModifierExpired.java     |  45 ++
 .../mailets/jsieve/mdn/ModifierFailed.java      |  45 ++
 .../jsieve/mdn/ModifierMailboxTerminated.java   |  45 ++
 .../mailets/jsieve/mdn/ModifierSuperseded.java  |  45 ++
 .../mailets/jsieve/mdn/ModifierWarning.java     |  45 ++
 .../jsieve/mdn/SendingModeAutomatic.java        |  45 ++
 .../mailets/jsieve/mdn/SendingModeManual.java   |  45 ++
 .../mailets/jsieve/mdn/TypeDeleted.java         |  45 ++
 .../mailets/jsieve/mdn/TypeDenied.java          |  44 ++
 .../mailets/jsieve/mdn/TypeDispatched.java      |  43 ++
 .../mailets/jsieve/mdn/TypeDisplayed.java       |  44 ++
 .../mailets/jsieve/mdn/TypeFailed.java          |  44 ++
 .../mailets/jsieve/mdn/TypeProcessed.java       |  44 ++
 .../mailets/delivery/SieveMailetTest.java       |   2 +-
 server/pom.xml                                  |  97 ++--
 102 files changed, 3523 insertions(+), 183 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ad5950ab/mailet/api/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/james-project/blob/ad5950ab/mailet/base/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/james-project/blob/ad5950ab/server/pom.xml
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[3/5] james-project git commit: JAMES-1830 jsieve/mailets should be located in server/mailet/.../jsieve

Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/VacationAction.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/VacationAction.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/VacationAction.java
new file mode 100644
index 0000000..153144e
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/VacationAction.java
@@ -0,0 +1,100 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve;
+
+import java.util.Enumeration;
+import java.util.Set;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.AddressException;
+
+import org.apache.jsieve.mail.Action;
+import org.apache.jsieve.mail.optional.ActionVacation;
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+import org.joda.time.Days;
+
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+
+public class VacationAction implements MailAction {
+
+    @Override
+    public void execute(Action action, Mail mail, ActionContext context) throws MessagingException {
+        ActionVacation actionVacation = (ActionVacation) action;
+        int dayDifference = Days.daysBetween(context.getScriptActivationDate(), context.getScriptInterpretationDate()).getDays();
+        if (isStillInVacation(actionVacation, dayDifference)) {
+            if (isValidForReply(mail, actionVacation, context)) {
+                if (!isMailingList(mail)) {
+                    sendVacationNotification(mail, actionVacation, context);
+                }
+            }
+        }
+    }
+
+    private void sendVacationNotification(Mail mail, ActionVacation actionVacation, ActionContext context) throws MessagingException {
+        VacationReply vacationReply = VacationReply.builder(mail, context)
+            .from(actionVacation.getFrom())
+            .mime(actionVacation.getMime())
+            .reason(actionVacation.getReason())
+            .subject(actionVacation.getSubject())
+            .build();
+        context.post(vacationReply.getSender(), vacationReply.getRecipients(), vacationReply.getMimeMessage());
+    }
+
+    private boolean isStillInVacation(ActionVacation actionVacation, int dayDifference) {
+        return dayDifference >= 0 && dayDifference <= actionVacation.getDuration();
+    }
+
+    private boolean isValidForReply(final Mail mail, ActionVacation actionVacation, final ActionContext context) {
+        Set<MailAddress> currentMailAddresses = ImmutableSet.copyOf(mail.getRecipients());
+        Set<MailAddress> allowedMailAddresses = ImmutableSet.<MailAddress>builder().addAll(
+            Lists.transform(actionVacation.getAddresses(), new Function<String, MailAddress>() {
+                public MailAddress apply(String s) {
+                    return retrieveAddressFromString(s, context);
+                }
+            }))
+            .add(context.getRecipient())
+            .build();
+        return !Sets.intersection(currentMailAddresses, allowedMailAddresses).isEmpty();
+    }
+
+    private MailAddress retrieveAddressFromString(String address, ActionContext context) {
+        try {
+            return new MailAddress(address);
+        } catch (AddressException e) {
+            context.getLog().warn("Mail address " + address + " was not well formatted : " + e.getLocalizedMessage());
+            return null;
+        }
+    }
+
+    private boolean isMailingList(Mail mail) throws MessagingException {
+        Enumeration enumeration = mail.getMessage().getAllHeaderLines();
+        while (enumeration.hasMoreElements()) {
+            String headerName = (String) enumeration.nextElement();
+            if (headerName.startsWith("List-")) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/VacationReply.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/VacationReply.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/VacationReply.java
new file mode 100644
index 0000000..6511924
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/VacationReply.java
@@ -0,0 +1,169 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve;
+
+import com.google.common.base.Function;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+
+import javax.activation.DataHandler;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+import javax.mail.util.ByteArrayDataSource;
+import java.io.IOException;
+import java.util.List;
+
+public class VacationReply {
+
+
+    public static class Builder {
+
+        private final Mail originalMail;
+        private final ActionContext context;
+        private String from;
+        private String reason;
+        private String mime;
+        private String subject;
+
+        public Builder(Mail originalMail, ActionContext context) {
+            this.originalMail = originalMail;
+            this.context = context;
+        }
+
+        public Builder from(String from) {
+            this.from = from;
+            return this;
+        }
+
+        public Builder reason(String reason) {
+            this.reason = reason;
+            return this;
+        }
+
+        public Builder mime(String mime) {
+            this.mime = mime;
+            return this;
+        }
+
+        public Builder subject(String subject) {
+            this.subject = subject;
+            return this;
+        }
+
+        public VacationReply build() throws MessagingException {
+            Preconditions.checkState(eitherReasonOrMime());
+            ActionUtils.detectAndHandleLocalLooping(originalMail, context, "vacation");
+
+            MimeMessage reply = (MimeMessage) originalMail.getMessage().reply(false);
+            reply.setSubject(generateNotificationSubject());
+            reply.setContent(generateNotificationContent());
+
+            return new VacationReply(retrieveOriginalSender(), Lists.newArrayList(originalMail.getSender()), reply);
+        }
+
+        private boolean eitherReasonOrMime() {
+            return (reason == null) ^ (mime == null);
+        }
+
+        private String generateNotificationSubject() {
+            return Optional.fromNullable(subject)
+                .or(context.getRecipient() + " is currently in vacation");
+        }
+
+        private Multipart generateNotificationContent() throws MessagingException {
+            try {
+                if (reason != null) {
+                    return generateNotificationContentFromReasonString();
+                } else {
+                    return generateNotificationContentFromMime();
+                }
+            } catch (IOException e) {
+                throw new MessagingException("Cannot read specified content", e);
+            }
+        }
+
+        private Multipart generateNotificationContentFromMime() throws MessagingException, IOException {
+            return new MimeMultipart(new ByteArrayDataSource(mime, "mixed"));
+        }
+
+        private Multipart generateNotificationContentFromReasonString() throws MessagingException, IOException {
+            Multipart multipart = new MimeMultipart("mixed");
+            MimeBodyPart reasonPart = new MimeBodyPart();
+            reasonPart.setDataHandler(
+                new DataHandler(
+                    new ByteArrayDataSource(
+                        reason,
+                        "text/plain; charset=UTF-8")));
+            reasonPart.setDisposition(MimeBodyPart.INLINE);
+            multipart.addBodyPart(reasonPart);
+            return multipart;
+        }
+
+        private MailAddress retrieveOriginalSender() throws AddressException {
+            return Optional.fromNullable(from).transform(new Function<String, MailAddress>() {
+                public MailAddress apply(String address) {
+                    return retrieveAddressFromString(address, context);
+                }
+            }).or(context.getRecipient());
+        }
+
+        private MailAddress retrieveAddressFromString(String address, ActionContext context) {
+            try {
+                return new MailAddress(address);
+            } catch (AddressException e) {
+                context.getLog().warn("Mail address " + address + " was not well formatted : " + e.getLocalizedMessage());
+                return null;
+            }
+        }
+    }
+
+    public static Builder builder(Mail originalMail, ActionContext context) {
+        return new Builder(originalMail, context);
+    }
+
+    private final MailAddress sender;
+    private final List<MailAddress> recipients;
+    private final MimeMessage mimeMessage;
+
+    private VacationReply(MailAddress sender, List<MailAddress> recipients, MimeMessage mimeMessage) {
+        this.sender = sender;
+        this.recipients = recipients;
+        this.mimeMessage = mimeMessage;
+    }
+
+    public MailAddress getSender() {
+        return sender;
+    }
+
+    public List<MailAddress> getRecipients() {
+        return recipients;
+    }
+
+    public MimeMessage getMimeMessage() {
+        return mimeMessage;
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeAutomatic.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeAutomatic.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeAutomatic.java
new file mode 100644
index 0000000..30f6df7
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeAutomatic.java
@@ -0,0 +1,42 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>ActionModeAutomatic</code>
+ */
+public class ActionModeAutomatic implements DispositionActionMode {
+
+    /**
+     * Default Constructor
+     */
+    public ActionModeAutomatic() {
+        super();
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        return "automatic-action";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeManual.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeManual.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeManual.java
new file mode 100644
index 0000000..6d553e1
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeManual.java
@@ -0,0 +1,47 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>ActionModeManual</code>
+ */
+public class ActionModeManual
+        implements
+            DispositionActionMode
+{
+
+    /**
+     * Default Constructor
+     */
+    public ActionModeManual()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "manual-action";
+    }         
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/Disposition.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/Disposition.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/Disposition.java
new file mode 100644
index 0000000..e047d66
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/Disposition.java
@@ -0,0 +1,176 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+/**
+ * Class <code>Disposition</code> encapsulating
+ * disposition information as defined by RFC 2298.
+ */
+public class Disposition
+{
+    private DispositionActionMode fieldActionMode;
+    private DispositionSendingMode fieldSendingMode;
+    private DispositionType fieldDispositionType;
+    private DispositionModifier[] fieldDispositionModifiers;
+
+    /**
+     * Default Construcor
+     */
+    private Disposition()
+    {
+        super();
+    }
+
+    /**
+     * Constructor.
+     * 
+     * @param actionMode
+     * @param sendingMode
+     * @param type
+     */
+    public Disposition(DispositionActionMode actionMode, DispositionSendingMode sendingMode, DispositionType type)
+    {
+        this();
+        setActionMode(actionMode);
+        setSendingMode(sendingMode);
+        setDispositionType(type);
+    }
+
+    /**
+     * Constructor.
+     * 
+     * @param actionMode
+     * @param sendingMode
+     * @param type
+     * @param modifiers
+     */
+    public Disposition(DispositionActionMode actionMode, DispositionSendingMode sendingMode, DispositionType type,
+            DispositionModifier[] modifiers)
+    {
+        this(actionMode, sendingMode, type);
+        setDispositionModifiers(modifiers);
+    }
+
+    /**
+     * Answer the Disposition Mode.
+     * 
+     * @return Returns the dispostionMode.
+     */
+    protected DispositionActionMode getActionMode()
+    {
+        return fieldActionMode;
+    }
+
+    /**
+     * Set the Disposition Mode.
+     * 
+     * @param dispostionMode The dispostionMode to set.
+     */
+    protected void setActionMode(DispositionActionMode dispostionMode)
+    {
+        fieldActionMode = dispostionMode;
+    }
+
+    /**
+     * Answer the Disposition Modifiers.
+     * 
+     * @return Returns the dispostionModifiers.
+     */
+    protected DispositionModifier[] getDispositionModifiers()
+    {
+        return fieldDispositionModifiers;
+    }
+
+    /**
+     * Set the Disposition Modifiers.
+     * 
+     * @param dispostionModifiers The dispostionModifiers to set.
+     */
+    protected void setDispositionModifiers(DispositionModifier[] dispostionModifiers)
+    {
+        fieldDispositionModifiers = dispostionModifiers;
+    }
+
+    /**
+     * Answer the Disposition Type.
+     * 
+     * @return Returns the dispostionType.
+     */
+    protected DispositionType getDispositionType()
+    {
+        return fieldDispositionType;
+    }
+
+    /**
+     * Set the Disposition Type.
+     * 
+     * @param dispostionType The dispostionType to set.
+     */
+    protected void setDispositionType(DispositionType dispostionType)
+    {
+        fieldDispositionType = dispostionType;
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder builder = new StringBuilder(64);
+        builder.append("Disposition: ");
+        builder.append(getActionMode() == null ? "" : getActionMode().toString());
+        builder.append('/');
+        builder.append(getSendingMode() == null ? "" : getSendingMode().toString());
+        builder.append(';');
+        builder.append(getDispositionType() == null ? "" : getDispositionType().toString());
+        if (null != getDispositionModifiers()
+                && getDispositionModifiers().length > 0)
+        {
+            builder.append('/');
+            for (int i = 0; i < getDispositionModifiers().length; i++)
+            {
+                if (i > 0)
+                    builder.append(',');
+                builder.append(getDispositionModifiers()[i]);
+            }
+        }
+        return builder.toString();
+    }
+
+    /**
+     * Answer the Sending Mode.
+     * 
+     * @return Returns the sendingMode.
+     */
+    protected DispositionSendingMode getSendingMode()
+    {
+        return fieldSendingMode;
+    }
+
+    /**
+     * Set the Sending Mode.
+     * 
+     * @param sendingMode The sendingMode to set.
+     */
+    protected void setSendingMode(DispositionSendingMode sendingMode)
+    {
+        fieldSendingMode = sendingMode;
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionActionMode.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionActionMode.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionActionMode.java
new file mode 100644
index 0000000..422b898
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionActionMode.java
@@ -0,0 +1,29 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+/**
+ * Interface <code>DispositionActionMode</code> marks a type encapsulating
+ * disposition action mode information as defined by RFC 2298.
+ */
+public interface DispositionActionMode
+{
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionModifier.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionModifier.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionModifier.java
new file mode 100644
index 0000000..2a8b2a3
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionModifier.java
@@ -0,0 +1,29 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+/**
+ * Interface <code>DispositionModifier</code> marks a type encapsulating
+ * disposition modifier information as defined by RFC 2298.
+ */
+public interface DispositionModifier
+{
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionSendingMode.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionSendingMode.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionSendingMode.java
new file mode 100644
index 0000000..3b4055e
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionSendingMode.java
@@ -0,0 +1,29 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+/**
+ * Interface <code>DispositionSendingMode</code> marks a type encapsulating
+ * disposition sending mode information as defined by RFC 2298.
+ */
+public interface DispositionSendingMode
+{
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionType.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionType.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionType.java
new file mode 100644
index 0000000..004d8d1
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionType.java
@@ -0,0 +1,29 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+/**
+ * Interface <code>DispositionType</code> marks a type encapsulating
+ * disposition type information as defined by RFC 2298.
+ */
+public interface DispositionType
+{
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/MDNFactory.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/MDNFactory.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/MDNFactory.java
new file mode 100644
index 0000000..0711909
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/MDNFactory.java
@@ -0,0 +1,115 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.MimeBodyPart;
+
+import org.apache.mailet.base.mail.MimeMultipartReport;
+
+/**
+ * Class <code>MDNFactory</code> creates MimeMultipartReports containing
+ * Message Delivery Notifications as specified by RFC 2298.
+ */
+public class MDNFactory
+{
+
+    /**
+     * Default Constructor
+     */
+    private MDNFactory()
+    {
+        super();
+    }
+    
+    /**
+     * Answers a MimeMultipartReport containing a
+     * Message Delivery Notification as specified by RFC 2298.
+     * 
+     * @param humanText
+     * @param reporting_UA_name
+     * @param reporting_UA_product
+     * @param original_recipient
+     * @param final_recipient
+     * @param original_message_id
+     * @param disposition
+     * @return MimeMultipartReport
+     * @throws MessagingException
+     */
+    static public MimeMultipartReport create(String humanText,
+            String reporting_UA_name,
+            String reporting_UA_product,
+            String original_recipient,
+            String final_recipient,
+            String original_message_id,
+            Disposition disposition) throws MessagingException
+    {
+        // Create the message parts. According to RFC 2298, there are two
+        // compulsory parts and one optional part...
+        MimeMultipartReport multiPart = new MimeMultipartReport();
+        multiPart.setReportType("disposition-notification");
+        
+        // Part 1: The 'human-readable' part
+        MimeBodyPart humanPart = new MimeBodyPart();
+        humanPart.setText(humanText);
+        multiPart.addBodyPart(humanPart);
+
+        // Part 2: MDN Report Part
+        // 1) reporting-ua-field
+        StringBuilder mdnReport = new StringBuilder(128);
+        mdnReport.append("Reporting-UA: ");
+        mdnReport.append((reporting_UA_name == null ? "" : reporting_UA_name));
+        mdnReport.append("; ");
+        mdnReport.append((reporting_UA_product == null ? "" : reporting_UA_product));
+        mdnReport.append("\r\n");
+        // 2) original-recipient-field
+        if (null != original_recipient)
+        {
+            mdnReport.append("Original-Recipient: ");
+            mdnReport.append("rfc822; ");
+            mdnReport.append(original_recipient);
+            mdnReport.append("\r\n");
+        }
+        // 3) final-recipient-field
+        mdnReport.append("Final-Recepient: ");
+        mdnReport.append("rfc822; ");
+        mdnReport.append((final_recipient == null ? "" : final_recipient));
+        mdnReport.append("\r\n");
+        // 4) original-message-id-field
+        mdnReport.append("Original-Message-ID: ");
+        mdnReport.append((original_message_id == null ? "" : original_message_id));
+        mdnReport.append("\r\n");
+        // 5) disposition-field
+        mdnReport.append(disposition.toString());
+        mdnReport.append("\r\n");
+        MimeBodyPart mdnPart = new MimeBodyPart();
+        mdnPart.setContent(mdnReport.toString(), "message/disposition-notification");
+        multiPart.addBodyPart(mdnPart);
+
+        // Part 3: The optional third part, the original message is omitted.
+        // We don't want to propogate over-sized, virus infected or
+        // other undesirable mail!
+        // There is the option of adding a Text/RFC822-Headers part, which
+        // includes only the RFC 822 headers of the failed message. This is
+        // described in RFC 1892. It would be a useful addition!        
+        return multiPart;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierError.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierError.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierError.java
new file mode 100644
index 0000000..ae3c8d3
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierError.java
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>ModifierError</code>
+ */
+public class ModifierError implements DispositionModifier
+{
+
+    /**
+     * Default Constructor
+     */
+    public ModifierError()
+    {
+        super();
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "error";
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierExpired.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierExpired.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierExpired.java
new file mode 100644
index 0000000..cda3e5b
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierExpired.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>ModifierExpired</code>
+ */    
+public class ModifierExpired implements DispositionModifier
+{
+
+    /**
+     * Default Constructor
+     */
+    public ModifierExpired()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "expired";
+    }        
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierFailed.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierFailed.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierFailed.java
new file mode 100644
index 0000000..1d008c6
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierFailed.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>ModifierFailed</code>
+ */    
+public class ModifierFailed implements DispositionModifier
+{
+
+    /**
+     * Default Constructor
+     */
+    public ModifierFailed()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "failed";
+    }        
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierMailboxTerminated.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierMailboxTerminated.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierMailboxTerminated.java
new file mode 100644
index 0000000..a0eb504
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierMailboxTerminated.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>ModifierMailboxTerminated</code>
+ */    
+public class ModifierMailboxTerminated implements DispositionModifier
+{
+
+    /**
+     * Default Constructor
+     */
+    public ModifierMailboxTerminated()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "mailbox-terminated";
+    }        
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierSuperseded.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierSuperseded.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierSuperseded.java
new file mode 100644
index 0000000..efad900
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierSuperseded.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>ModifierSuperseded</code>
+ */    
+public class ModifierSuperseded implements DispositionModifier
+{
+
+    /**
+     * Default Constructor
+     */
+    public ModifierSuperseded()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "superseded";
+    }        
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierWarning.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierWarning.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierWarning.java
new file mode 100644
index 0000000..ca39308
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierWarning.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>ModifierWarning</code>
+ */    
+public class ModifierWarning implements DispositionModifier
+{
+
+    /**
+     * Default Constructor
+     */
+    public ModifierWarning()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "warning";
+    }        
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/SendingModeAutomatic.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/SendingModeAutomatic.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/SendingModeAutomatic.java
new file mode 100644
index 0000000..9626643
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/SendingModeAutomatic.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>SendingModeAutomatic</code>
+ */
+public class SendingModeAutomatic implements DispositionSendingMode
+{
+
+    /**
+     * Default Constructor
+     */
+    public SendingModeAutomatic()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "MDN-sent-automatically";
+    }        
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/SendingModeManual.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/SendingModeManual.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/SendingModeManual.java
new file mode 100644
index 0000000..69581b4
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/SendingModeManual.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>SendingModeManual</code>
+ */
+public class SendingModeManual implements DispositionSendingMode
+{
+
+    /**
+     * Default Constructor
+     */
+    public SendingModeManual()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "MDN-sent-manually";
+    }         
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDeleted.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDeleted.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDeleted.java
new file mode 100644
index 0000000..01f8806
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDeleted.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>TypeDeleted</code>
+ */
+public class TypeDeleted implements DispositionType
+{
+
+    /**
+     * Default Constructor
+     */
+    public TypeDeleted()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "deleted";
+    }         
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDenied.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDenied.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDenied.java
new file mode 100644
index 0000000..fed3985
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDenied.java
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>TypeDenied</code>
+ */    
+public class TypeDenied implements DispositionType
+{
+
+    /**
+     * Default Constructor
+     */
+    public TypeDenied()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "denied";
+    }         
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDispatched.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDispatched.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDispatched.java
new file mode 100644
index 0000000..4a23185
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDispatched.java
@@ -0,0 +1,43 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>TypeDispatched</code>
+ */
+public class TypeDispatched implements DispositionType
+{
+    /**
+     * Default Constructor
+     */
+    public TypeDispatched()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "dispatched";
+    }         
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDisplayed.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDisplayed.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDisplayed.java
new file mode 100644
index 0000000..57ab717
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeDisplayed.java
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>TypeDisplayed</code>
+ */
+public class TypeDisplayed implements DispositionType
+{
+
+    /**
+     * Default Constructor
+     */
+    public TypeDisplayed()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "displayed";
+    }         
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeFailed.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeFailed.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeFailed.java
new file mode 100644
index 0000000..41ec777
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeFailed.java
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>TypeFailed</code>
+ */    
+public class TypeFailed implements DispositionType
+{
+
+    /**
+     * Default Constructor
+     */
+    public TypeFailed()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "failed";
+    }         
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeProcessed.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeProcessed.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeProcessed.java
new file mode 100644
index 0000000..e136070
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/TypeProcessed.java
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve.mdn;
+
+
+/**
+ * Class <code>TypeProcessed</code>
+ */    
+public class TypeProcessed implements DispositionType
+{
+
+    /**
+     * Default Constructor
+     */
+    public TypeProcessed()
+    {
+        super();
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "processed";
+    }         
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SieveMailetTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SieveMailetTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SieveMailetTest.java
index 575acea..77f67e7 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SieveMailetTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SieveMailetTest.java
@@ -50,8 +50,8 @@ import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
 import org.apache.james.transport.mailets.SieveMailet;
+import org.apache.james.transport.mailets.jsieve.ResourceLocator;
 import org.apache.james.user.api.UsersRepository;
-import org.apache.jsieve.mailet.ResourceLocator;
 import org.apache.mailet.Mail;
 import org.apache.mailet.MailAddress;
 import org.apache.mailet.base.test.FakeMail;

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index d8d6773..7a8b9fe 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -871,14 +871,13 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
-                <artifactId>apache-jsieve-mailet</artifactId>
-                <version>${jsieve.version}</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>javax.activation</groupId>
-                        <artifactId>activation</artifactId>
-                    </exclusion>
-                </exclusions>
+                <artifactId>apache-mime4j-dom</artifactId>
+                <version>${apache-mime4j.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>apache-mime4j-james-utils</artifactId>
+                <version>${apache-mime4j.version}</version>
             </dependency>
             <dependency>
                 <groupId>com.sun.mail</groupId>
@@ -987,7 +986,7 @@
                         <groupId>xerces</groupId>
                         <artifactId>xerces</artifactId>
                     </exclusion>
-                    <exclusion>
+                    <exclusion>Mime4J
                         <groupId>xml-apis</groupId>
                         <artifactId>xml-apis</artifactId>
                     </exclusion>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[4/5] james-project git commit: JAMES-1830 jsieve/mailets should be located in server/mailet/.../jsieve

Posted by ad...@apache.org.
JAMES-1830 jsieve/mailets should be located in server/mailet/.../jsieve


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/0501c99a
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/0501c99a
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/0501c99a

Branch: refs/heads/master
Commit: 0501c99a94dc8ddfdd691bf098135d8c02462c3c
Parents: 2fda869
Author: Benoit Tellier <bt...@linagora.com>
Authored: Mon Oct 3 16:51:37 2016 +0200
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Tue Oct 4 15:57:27 2016 +0200

----------------------------------------------------------------------
 server/mailet/mailets/pom.xml                   |  18 +-
 .../james/transport/mailets/SieveMailet.java    |   6 +-
 .../transport/mailets/jsieve/ActionContext.java |  81 +++
 .../mailets/jsieve/ActionDispatcher.java        | 103 ++++
 .../transport/mailets/jsieve/ActionUtils.java   |  80 +++
 .../mailets/jsieve/CommonsLoggingAdapter.java   | 142 ++++++
 .../mailets/jsieve/FileIntoAction.java          | 142 ++++++
 .../transport/mailets/jsieve/KeepAction.java    |  65 +++
 .../transport/mailets/jsieve/MailAction.java    |  40 ++
 .../james/transport/mailets/jsieve/Poster.java  |  40 ++
 .../mailets/jsieve/RedirectAction.java          |  72 +++
 .../transport/mailets/jsieve/RejectAction.java  | 144 ++++++
 .../mailets/jsieve/ResourceLocator.java         |  92 ++++
 .../mailets/jsieve/SieveMailAdapter.java        | 504 +++++++++++++++++++
 .../mailets/jsieve/SieveMailboxMailet.java      | 464 +++++++++++++++++
 .../mailets/jsieve/VacationAction.java          | 100 ++++
 .../transport/mailets/jsieve/VacationReply.java | 169 +++++++
 .../mailets/jsieve/mdn/ActionModeAutomatic.java |  42 ++
 .../mailets/jsieve/mdn/ActionModeManual.java    |  47 ++
 .../mailets/jsieve/mdn/Disposition.java         | 176 +++++++
 .../jsieve/mdn/DispositionActionMode.java       |  29 ++
 .../mailets/jsieve/mdn/DispositionModifier.java |  29 ++
 .../jsieve/mdn/DispositionSendingMode.java      |  29 ++
 .../mailets/jsieve/mdn/DispositionType.java     |  29 ++
 .../mailets/jsieve/mdn/MDNFactory.java          | 115 +++++
 .../mailets/jsieve/mdn/ModifierError.java       |  44 ++
 .../mailets/jsieve/mdn/ModifierExpired.java     |  45 ++
 .../mailets/jsieve/mdn/ModifierFailed.java      |  45 ++
 .../jsieve/mdn/ModifierMailboxTerminated.java   |  45 ++
 .../mailets/jsieve/mdn/ModifierSuperseded.java  |  45 ++
 .../mailets/jsieve/mdn/ModifierWarning.java     |  45 ++
 .../jsieve/mdn/SendingModeAutomatic.java        |  45 ++
 .../mailets/jsieve/mdn/SendingModeManual.java   |  45 ++
 .../mailets/jsieve/mdn/TypeDeleted.java         |  45 ++
 .../mailets/jsieve/mdn/TypeDenied.java          |  44 ++
 .../mailets/jsieve/mdn/TypeDispatched.java      |  43 ++
 .../mailets/jsieve/mdn/TypeDisplayed.java       |  44 ++
 .../mailets/jsieve/mdn/TypeFailed.java          |  44 ++
 .../mailets/jsieve/mdn/TypeProcessed.java       |  44 ++
 .../mailets/delivery/SieveMailetTest.java       |   2 +-
 server/pom.xml                                  |  17 +-
 41 files changed, 3377 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/pom.xml
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/pom.xml b/server/mailet/mailets/pom.xml
index 78d7f12..ee2dc9d 100644
--- a/server/mailet/mailets/pom.xml
+++ b/server/mailet/mailets/pom.xml
@@ -36,6 +36,14 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.james</groupId>
+            <artifactId>apache-mime4j-dom</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-mime4j-james-utils</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
             <artifactId>james-server-util</artifactId>
         </dependency>
         <dependency>
@@ -72,16 +80,6 @@
             <artifactId>james-server-core</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>apache-jsieve-mailet</artifactId>
-            <!--             <exclusions> -->
-            <!--                 <exclusion> -->
-            <!--                     <artifactId>apache-mime4j</artifactId> -->
-            <!--                     <groupId>org.apache.james</groupId> -->
-            <!--                 </exclusion> -->
-            <!--             </exclusions> -->
-        </dependency>
-        <dependency>
             <groupId>org.apache.james.protocols</groupId>
             <artifactId>protocols-managesieve</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java
index dcf6f26..2526fc8 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java
@@ -31,12 +31,12 @@ import org.apache.james.mailbox.exception.BadCredentialsException;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.transport.mailets.jsieve.Poster;
+import org.apache.james.transport.mailets.jsieve.ResourceLocator;
+import org.apache.james.transport.mailets.jsieve.SieveMailboxMailet;
 import org.apache.james.transport.util.MailetContextLog;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.james.user.api.UsersRepositoryException;
-import org.apache.jsieve.mailet.Poster;
-import org.apache.jsieve.mailet.ResourceLocator;
-import org.apache.jsieve.mailet.SieveMailboxMailet;
 import org.apache.mailet.Mail;
 import org.apache.mailet.MailAddress;
 import org.apache.mailet.MailetConfig;

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionContext.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionContext.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionContext.java
new file mode 100644
index 0000000..0f78115
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionContext.java
@@ -0,0 +1,81 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.transport.mailets.jsieve;
+
+import java.util.Collection;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.MimeMessage;
+
+import org.apache.commons.logging.Log;
+import org.apache.mailet.MailAddress;
+import org.joda.time.DateTime;
+
+/**
+ * Provides context for action execution.
+ */
+public interface ActionContext {
+
+    /**
+     * @return Date the script was activated
+     */
+    DateTime getScriptActivationDate();
+
+    /**
+     * @return Date the script is currently interpreted
+     */
+    DateTime getScriptInterpretationDate();
+
+    /**
+     * @return Recipient receiving the given eMail
+     */
+    MailAddress getRecipient();
+
+    /**
+     * Gets the log.
+     * @return not null
+     */
+    public Log getLog();
+    
+    /**
+     * Experimental mail delivery. 
+     * POST verb indicate that mail should be attached to the collection
+     * indicated by the given URI.
+     * 
+     * @param uri indicates the destination to which the mail to added. ATM 
+     * the value should be mailbox://<user>@localhost/<mailbox-path>
+     * @param mail not null
+     */
+    public void post(String uri, MimeMessage mail) throws MessagingException;
+
+    /**
+     * Posts the given mail.
+     * @param sender possibly null
+     * @param recipients not null
+     * @param mail not null
+     * @throws MessagingException when mail cannot be posted
+     */
+    public void post(MailAddress sender, Collection<MailAddress> recipients, MimeMessage mail) throws MessagingException;
+
+    /**
+     * Gets name (including version) of this server.
+     * @return not nul
+     */
+    public String getServerInfo();
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionDispatcher.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionDispatcher.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionDispatcher.java
new file mode 100644
index 0000000..61f8953
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionDispatcher.java
@@ -0,0 +1,103 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve;
+
+import org.apache.jsieve.mail.Action;
+import org.apache.jsieve.mail.ActionFileInto;
+import org.apache.jsieve.mail.ActionKeep;
+import org.apache.jsieve.mail.ActionRedirect;
+import org.apache.jsieve.mail.ActionReject;
+import org.apache.jsieve.mail.optional.ActionVacation;
+import org.apache.mailet.Mail;
+
+import javax.mail.MessagingException;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+/**
+ * Dynamically dispatches an Action depending on the type of Action received at runtime.
+ * <h4>Thread Safety</h4>
+ * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
+ */
+public class ActionDispatcher {
+    /**
+     * A Map keyed by the type of Action. The values are the methods to invoke to
+     * handle the Action.
+     * <Action, MailAction>
+     */
+    private ConcurrentMap<Class, MailAction> fieldMailActionMap;
+
+    /**
+     * Constructor for ActionDispatcher.
+     *
+     * @throws NoSuchMethodException
+     */
+    public ActionDispatcher() {
+        super();
+        setMethodMap(defaultMethodMap());
+    }
+
+    /**
+     * Method execute executes the passed Action by invoking the method mapped by the
+     * receiver with a parameter of the EXACT type of Action.
+     *
+     * @param anAction not null
+     * @param aMail    not null
+     * @param context  not null
+     * @throws MessagingException
+     */
+    public void execute(final Action anAction, final Mail aMail, final ActionContext context) throws MessagingException {
+        final MailAction mailAction = getMethodMap().get(anAction.getClass());
+        mailAction.execute(anAction, aMail, context);
+    }
+
+    /**
+     * Returns the methodMap.
+     *
+     * @return Map
+     */
+    public ConcurrentMap<Class, MailAction> getMethodMap() {
+        return fieldMailActionMap;
+    }
+
+    /**
+     * Returns a new methodMap.
+     *
+     * @return Map
+     */
+    private ConcurrentMap<Class, MailAction> defaultMethodMap() {
+        final ConcurrentMap<Class, MailAction> actionMap = new ConcurrentHashMap<Class, MailAction>(4);
+        actionMap.put(ActionFileInto.class, new FileIntoAction());
+        actionMap.put(ActionKeep.class, new KeepAction());
+        actionMap.put(ActionRedirect.class, new RedirectAction());
+        actionMap.put(ActionReject.class, new RejectAction());
+        actionMap.put(ActionVacation.class, new VacationAction());
+        return actionMap;
+    }
+
+    /**
+     * Sets the mail action mail.
+     *
+     * @param mailActionMap <Action, MailAction> not null
+     */
+    protected void setMethodMap(ConcurrentMap<Class, MailAction> mailActionMap) {
+        fieldMailActionMap = mailActionMap;
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionUtils.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionUtils.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionUtils.java
new file mode 100644
index 0000000..3645e8c
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ActionUtils.java
@@ -0,0 +1,80 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve;
+
+import javax.mail.MessagingException;
+
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+
+/**
+ * Utility methods helpful for actions.
+ */
+public class ActionUtils
+{
+    
+    private final static String ATTRIBUTE_PREFIX = ActionUtils.class.getPackage().getName() + ".";
+
+    /**
+     * Answers the sole intended recipient for aMail.
+     * 
+     * @param aMail
+     * @return String
+     * @throws MessagingException
+     */
+    public static MailAddress getSoleRecipient(Mail aMail) throws MessagingException
+    {
+        if (aMail.getRecipients() == null) {
+            throw new MessagingException("Invalid number of recipients - 0"
+                    + ". Exactly 1 recipient is expected.");
+        } else if (1 != aMail.getRecipients().size())
+            throw new MessagingException("Invalid number of recipients - "
+                    + Integer.toString(aMail.getRecipients().size())
+                    + ". Exactly 1 recipient is expected.");
+        return aMail.getRecipients().iterator().next();
+    }
+
+    /**
+     * Detect and handle locally looping mail. External loop detection is left
+     * to the MTA.
+     * 
+     * @param aMail
+     * @param context not null
+     * @param anAttributeSuffix
+     * @throws MessagingException
+     */
+    public static void detectAndHandleLocalLooping(Mail aMail, ActionContext context, String anAttributeSuffix)
+            throws MessagingException
+    {
+        MailAddress thisRecipient = getSoleRecipient(aMail);
+        MailAddress lastRecipient = (MailAddress) aMail
+                .getAttribute(ATTRIBUTE_PREFIX + anAttributeSuffix);
+        if (null != lastRecipient && lastRecipient.equals(thisRecipient))
+        {
+            MessagingException ex = new MessagingException(
+                    "This message is looping! Message ID: "
+                            + aMail.getMessage().getMessageID());
+            context.getLog().warn(ex.getMessage(), ex);
+            throw ex;
+        }
+        aMail.setAttribute(ATTRIBUTE_PREFIX + anAttributeSuffix,
+                thisRecipient);
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/CommonsLoggingAdapter.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/CommonsLoggingAdapter.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/CommonsLoggingAdapter.java
new file mode 100644
index 0000000..9999a99
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/CommonsLoggingAdapter.java
@@ -0,0 +1,142 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.transport.mailets.jsieve;
+
+import org.apache.commons.logging.Log;
+import org.apache.mailet.base.GenericMailet;
+
+/**
+ * Adapts commons logging to mailet logging.
+ */
+class CommonsLoggingAdapter implements Log {
+    
+    public static final int TRACE = 6;
+    public static final int DEBUG = 5;
+    public static final int INFO = 4;
+    public static final int WARN = 3;
+    public static final int ERROR = 2;
+    public static final int FATAL = 1;
+    
+    private final GenericMailet mailet;
+    private final int level;
+    
+    public CommonsLoggingAdapter(final GenericMailet mailet, final int level) {
+        super();
+        this.mailet = mailet;
+        this.level = level;
+    }
+
+    public void debug(Object message) {
+        if (isDebugEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString());
+        }
+    }
+
+    public void debug(Object message, Throwable t) {
+        if (isDebugEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString(), t);
+        } 
+    }
+
+    public void error(Object message) {
+        if (isErrorEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString());
+        }
+    }
+
+    public void error(Object message, Throwable t) {
+        if (isErrorEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString(), t);
+        }
+    }
+
+    public void fatal(Object message) {
+        if (isFatalEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString());
+        }
+    }
+
+    public void fatal(Object message, Throwable t) {
+        if (isFatalEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString(), t);
+        }
+    }
+
+    public void info(Object message) {
+        if (isInfoEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString());
+        }
+    }
+
+    public void info(Object message, Throwable t) {
+        if (isInfoEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString(), t);
+        }
+    }
+
+    public boolean isDebugEnabled() {
+        return level <= DEBUG;
+    }
+
+    public boolean isErrorEnabled() {
+        return level <= ERROR;
+    }
+
+    public boolean isFatalEnabled() {
+        return level <= FATAL;
+    }
+
+    public boolean isInfoEnabled() {
+        return level <= INFO;
+    }
+
+    public boolean isTraceEnabled() {
+        return level <= TRACE;
+    }
+
+    public boolean isWarnEnabled() {
+        return level <= WARN;
+    }
+
+    public void trace(Object message) {
+        if (isTraceEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString());
+        }
+    }
+
+    public void trace(Object message, Throwable t) {
+        if (isTraceEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString(), t);
+        }
+    }
+
+    public void warn(Object message) {
+        if (isWarnEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString());
+        }
+    }
+
+    public void warn(Object message, Throwable t) {
+        if (isWarnEnabled()) {
+            mailet.log(message == null ? "NULL" : message.toString(), t);
+        }
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/FileIntoAction.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/FileIntoAction.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/FileIntoAction.java
new file mode 100644
index 0000000..3d2bcd7
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/FileIntoAction.java
@@ -0,0 +1,142 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.transport.mailets.jsieve;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.MimeMessage;
+
+import org.apache.commons.logging.Log;
+import org.apache.jsieve.mail.Action;
+import org.apache.jsieve.mail.ActionFileInto;
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+
+/**
+ * Performs the filing of a mail into a specified destination. 
+ * <h4>Thread Safety</h4>
+ * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
+ */
+public class FileIntoAction implements MailAction {
+    
+    private static final char HIERARCHY_DELIMITER = '.';
+
+    public void execute(Action action, Mail mail, ActionContext context) throws MessagingException {
+        if (action instanceof ActionFileInto) {
+            final ActionFileInto fileIntoAction = (ActionFileInto) action;
+            execute(fileIntoAction, mail, context);
+        }
+    }
+
+    /**
+     * <p>
+     * Executes the passed ActionFileInto.
+     * </p>
+     * 
+     * <p>
+     * This implementation accepts any destination with the root of <code>INBOX</code>.
+     * </p>
+     * 
+     * <p>
+     * As the current POP3 server does not support sub-folders, the mail is
+     * stored in the INBOX for the recipient of the mail and the full intended
+     * destination added as a prefix to the message's subject.
+     * </p>
+     * 
+     * <p>
+     * When IMAP support is added to James, it will be possible to support
+     * sub-folders of <code>INBOX</code> fully.
+     * </p>
+     * 
+     * @param anAction
+     * @param aMail
+     * @param context not null
+     * @throws MessagingException
+     */
+    @SuppressWarnings("deprecation")
+    public void execute(ActionFileInto anAction, Mail aMail, final ActionContext context) throws MessagingException
+    {
+        String destinationMailbox = anAction.getDestination();
+        MailAddress recipient;
+        boolean delivered = false;
+        try
+        {
+            recipient = ActionUtils.getSoleRecipient(aMail);
+            MimeMessage localMessage = createMimeMessage(aMail, recipient);
+            
+            if (!(destinationMailbox.length() > 0 
+                    && destinationMailbox.charAt(0) == HIERARCHY_DELIMITER)) {
+                destinationMailbox =  HIERARCHY_DELIMITER + destinationMailbox;
+            }
+            
+            final String mailbox = destinationMailbox.replace(HIERARCHY_DELIMITER, '/');
+            final String host;
+            if (mailbox.charAt(0) == '/') {
+                host = "@localhost";
+            } else {
+                host = "@localhost/";
+            }
+            final String url = "mailbox://" + recipient.getUser() + host + mailbox;
+            //TODO: copying this message so many times seems a waste
+            context.post(url, localMessage);
+            delivered = true;
+        }
+        catch (MessagingException ex)
+        {
+            final Log log = context.getLog();
+            if (log.isDebugEnabled()) {
+                log.debug("Error while storing mail into. "+destinationMailbox, ex);
+            }
+            throw ex;
+        }
+        finally
+        {
+            // Ensure the mail is always ghosted
+            aMail.setState(Mail.GHOST);
+        }
+        if (delivered)
+        {
+            final Log log = context.getLog();
+            if (log.isDebugEnabled()) {
+                log.debug("Filed Message ID: "
+                    + aMail.getMessage().getMessageID()
+                    + " into destination: \""
+                    + destinationMailbox + "\"");
+            }
+        }
+    }
+    
+    private static MimeMessage createMimeMessage(Mail aMail, MailAddress recipient) throws MessagingException {
+        // Adapted from LocalDelivery Mailet
+        // Add qmail's de facto standard Delivered-To header
+        MimeMessage localMessage = new MimeMessage(aMail.getMessage())
+        {
+            protected void updateHeaders() throws MessagingException
+            {
+                if (getMessageID() == null)
+                    super.updateHeaders();
+                else
+                    modified = false;
+            }
+        };
+        localMessage.addHeader("Delivered-To", recipient.toString());
+
+        localMessage.saveChanges();
+        return localMessage;
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/KeepAction.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/KeepAction.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/KeepAction.java
new file mode 100644
index 0000000..03bdfd0
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/KeepAction.java
@@ -0,0 +1,65 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.transport.mailets.jsieve;
+
+import javax.mail.MessagingException;
+
+import org.apache.jsieve.mail.Action;
+import org.apache.jsieve.mail.ActionFileInto;
+import org.apache.jsieve.mail.ActionKeep;
+import org.apache.mailet.Mail;
+
+/**
+ * Performs the filing of a mail into the inbox. 
+ * <h4>Thread Safety</h4>
+ * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
+ */
+public class KeepAction extends FileIntoAction implements MailAction {
+    
+    private static final String INBOX = "INBOX";
+
+    public void execute(Action action, Mail mail, ActionContext context)
+            throws MessagingException {
+        if (action instanceof ActionKeep) {
+            final ActionKeep actionKeep = (ActionKeep) action;
+            execute(actionKeep, mail, context);
+        }
+    }
+
+    /**
+     * <p>
+     * Executes the passed ActionKeep.
+     * </p>
+     * 
+     * <p>
+     * In this implementation, "keep" is equivalent to "fileinto" with a
+     * destination of "INBOX".
+     * </p>
+     * 
+     * @param anAction not null
+     * @param aMail not null
+     * @param context not null
+     * @throws MessagingException
+     */
+    public void execute(ActionKeep anAction, Mail aMail, ActionContext context) throws MessagingException
+    {
+        final ActionFileInto action = new ActionFileInto(INBOX);
+        execute(action, aMail, context);
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/MailAction.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/MailAction.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/MailAction.java
new file mode 100644
index 0000000..78d26f6
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/MailAction.java
@@ -0,0 +1,40 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.transport.mailets.jsieve;
+
+import javax.mail.MessagingException;
+
+import org.apache.jsieve.mail.Action;
+import org.apache.mailet.Mail;
+
+/**
+ * Executes a Sieve action.
+ * Implementations may be accessed concurrently by multiple threads.
+ */
+public interface MailAction {
+    
+    /**
+     * Executes the given action.
+     * @param action not null
+     * @param mail not null
+     * @param context not null
+     * @throws MessagingException when action cannot be executed
+     */
+    public void execute(final Action action, final Mail mail, final ActionContext context) throws MessagingException;
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/Poster.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/Poster.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/Poster.java
new file mode 100644
index 0000000..aa77e0b
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/Poster.java
@@ -0,0 +1,40 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.MimeMessage;
+
+/**
+ * Experimental interface.
+ */
+public interface Poster {
+    
+    /**
+     * Experimental mail delivery. 
+     * POST verb indicate that mail should be attached to the collection
+     * indicated by the given URI.
+     * 
+     * @param uri indicates the destination to which the mail to added. ATM 
+     * the value should be mailbox://<user>@localhost/<mailbox-path>
+     * @param mail not null
+     */
+    public void post(String uri, MimeMessage mail) throws MessagingException;
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RedirectAction.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RedirectAction.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RedirectAction.java
new file mode 100644
index 0000000..c56fe4f
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RedirectAction.java
@@ -0,0 +1,72 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.transport.mailets.jsieve;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.InternetAddress;
+
+import org.apache.commons.logging.Log;
+import org.apache.jsieve.mail.Action;
+import org.apache.jsieve.mail.ActionRedirect;
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+
+/**
+ * Performs the redirection of a mail. 
+ * <h4>Thread Safety</h4>
+ * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
+ */
+public class RedirectAction implements MailAction {
+
+    public void execute(Action action, Mail mail, ActionContext context)
+            throws MessagingException {
+        if (action instanceof ActionRedirect) {
+            final ActionRedirect actionRedirect = (ActionRedirect) action;
+            execute(actionRedirect, mail, context);
+        }
+
+    }
+
+    /**
+     * Method execute executes the passed ActionRedirect.
+     * 
+     * @param anAction not nul
+     * @param aMail not null
+     * @param context not null
+     * @throws MessagingException
+     */
+    public void execute(ActionRedirect anAction, Mail aMail, ActionContext context) throws MessagingException
+    {
+        ActionUtils.detectAndHandleLocalLooping(aMail, context, "redirect");
+        Collection<MailAddress> recipients = new ArrayList<MailAddress>(1);
+        recipients.add(new MailAddress(new InternetAddress(anAction.getAddress())));
+        MailAddress sender = aMail.getSender();
+        context.post(sender, recipients, aMail.getMessage());
+        aMail.setState(Mail.GHOST);
+        Log log = context.getLog();
+        if (log.isDebugEnabled()) {
+            log.debug("Redirected Message ID: "
+                + aMail.getMessage().getMessageID() + " to \""
+                + anAction.getAddress() + "\"");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RejectAction.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RejectAction.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RejectAction.java
new file mode 100644
index 0000000..f792f82
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RejectAction.java
@@ -0,0 +1,144 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.transport.mailets.jsieve;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.mail.Address;
+import javax.mail.MessagingException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+
+import org.apache.james.transport.mailets.jsieve.mdn.ActionModeAutomatic;
+import org.apache.james.transport.mailets.jsieve.mdn.Disposition;
+import org.apache.james.transport.mailets.jsieve.mdn.DispositionModifier;
+import org.apache.james.transport.mailets.jsieve.mdn.MDNFactory;
+import org.apache.james.transport.mailets.jsieve.mdn.ModifierError;
+import org.apache.james.transport.mailets.jsieve.mdn.SendingModeAutomatic;
+import org.apache.james.transport.mailets.jsieve.mdn.TypeDeleted;
+import org.apache.jsieve.mail.Action;
+import org.apache.jsieve.mail.ActionReject;
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+
+/**
+ * Performs the rejection of a mail, with a reply to the sender. 
+ * <h4>Thread Safety</h4>
+ * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
+ */
+public class RejectAction implements MailAction {
+
+    public void execute(Action action, Mail mail, ActionContext context)
+            throws MessagingException {
+        if (action instanceof ActionReject) {
+            final ActionReject actionReject = (ActionReject) action;
+            execute(actionReject, mail, context);
+        }
+
+    }
+
+    /**
+     * <p>
+     * Method execute executes the passed ActionReject. It sends an RFC 2098
+     * compliant reject MDN back to the sender.
+     * </p>
+     * <p>
+     * NOTE: The Mimecontent type should be 'report', but as we do not yet have
+     * a DataHandler for this yet, its currently 'text'!
+     * 
+     * @param anAction not null
+     * @param aMail not null
+     * @param context not null
+     * @throws MessagingException
+     */
+    public void execute(ActionReject anAction, Mail aMail, ActionContext context) throws MessagingException
+    {
+        ActionUtils.detectAndHandleLocalLooping(aMail, context, "reject");
+
+        // Create the MDN part
+        StringBuilder humanText = new StringBuilder(128);
+        humanText.append("This message was refused by the recipient's mail filtering program.");
+        humanText.append("\r\n");
+        humanText.append("The reason given was:");
+        humanText.append("\r\n");
+        humanText.append("\r\n");
+        humanText.append(anAction.getMessage());
+
+        String reporting_UA_name = null;
+        try
+        {
+            reporting_UA_name = InetAddress.getLocalHost()
+                    .getCanonicalHostName();
+        }
+        catch (UnknownHostException ex)
+        {
+            reporting_UA_name = "localhost";
+        }
+
+        String reporting_UA_product = context.getServerInfo();
+
+        String[] originalRecipients = aMail.getMessage().getHeader(
+                "Original-Recipient");
+        String original_recipient = null;
+        if (null != originalRecipients && originalRecipients.length > 0)
+        {
+            original_recipient = originalRecipients[0];
+        }
+
+        MailAddress soleRecipient = ActionUtils.getSoleRecipient(aMail);
+        String final_recipient = soleRecipient.toString();
+
+        String original_message_id = aMail.getMessage().getMessageID();
+
+        DispositionModifier modifiers[] = {new ModifierError()};
+        Disposition disposition = new Disposition(new ActionModeAutomatic(),
+                new SendingModeAutomatic(), new TypeDeleted(), modifiers);
+
+        MimeMultipart multiPart = MDNFactory.create(humanText.toString(),
+                reporting_UA_name, reporting_UA_product, original_recipient,
+                final_recipient, original_message_id, disposition);
+
+        // Send the message
+        MimeMessage reply = (MimeMessage) aMail.getMessage().reply(false);
+        reply.setFrom(soleRecipient.toInternetAddress());
+        reply.setContent(multiPart);
+        reply.saveChanges();
+        Address[] recipientAddresses = reply.getAllRecipients();
+        if (null != recipientAddresses)
+        {
+            Collection<MailAddress> recipients = new ArrayList<MailAddress>(recipientAddresses.length);
+            for (Address recipientAddress : recipientAddresses) {
+                recipients.add(new MailAddress(
+                        (InternetAddress) recipientAddress));
+            }
+            context.post(null, recipients, reply);
+        }
+        else
+        {
+            context.getLog().info("Unable to send reject MDN. Could not determine the recipient.");
+        }
+        // Ghost the original mail
+        aMail.setState(Mail.GHOST);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ResourceLocator.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ResourceLocator.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ResourceLocator.java
new file mode 100644
index 0000000..01d38a5
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/ResourceLocator.java
@@ -0,0 +1,92 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.transport.mailets.jsieve;
+
+import org.joda.time.DateTime;
+
+import java.io.InputStream;
+
+/**
+ * <p>Experimental API locates resources. 
+ * Used to load Sieve scripts. The base for relative URLs
+ * should be taken to be the root of the James configuration.
+ * </p><p>
+ * Required schemas:
+ * </p>
+ * <ul>
+ * <li><strong>User sieve scripts</strong> - the relative URL scheme 
+ * <code>//<em>user</em>@<em>host</em>/<em>sieve</em> will be used to
+ * obtain the script
+ * </ul>
+ * <p>
+ * The advantage of using <code>URI</code>s 
+ * and verbs (for example <code>GET</code>, <code>POST</code>)
+ * are their uniformity. The same API can be used to interface radically
+ * different resource types and protocols. This allows concise, minimal,
+ * powerful APIs to be created. Their simplicity is easy to preserved 
+ * across versions. 
+ * </p><p>
+ * The disadvantage is that this free decouple means that there is 
+ * no gaurantee that the implementations decoupled by this interface
+ * actually support the same scheme. Issues will be caught only 
+ * at deployment and not at compile time.
+ * This places a larger burden on the deployer.
+ * </p><p>
+ * Either an understanding or a consistent URL mapping scheme may be 
+ * required. For example, <code>//john.smith@localhost/sieve</code>
+ * may need to be resolved to <code>../apps/james/var/sieve/john.smith@localhost.sieve</code>
+ * when using the file system to store scripts. Note that names <strong>MUST</strong>
+ * be normalised before resolving on a file system.
+ * </p>
+ */
+public interface ResourceLocator {
+
+    class UserSieveInformation {
+        private DateTime scriptActivationDate;
+        private DateTime scriptInterpretationDate;
+        private InputStream scriptContent;
+
+        public UserSieveInformation(DateTime scriptActivationDate, DateTime scriptInterpretationDate, InputStream scriptContent) {
+            this.scriptActivationDate = scriptActivationDate;
+            this.scriptInterpretationDate = scriptInterpretationDate;
+            this.scriptContent = scriptContent;
+        }
+
+        public DateTime getScriptActivationDate() {
+            return scriptActivationDate;
+        }
+
+        public DateTime getScriptInterpretationDate() {
+            return scriptInterpretationDate;
+        }
+
+        public InputStream getScriptContent() {
+            return scriptContent;
+        }
+    }
+
+    /**
+     * GET verb locates and loads a resource. 
+     * @param uri identifies the Sieve script 
+     * @return not null
+     * @throws Exception when the resource cannot be located
+     */
+    UserSieveInformation get(String uri) throws Exception;
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/SieveMailAdapter.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/SieveMailAdapter.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/SieveMailAdapter.java
new file mode 100644
index 0000000..897b6d6
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/SieveMailAdapter.java
@@ -0,0 +1,504 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.transport.mailets.jsieve;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.james.mime4j.dom.address.AddressList;
+import org.apache.james.mime4j.dom.address.Mailbox;
+import org.apache.james.mime4j.dom.address.MailboxList;
+import org.apache.james.mime4j.dom.field.ParseException;
+import org.apache.james.mime4j.field.address.DefaultAddressParser;
+import org.apache.james.mime4j.utils.search.MessageMatcher;
+import org.apache.jsieve.SieveContext;
+import org.apache.jsieve.exception.InternetAddressException;
+import org.apache.jsieve.exception.SieveException;
+import org.apache.jsieve.mail.Action;
+import org.apache.jsieve.mail.AddressImpl;
+import org.apache.jsieve.mail.MailAdapter;
+import org.apache.jsieve.mail.MailUtils;
+import org.apache.jsieve.mail.SieveMailException;
+import org.apache.jsieve.mail.optional.EnvelopeAccessors;
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+import org.apache.mailet.MailetContext;
+import org.joda.time.DateTime;
+
+import javax.mail.Header;
+import javax.mail.MessagingException;
+import javax.mail.internet.MimeMessage;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+/**
+ * <p>
+ * Class <code>SieveMailAdapter</code> implements a <code>MailAdapter</code>
+ * for use in a Mailet environment.
+ * </p>
+ */
+public class SieveMailAdapter implements MailAdapter, EnvelopeAccessors, ActionContext
+{
+    private static final Log LOG = LogFactory.getLog(SieveMailAdapter.class);
+    
+    private Log log = LOG;
+    
+    /**
+     * The Mail being adapted.
+     */
+    private Mail fieldMail;
+    /**
+     * The MailetContext.
+     */
+    private MailetContext fieldMailetContext;
+    /**
+     * List of Actions to perform.
+     */
+    private List<Action> fieldActions;
+    
+    private final ActionDispatcher dispatcher;
+    
+    private final Poster poster;
+    private final DateTime scriptActivationDate;
+    private final DateTime scriptInterpretationDate;
+    private final MailAddress recipient;
+
+    /**
+     * Constructor for SieveMailAdapter.
+     * 
+     * @param aMail
+     * @param aMailetContext
+     */
+    public SieveMailAdapter(final Mail aMail, final MailetContext aMailetContext, final ActionDispatcher dispatcher, final Poster poster,
+                            DateTime scriptActivationDate, DateTime scriptInterpretationDate, MailAddress recipient)
+    {
+        this.poster = poster;
+        this.dispatcher = dispatcher;
+        this.scriptInterpretationDate = scriptInterpretationDate;
+        this.scriptActivationDate = scriptActivationDate;
+        this.recipient = recipient;
+        setMail(aMail);
+        setMailetContext(aMailetContext);
+    }
+
+    public DateTime getScriptActivationDate() {
+        return scriptActivationDate;
+    }
+
+    public DateTime getScriptInterpretationDate() {
+        return scriptInterpretationDate;
+    }
+
+    public MailAddress getRecipient() {
+        return recipient;
+    }
+
+    public void setLog(Log log) {
+        this.log = log;
+    }
+
+    /**
+     * Returns the message.
+     * 
+     * @return MimeMessage
+     */
+    protected MimeMessage getMessage() throws MessagingException
+    {
+        return getMail().getMessage();
+    }
+    /**
+     * Returns the List of actions.
+     * 
+     * @return List
+     */
+    public List<Action> getActions()
+    {
+        List<Action> actions = null;
+        if (null == (actions = getActionsBasic()))
+        {
+            updateActions();
+            return getActions();
+        }
+        return actions;
+    }
+    /**
+     * Returns a new List of actions.
+     * 
+     * @return List
+     */
+    protected List<Action> computeActions()
+    {
+        return new ArrayList<Action>();
+    }
+    /**
+     * Returns the List of actions.
+     * 
+     * @return List
+     */
+    private List<Action> getActionsBasic()
+    {
+        return fieldActions;
+    }
+    /**
+     * Adds an Action.
+     * 
+     * @param action The action to set
+     */
+    public void addAction(Action action)
+    {
+        getActions().add(action);
+    }
+    /**
+     * @see org.apache.jsieve.mail.MailAdapter#executeActions()
+     */
+    public void executeActions() throws SieveException
+    {
+        final List<Action> actions = getActions();
+        for (final Action action: actions) {
+            getMailetContext().log("Executing action: " + action.toString());
+            try
+            {
+                dispatcher.execute(action, getMail(), this);
+            }
+            catch (MessagingException e)
+            {
+                throw new SieveException(e);
+            }
+        }
+    }
+    /**
+     * Sets the actions.
+     * 
+     * @param actions The actions to set
+     */
+    protected void setActions(List<Action> actions)
+    {
+        fieldActions = actions;
+    }
+    
+    /**
+     * Updates the actions.
+     */
+    protected void updateActions()
+    {
+        setActions(computeActions());
+    }
+
+    /**
+     * @see org.apache.jsieve.mail.MailAdapter#getHeader(String)
+     */
+    public List<String> getHeader(String name) throws SieveMailException
+    {
+        try
+        {
+            String[] headers = getMessage().getHeader(name);
+            return (headers == null ? new ArrayList<String>(0) : Arrays.asList(headers));
+        }
+        catch (MessagingException ex)
+        {
+            throw new SieveMailException(ex);
+        }
+    }
+    
+    /**
+     * @see org.apache.jsieve.mail.MailAdapter#getHeaderNames()
+     */
+    public List<String> getHeaderNames() throws SieveMailException
+    {
+        Set<String> headerNames = new HashSet<String>();
+        try
+        {
+            Enumeration allHeaders = getMessage().getAllHeaders();
+            while (allHeaders.hasMoreElements())
+            {
+                headerNames.add(((Header) allHeaders.nextElement()).getName());
+            }
+            return new ArrayList<String>(headerNames);
+        }
+        catch (MessagingException ex)
+        {
+            throw new SieveMailException(ex);
+        }
+    }
+    
+    /**
+     * @see org.apache.jsieve.mail.MailAdapter#getMatchingHeader(String)
+     */
+    public List<String> getMatchingHeader(String name) throws SieveMailException
+    {
+        return MailUtils.getMatchingHeader(this, name);
+    }
+    
+    /**
+     * @see org.apache.jsieve.mail.MailAdapter#getSize()
+     */
+    public int getSize() throws SieveMailException
+    {
+        try
+        {
+            return (int) getMail().getMessageSize();
+        }
+        catch (MessagingException ex)
+        {
+            throw new SieveMailException(ex);
+        }
+    }
+    
+    /**
+     * Method getEnvelopes.
+     * 
+     * @return Map
+     */
+    protected Map<String, String> getEnvelopes()
+    {
+        Map<String, String> envelopes = new HashMap<String, String>(2);
+        if (null != getEnvelopeFrom())
+            envelopes.put("From", getEnvelopeFrom());
+        if (null != getEnvelopeTo())
+            envelopes.put("To", getEnvelopeTo());
+        return envelopes;
+    }
+    /**
+     * @see org.apache.jsieve.mail.optional.EnvelopeAccessors#getEnvelope(String)
+     */
+    public List<String> getEnvelope(String name) throws SieveMailException
+    {
+        List<String> values = new ArrayList<String>(1);
+        String value = getEnvelopes().get(name);
+        if (null != value)
+            values.add(value);
+        return values;
+    }
+    
+    /**
+     * @see org.apache.jsieve.mail.optional.EnvelopeAccessors#getEnvelopeNames()
+     */
+    public List<String> getEnvelopeNames() throws SieveMailException
+    {
+        return new ArrayList<String>(getEnvelopes().keySet());
+    }
+    
+    /**
+     * @see org.apache.jsieve.mail.optional.EnvelopeAccessors#getMatchingEnvelope(String)
+     */
+    public List<String> getMatchingEnvelope(String name) throws SieveMailException
+    {
+        final List<String> matchedEnvelopeValues = new ArrayList<String>(32);
+        for (String envelopeName: getEnvelopeNames()) {
+            if (envelopeName.trim().equalsIgnoreCase(name))
+                matchedEnvelopeValues.addAll(getEnvelope(envelopeName));
+        }
+        return matchedEnvelopeValues;
+    }
+    
+    /**
+     * Returns the from.
+     * 
+     * @return String
+     */
+    public String getEnvelopeFrom()
+    {
+        MailAddress sender = getMail().getSender(); 
+        return (null == sender ? "" : sender.toString());
+    }
+    
+    /**
+     * Returns the sole recipient or null if there isn't one.
+     * 
+     * @return String
+     */
+    public String getEnvelopeTo()
+    {
+        for (MailAddress mailAddress : getMail().getRecipients()) {
+            String recipient = mailAddress.toInternetAddress().getAddress();
+            if (recipient != null) {
+                return recipient;
+            }
+        }
+        return null;
+    }
+    
+    /**
+     * Returns the mail.
+     * 
+     * @return Mail
+     */
+    public Mail getMail()
+    {
+        return fieldMail;
+    }
+    
+    /**
+     * Sets the mail.
+     * 
+     * @param mail The mail to set
+     */
+    protected void setMail(Mail mail)
+    {
+        fieldMail = mail;
+    }
+    
+    /**
+     * Returns the mailetContext.
+     * 
+     * @return MailetContext
+     */
+    public MailetContext getMailetContext()
+    {
+        return fieldMailetContext;
+    }
+    
+    /**
+     * Sets the mailetContext.
+     * 
+     * @param mailetContext The mailetContext to set
+     */
+    protected void setMailetContext(MailetContext mailetContext)
+    {
+        fieldMailetContext = mailetContext;
+    }
+    
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        String messageID = null;
+        try
+        {
+            messageID = getMail().getMessage().getMessageID();
+        }
+        catch (MessagingException e)
+        {
+            messageID = "<" + e.getMessage() + ">";
+        }
+        return getClass().getName() + " Envelope From: "
+                + (null == getEnvelopeFrom() ? "null" : getEnvelopeFrom())
+                + " Envelope To: "
+                + (null == getEnvelopeTo() ? "null" : getEnvelopeTo())
+                + " Message ID: " + (null == messageID ? "null" : messageID);
+    }
+    
+    public String getContentType() throws SieveMailException {
+        try {
+            return getMessage().getContentType();
+        } catch (MessagingException e) {
+            throw new SieveMailException(e);
+        }
+    }
+    
+    public Address[] parseAddresses(String arg) throws SieveMailException, InternetAddressException {
+        try {
+            List<String> headerValues = getHeader(arg);
+            List<MailboxList> mailboxes = new ArrayList<MailboxList>();
+            int size = 0;
+            for(String headerValue : headerValues) {
+                MailboxList mailboxList = new AddressList(DefaultAddressParser.DEFAULT.parseAddressList(headerValue), true).flatten();
+                size += mailboxList.size();
+                mailboxes.add(mailboxList);
+            }
+            int i = 0;
+            final Address[] results = new Address[size];
+            for(MailboxList mailboxList : mailboxes) {
+                for(Mailbox mailbox : mailboxList) {
+                    results[i] = new AddressImpl(mailbox.getLocalPart(), mailbox.getDomain());
+                    i++;
+                }
+            }
+            return results;
+        } catch (ParseException e) {
+            throw new InternetAddressException(e);
+        }
+    }
+
+    public Log getLog() {
+        return log;
+    }
+    
+    public String getServerInfo() {
+        return getMailetContext().getServerInfo();
+    }
+    public void post(String uri, MimeMessage mail) throws MessagingException {
+        poster.post(uri, mail);
+    }
+    
+    public void post(MailAddress sender, Collection recipients, MimeMessage mail) throws MessagingException {
+        getMailetContext().sendMail(sender, recipients, mail);
+    }
+
+    public boolean isInBodyText(List<String> phrasesCaseInsensitive) throws SieveMailException {
+        try {
+            return MessageMatcher.builder()
+                .contentTypes(Lists.newArrayList("text/plain"))
+                .includeHeaders(false)
+                .caseInsensitive(false)
+                .searchContents(Lists.transform(phrasesCaseInsensitive, new Function<String, CharSequence>() {
+                    public CharSequence apply(String s) {
+                        return s;
+                    }
+                })).build()
+                .messageMatches(getMail().getMessage().getInputStream());
+        } catch (Exception e) {
+            throw new SieveMailException("Error searching in the mail content", e);
+        }
+    }
+
+    public boolean isInBodyRaw(List<String> phrasesCaseInsensitive) throws SieveMailException {
+        try {
+            return MessageMatcher.builder()
+                .includeHeaders(false)
+                .caseInsensitive(false)
+                .ignoringMime(true)
+                .searchContents(Lists.transform(phrasesCaseInsensitive, new Function<String, CharSequence>() {
+                    public CharSequence apply(String s) {
+                        return s;
+                    }
+                })).build()
+                .messageMatches(getMail().getMessage().getInputStream());
+        } catch (Exception e) {
+            throw new SieveMailException("Error searching in the mail content", e);
+        }
+    }
+
+    public boolean isInBodyContent(List<String> contentTypes, List<String> phrasesCaseInsensitive) throws SieveMailException {
+        try {
+            return MessageMatcher.builder()
+                .contentTypes(contentTypes)
+                .includeHeaders(false)
+                .caseInsensitive(false)
+                .searchContents(Lists.transform(phrasesCaseInsensitive, new Function<String, CharSequence>() {
+                    public CharSequence apply(String s) {
+                        return s;
+                    }
+                })).build()
+                .messageMatches(getMail().getMessage().getInputStream());
+        } catch (Exception e) {
+            throw new SieveMailException("Error searching in the mail content", e);
+        }
+    }
+
+    public void setContext(SieveContext context) {}
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0501c99a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/SieveMailboxMailet.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/SieveMailboxMailet.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/SieveMailboxMailet.java
new file mode 100644
index 0000000..33ef4d4
--- /dev/null
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/SieveMailboxMailet.java
@@ -0,0 +1,464 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets.jsieve;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Vector;
+
+import javax.mail.Header;
+import javax.mail.MessagingException;
+import javax.mail.internet.InternetHeaders;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+
+import org.apache.commons.logging.Log;
+import org.apache.jsieve.ConfigurationManager;
+import org.apache.jsieve.SieveConfigurationException;
+import org.apache.jsieve.SieveFactory;
+import org.apache.jsieve.exception.SieveException;
+import org.apache.jsieve.parser.generated.ParseException;
+import org.apache.jsieve.parser.generated.TokenMgrError;
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+import org.apache.mailet.MailetConfig;
+import org.apache.mailet.MailetException;
+import org.apache.mailet.base.GenericMailet;
+import org.apache.mailet.base.RFC2822Headers;
+
+/**
+ * <p>Executes a <a href='http://www.rfc-editor.org/rfc/rfc3028.txt'>Sieve</a>
+ * script against incoming mail. The script applied is based on the recipient.</p>
+ * <h4>Init Parameters</h4>
+ * <table>
+ * <thead><tr><th>Name</th><th>Required</th><th>Values</th><th>Role</th></thead>
+ * <tr><td>verbose</td><td>No - defaults to false</td><td>true (ignoring case) to enable, otherwise disable</td>
+ * <td>
+ * Enables verbose logging.
+ * </td></tr>
+ * </table>
+ */
+public class SieveMailboxMailet extends GenericMailet {
+    
+    /**
+     * The delivery header
+     */
+    private String deliveryHeader;
+
+    /**
+     * resetReturnPath
+     */
+    private boolean resetReturnPath;
+    /** Experimental */
+    private Poster poster;
+    /** Experimental */
+    private ResourceLocator locator;
+    
+    /** Indicates whether this mailet should log verbosely */
+    private boolean verbose = false;
+    
+    private boolean consume = true;
+    /** Indicates whether this mailet should log minimal information */
+    private boolean quiet = true;
+
+    private SieveFactory factory;
+
+    private ActionDispatcher actionDispatcher;
+
+    private Log log;
+
+    /**
+     * For SDI
+     */
+    public SieveMailboxMailet() {}
+    
+    /**
+     * CDI
+     * @param poster not null
+     */
+    public SieveMailboxMailet(Poster poster, ResourceLocator locator) {
+        this();
+        this.poster = poster;
+        this.locator = locator;
+    }
+
+    
+    public ResourceLocator getLocator() {
+        return locator;
+    }
+
+    /**
+     * For SDI
+     * @param locator not null
+     */
+    public void setLocator(ResourceLocator locator) {
+        this.locator = locator;
+    }
+
+    public Poster getPoster() {
+        return poster;
+    }
+    
+    /**
+     * For SDI
+     * @param poster not null
+     */
+    public void setPoster(Poster poster) {
+        this.poster = poster;
+    }
+
+    /**
+     * Is this mailet GHOSTing all mail it processes?
+     * @return true when mailet consumes all mail, false otherwise
+     */
+    public boolean isConsume() {
+        return consume;
+    }
+
+    /**
+     * Sets whether this mailet should GHOST all mail.
+     * @param consume true when the mailet should consume all mail, 
+     * false otherwise
+     */
+    public void setConsume(boolean consume) {
+        this.consume = consume;
+    }
+
+    /**
+     * Is this mailet logging verbosely?
+     * This property is set by init parameters.
+     * @return true if logging should be verbose, false otherwise
+     */
+    public boolean isVerbose() {
+        return verbose;
+    }
+
+
+    /**
+     * Sets whether logging should be verbose for this mailet.
+     * This property is set by init parameters.
+     * This setting overrides {@link #isQuiet()}.
+     * @param verbose true when logging should be verbose,
+     * false otherwise
+     */
+    public void setVerbose(boolean verbose) {
+        this.verbose = verbose;
+    }
+
+    /**
+     * Is the logging for this mailet set to minimal?
+     * @return true
+     */
+    public boolean isQuiet() {
+        return quiet;
+    }
+
+    /**
+     * Sets the logging for this mailet to minimal.
+     * This is overriden by {@link #setVerbose(boolean)}.
+     * @param quiet true for minimal logging, false otherwise
+     */
+    public void setQuiet(boolean quiet) {
+        this.quiet = quiet;
+    }
+    
+   
+    /**
+     * Is informational logging turned on? 
+     * @return true when minimal logging is off,
+     * false when logging is minimal
+     */
+    public boolean isInfoLoggingOn() {
+        return verbose || !quiet;
+    }
+
+    @Override
+    public void init(MailetConfig config) throws MessagingException {
+        
+        super.init(config);
+
+        try {
+            final ConfigurationManager configurationManager = new ConfigurationManager();
+            final int logLevel;
+            if (verbose) {
+                logLevel = CommonsLoggingAdapter.TRACE;
+            } else if (quiet) {
+                logLevel = CommonsLoggingAdapter.FATAL;
+            } else {
+                logLevel = CommonsLoggingAdapter.WARN;
+            }
+            log = new CommonsLoggingAdapter(this, logLevel);
+            configurationManager.setLog(log);
+            factory = configurationManager.build();
+        } catch (SieveConfigurationException e) {
+            throw new MessagingException("Failed to load standard Sieve configuration.", e);
+        }
+    }
+
+    /**
+     * Delivers a mail to a local mailbox.
+     * 
+     * @param mail
+     *            the mail being processed
+     * 
+     * @throws MessagingException
+     *             if an error occurs while storing the mail
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void service(Mail mail) throws MessagingException {
+        Collection<MailAddress> recipients = mail.getRecipients();
+        Collection<MailAddress> errors = new Vector<MailAddress>();
+
+        MimeMessage message = null;
+        if (deliveryHeader != null || resetReturnPath) {
+            message = mail.getMessage();
+        }
+
+        if (resetReturnPath) {
+            // Set Return-Path and remove all other Return-Path headers from the
+            // message
+            // This only works because there is a placeholder inserted by
+            // MimeMessageWrapper
+            message.setHeader(RFC2822Headers.RETURN_PATH,
+                    (mail.getSender() == null ? "<>" : "<" + mail.getSender()
+                            + ">"));
+        }
+
+        Enumeration headers;
+        InternetHeaders deliveredTo = new InternetHeaders();
+        if (deliveryHeader != null) {
+            // Copy any Delivered-To headers from the message
+            headers = message
+                    .getMatchingHeaders(new String[] { deliveryHeader });
+            while (headers.hasMoreElements()) {
+                Header header = (Header) headers.nextElement();
+                deliveredTo.addHeader(header.getName(), header.getValue());
+            }
+        }
+
+        for (Iterator<MailAddress> i = recipients.iterator(); i.hasNext();) {
+            MailAddress recipient = i.next();
+            try {
+                if (deliveryHeader != null) {
+                    // Add qmail's de facto standard Delivered-To header
+                    message.addHeader(deliveryHeader, recipient.toString());
+                }
+
+                storeMail(mail.getSender(), recipient, mail);
+
+                if (deliveryHeader != null) {
+                    if (i.hasNext()) {
+                        // Remove headers but leave all placeholders
+                        message.removeHeader(deliveryHeader);
+                        headers = deliveredTo.getAllHeaders();
+                        // And restore any original Delivered-To headers
+                        while (headers.hasMoreElements()) {
+                            Header header = (Header) headers.nextElement();
+                            message.addHeader(header.getName(), header
+                                    .getValue());
+                        }
+                    }
+                }
+            } catch (Exception ex) {
+                log("Error while storing mail.", ex);
+                errors.add(recipient);
+            }
+        }
+
+        if (!errors.isEmpty()) {
+            // If there were errors, we redirect the email to the ERROR
+            // processor.
+            // In order for this server to meet the requirements of the SMTP
+            // specification, mails on the ERROR processor must be returned to
+            // the sender. Note that this email doesn't include any details
+            // regarding the details of the failure(s).
+            // In the future we may wish to address this.
+            getMailetContext().sendMail(mail.getSender(), errors,
+                    mail.getMessage(), Mail.ERROR);
+        }
+        if (consume) {
+            // Consume this message
+            mail.setState(Mail.GHOST);
+        }
+    }
+
+    /**
+     * Return a string describing this mailet.
+     * 
+     * @return a string describing this mailet
+     */
+    @Override
+    public String getMailetInfo() {
+        return "Sieve Mailbox Mailet";
+    }
+
+    /**
+     * 
+     * @param sender
+     * @param recipient
+     * @param mail
+     * @throws MessagingException
+     */
+    public void storeMail(MailAddress sender, MailAddress recipient,
+            Mail mail) throws MessagingException {
+        if (recipient == null) {
+            throw new IllegalArgumentException(
+                    "Recipient for mail to be spooled cannot be null.");
+        }
+        if (mail.getMessage() == null) {
+            throw new IllegalArgumentException(
+                    "Mail message to be spooled cannot be null.");
+        }
+        
+        sieveMessage(recipient, mail);
+ 
+    }
+    
+    protected void sieveMessage(MailAddress recipient, Mail aMail) throws MessagingException {
+        String username = getUsername(recipient);
+        try {
+            final ResourceLocator.UserSieveInformation userSieveInformation = locator.get(getScriptUri(recipient));
+            sieveMessageEvaluate(recipient, aMail, userSieveInformation);
+        } catch (Exception ex) {
+            // SIEVE is a mail filtering protocol.
+            // Rejecting the mail because it cannot be filtered
+            // seems very unfriendly.
+            // So just log and store in INBOX
+            if (isInfoLoggingOn()) {
+                log("Cannot evaluate Sieve script. Storing mail in user INBOX.", ex);
+            }
+            storeMessageInbox(username, aMail.getMessage());
+        }
+    }
+    
+    private void sieveMessageEvaluate(MailAddress recipient, Mail aMail, ResourceLocator.UserSieveInformation userSieveInformation) throws MessagingException, IOException {
+            try {
+                SieveMailAdapter aMailAdapter = new SieveMailAdapter(aMail,
+                    getMailetContext(), actionDispatcher, poster, userSieveInformation.getScriptActivationDate(),
+                    userSieveInformation.getScriptInterpretationDate(), recipient);
+                aMailAdapter.setLog(log);
+                // This logging operation is potentially costly
+                if (verbose) {
+                    log("Evaluating " + aMailAdapter.toString() + "against \""
+                            + getScriptUri(recipient) + "\"");
+                }
+                factory.evaluate(aMailAdapter, factory.parse(userSieveInformation.getScriptContent()));
+            } catch (SieveException ex) {
+                handleFailure(recipient, aMail, ex);
+            }
+            catch (ParseException ex) {
+                handleFailure(recipient, aMail, ex);
+            }
+            catch (TokenMgrError ex)
+            {
+                handleFailure(recipient, aMail, new SieveException(ex));
+            }
+    }
+    
+    protected void storeMessageInbox(String username, MimeMessage message) throws MessagingException {
+        String url = "mailbox://" + username + "/";
+        poster.post(url, message);
+    }
+
+    /**
+     * @see org.apache.mailet.base.GenericMailet#init()
+     */
+    @Override
+    public void init() throws MessagingException {
+        super.init();
+        if (poster == null || locator == null) {
+            throw new MailetException("Not initialised. Please ensure that the mailet container supports either" +
+                    " setter or constructor injection");
+        }
+        
+        this.deliveryHeader = getInitParameter("addDeliveryHeader");
+        this.resetReturnPath = getInitParameter("resetReturnPath", true);
+        this.consume = getInitParameter("consume", true);
+        this.verbose = getInitParameter("verbose", false);
+        this.quiet = getInitParameter("quiet", false);
+        
+        actionDispatcher = new ActionDispatcher();
+    }
+    
+    /**
+     * Return the username to use for sieve processing for the given MailAddress
+     * 
+     * @param m
+     * @return username
+     */
+    protected String getUsername(MailAddress m) {
+        return m.getLocalPart() + "@localhost";
+    }
+    
+    /**
+     * Return the URI for the sieve script
+     *
+     * @param m
+     * @return
+     */
+    protected String getScriptUri(MailAddress m) {
+        return "//" + getUsername(m) + "/sieve";
+    }
+    
+    /**
+     * Deliver the original mail as an attachment with the main part being an error report.
+     *
+     * @param recipient
+     * @param aMail
+     * @param ex
+     * @throws MessagingException
+     * @throws IOException 
+     */
+    protected void handleFailure(MailAddress recipient, Mail aMail, Exception ex)
+            throws MessagingException, IOException {
+        String user = getUsername(recipient);
+
+        MimeMessage originalMessage = aMail.getMessage();
+        MimeMessage message = new MimeMessage(originalMessage);
+        MimeMultipart multipart = new MimeMultipart();
+        
+        MimeBodyPart noticePart = new MimeBodyPart();
+        noticePart.setText("An error was encountered while processing this mail with the active sieve script for user \""
+                + user + "\". The error encountered was:\r\n" + ex.getLocalizedMessage() + "\r\n");
+        multipart.addBodyPart(noticePart);
+        
+        MimeBodyPart originalPart = new MimeBodyPart();
+        originalPart.setContent(originalMessage, "message/rfc822");
+        if ((originalMessage.getSubject() != null) && (!originalMessage.getSubject().trim().isEmpty())) {
+            originalPart.setFileName(originalMessage.getSubject().trim());
+        } else {
+            originalPart.setFileName("No Subject");
+        }
+        originalPart.setDisposition(MimeBodyPart.INLINE);
+        multipart.addBodyPart(originalPart);
+        
+        message.setContent(multipart);
+        message.setSubject("[SIEVE ERROR] " + originalMessage.getSubject());
+        message.setHeader("X-Priority", "1");
+        message.saveChanges();
+        
+        storeMessageInbox(user, message);
+    }
+   
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org