Repository: james-project
Updated Branches:
  refs/heads/master 77ee834cb -> 62466172d


JAMES-2003 Sanitize mailetContainer configuration


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

Branch: refs/heads/master
Commit: 67e89cc43efa403627ff92b24014b69004b4beda
Parents: d9008f8
Author: benwa <btell...@linagora.com>
Authored: Tue Apr 18 07:40:29 2017 +0700
Committer: benwa <btell...@linagora.com>
Committed: Wed Apr 19 09:39:40 2017 +0700

----------------------------------------------------------------------
 .../destination/conf/mailetcontainer.xml        |  76 +++----------
 .../destination/conf/managesieve.help.txt       | 112 -------------------
 .../destination/conf/mailetcontainer.xml        |  76 +++----------
 .../destination/conf/managesieve.help.txt       | 112 -------------------
 .../jpa/destination/conf/mailetcontainer.xml    |  94 ++++++----------
 .../spring/destination/conf/mailetcontainer.xml |  92 ++++++---------
 .../destination/conf/managesieve.help.txt       | 112 -------------------
 .../src/test/resources/mailetcontainer.xml      |  11 --
 .../sample-configuration/mailetcontainer.xml    |  26 -----
 .../src/test/resources/mailetcontainer.xml      |   3 -
 .../src/test/resources/mailetcontainer.xml      |   3 -
 11 files changed, 102 insertions(+), 615 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailetcontainer.xml
----------------------------------------------------------------------
diff --git 
a/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailetcontainer.xml 
b/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailetcontainer.xml
index f3e466a..681b966 100644
--- a/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailetcontainer.xml
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailetcontainer.xml
@@ -33,31 +33,6 @@
         <processor state="root" enableJmx="true">
             <mailet match="All" class="PostmasterAlias"/>
             <mailet match="RelayLimit=30" class="Null"/>
-            <!-- Hook on sievemana...@james.linagora.com
-                 Mail send to this address will get interpreted with SIEVE 
Manage -->
-            <mailet match="RecipientIs=sievemana...@james.linagora.com" 
class="ToProcessor">
-                <processor>sieve-manager-check</processor>
-            </mailet>
-            <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="All" class="SetMailAttribute">
-                <spamChecked>true</spamChecked>
-            </mailet>
-            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="InSpammerBlacklist=query.bondedsender.org." 
class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <!-- Check for delivery from a known spam server -->
-            <!-- This set of matchers/mailets redirect all emails from known 
-->
-            <!-- black holes, open relays, and spam servers to the spam 
processor -->
-            <!-- For this set to function properly, the spam processor must be 
configured. -->
-            <mailet match="InSpammerBlacklist=dnsbl.njabl.org." 
class="ToProcessor">
-                <processor>spam</processor>
-                <notice>550 Requested action not taken: rejected - see 
http://njabl.org/</notice>
-            </mailet>
             <mailet match="All" class="ToProcessor">
                 <processor>transport</processor>
             </mailet>
@@ -73,7 +48,6 @@
             </mailet>
         </processor>
 
-
         <processor state="transport" enableJmx="true">
             <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
                 <name>X-UserIsAuth</name>
@@ -91,13 +65,25 @@
             <mailet match="RecipientIsLocal" class="Sieve"/>
             <mailet match="RecipientIsLocal" class="AddDeliveredToHeader"/>
             <mailet match="RecipientIsLocal" class="LocalDelivery"/>
-            <!--
             <mailet match="HostIsLocal" class="ToProcessor">
                 <processor>local-address-error</processor>
                 <notice>550 - Requested action not taken: no such user 
here</notice>
             </mailet>
-            -->
-            <mailet match="SMTPAuthSuccessful" class="RemoteDelivery">
+
+            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
+                <processor>relay</processor>
+            </mailet>
+            <mailet 
match="HasMailAttribute=org.apache.james.jmap.send.MailMetaData.messageId" 
class="ToProcessor">
+                <processor>relay</processor>
+            </mailet>
+
+            <mailet match="All" class="ToProcessor">
+                <processor>relay-denied</processor>
+            </mailet>
+        </processor>
+
+        <processor state="relay" enableJmx="true">
+            <mailet match="All" class="RemoteDelivery">
                 <outgoingQueue>outgoing</outgoingQueue>
                 <delayTime>5000, 100000, 500000</delayTime>
                 <maxRetries>25</maxRetries>
@@ -106,9 +92,6 @@
                 <sendpartial>true</sendpartial>
                 <bounceProcessor>bounces</bounceProcessor>
             </mailet>
-            <mailet match="All" class="ToProcessor">
-                <processor>relay-denied</processor>
-            </mailet>
         </processor>
 
         <processor state="spam" enableJmx="true">
@@ -141,7 +124,7 @@
             </mailet>
             <mailet match="All" class="ToRepository">
                 <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
-                <notice>Warning: You are sending an e-mail to a remote server. 
You must be authentified to perform such an operation</notice>
+                <notice>Warning: You are sending an e-mail to a remote server. 
You must be authenticated to perform such an operation</notice>
             </mailet>
         </processor>
 
@@ -154,33 +137,6 @@
             </mailet>
         </processor>
 
-        <processor state="sieve-manager-check" enableJmx="true">
-            <!-- Only local users can manage their scripts -->
-            <mailet match="RecipientIsLocal" class="ToProcessor">
-                <processor>sieve-manager</processor>
-            </mailet>
-            <!-- Notify other people about their failure -->
-            <mailet match="All" class="Bounce">
-                <inline>heads</inline>
-                <attachment>none</attachment>
-                <passThrough>false</passThrough>
-                <prefix>[REJECTED]</prefix>
-                <notice>
-                    You can't send messages to configure SIEVE on this serveur 
unless you are the official SIEVE manager.
-                </notice>
-            </mailet>
-            <mailet match="All" class="Null"/>
-        </processor>
-
-        <processor state="sieve-manager">
-            <mailet match="All" class="SetMailAttribute">
-                
<org.apache.james.SMTPAuthUser>true</org.apache.james.SMTPAuthUser>
-            </mailet>
-            <mailet match="All" 
class="org.apache.james.transport.mailets.managesieve.ManageSieveMailet">
-                
<helpURL>file:/root/james-server-app-3.0.0-beta5-SNAPSHOT/conf/managesieve.help.txt</helpURL>
-            </mailet>
-            <mailet match="All" class="Null"/>
-        </processor>
     </processors>
 
 </mailetcontainer>

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/dockerfiles/run/guice/cassandra-ldap/destination/conf/managesieve.help.txt
----------------------------------------------------------------------
diff --git 
a/dockerfiles/run/guice/cassandra-ldap/destination/conf/managesieve.help.txt 
b/dockerfiles/run/guice/cassandra-ldap/destination/conf/managesieve.help.txt
deleted file mode 100644
index f45c78d..0000000
--- a/dockerfiles/run/guice/cassandra-ldap/destination/conf/managesieve.help.txt
+++ /dev/null
@@ -1,112 +0,0 @@
-managesieve implements the commands defined by RFC 5804 
((http://tools.ietf.org/html/rfc5804) to manage sieve scripts via mail 
messages. A mail is sent to the managesieve user with the command and 
parameters in the subject header. Sieve scripts are exchanged as mail 
attachments.
-
-Consult your mail administrator for the name of the managesieve user 
configured for your installation.
-
-Users MUST be SMTP authenticated to execute all except the CAPABILITY and HELP 
commands (see note (1) below).
-
-Commands are executed and answered within the namespace of the sending user as 
denoted by the sender header of the mail. Thus, a command such as LISTSCRIPTS 
lists the scripts within namespace of the user identified by the sender header.
-
-The supported commands are summarised in "Command Summary" below. Generally 
the responses are self describing. For full details see RFC 5804 - Commands 
(http://tools.ietf.org/html/rfc5804#section-2).
-
-In these descriptions the following keywords apply:
-
-- sieve-name
-    The name of a sieve script enclosed in parentheses, eg: "my script". An 
empty name is not allowed.
-- active-sieve-name
-    As sieve-name, except an empty name, eg: "", is allowed.
-- old-sieve-name
-    As sieve-name
-- new-sieve-name
-    As sieve-name    
-- sieve-script
-    A mail attachment recognised as a sieve script. This is the first 
attachment in a mail satisfying any of these characteristics:
-        - A MIME type of "application/sieve"
-        - A filename with the suffix ".sieve"
-        - A filename with the suffix ".siv"
-    Returned sieve-scripts always have the MIME type of "application/sieve"
-
-Command Summary
----------------
-
-CAPABILITY
-    Subject:
-        CAPABILITY
-    Attachments: 
-        none
-Answers the capabilities of the underlying sieve inplementation.
-
-CHECKSCRIPT
-    Subject:
-        CHECKSCRIPT
-    Attachments: 
-        sieve-script
-Verifies the attached sieve-script without storing it on the server.
-
-DELETESCRIPT
-    Subject: 
-        DELETESCRIPT sieve-name
-    Attachments: 
-        none
-Deletes the named sieve script.
-
-GETACTIVE
-    Subject: 
-        GETACTIVE
-    Attachments: 
-        none
-Answers the active sieve script as an attachment.
-
-GETSCRIPT
-    Subject: 
-        GETSCRIPT sieve-name
-    Attachments: 
-        none
-Answers the named sieve script as an attachment.
-
-HAVESPACE
-    Subject: 
-        HAVESPACE sieve-name number
-    Attachments: 
-        none
-Answers OK if there is available space to store a script with the given name 
of the given size, else NO.
-
-HELP
-    Subject: 
-        HELP
-    Attachments: 
-        none
-Answers this text.
-
-LISTSCRIPTS
-    Subject: 
-        LISTSCRIPTS
-    Attachments: 
-        none
-Answers a list of the sieve scripts stored on the server, indicating which, if 
any, is the active script.
-
-PUTSCRIPT
-    Subject: 
-        PUTSCRIPT sieve-name
-    Attachments: 
-        sieve-script
-Verifies the attached sieve-script and if there are no errors stores it on the 
server using the given name.
-
-RENAMESCRIPT
-    Subject: 
-        RENAMESCRIPT old-sieve-name new-sieve-name
-    Attachments: 
-        none
-Renames the script stored on the server named old-sieve-name to new-sieve-name.
-
-SETACTIVE
-    Subject: 
-        SETACTIVE active-sieve-name
-    Attachments: 
-        none
-Sets the active script on the server to the given name. Use an empty string, 
"", to deactivate all scripts.
-
-Notes
------
-1) Some mail servers optionally allow configurations that enable local clients 
to post without SMTP authentication, such configurations will fail as 
managesieve requires SMTP authentication in all circumstances. To repeat, users 
MUST be SMTP authenticated to execute all except the CAPABILITY and HELP 
commands.
-
-

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/dockerfiles/run/guice/cassandra/destination/conf/mailetcontainer.xml
----------------------------------------------------------------------
diff --git 
a/dockerfiles/run/guice/cassandra/destination/conf/mailetcontainer.xml 
b/dockerfiles/run/guice/cassandra/destination/conf/mailetcontainer.xml
index f3e466a..681b966 100644
--- a/dockerfiles/run/guice/cassandra/destination/conf/mailetcontainer.xml
+++ b/dockerfiles/run/guice/cassandra/destination/conf/mailetcontainer.xml
@@ -33,31 +33,6 @@
         <processor state="root" enableJmx="true">
             <mailet match="All" class="PostmasterAlias"/>
             <mailet match="RelayLimit=30" class="Null"/>
-            <!-- Hook on sievemana...@james.linagora.com
-                 Mail send to this address will get interpreted with SIEVE 
Manage -->
-            <mailet match="RecipientIs=sievemana...@james.linagora.com" 
class="ToProcessor">
-                <processor>sieve-manager-check</processor>
-            </mailet>
-            <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="All" class="SetMailAttribute">
-                <spamChecked>true</spamChecked>
-            </mailet>
-            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="InSpammerBlacklist=query.bondedsender.org." 
class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <!-- Check for delivery from a known spam server -->
-            <!-- This set of matchers/mailets redirect all emails from known 
-->
-            <!-- black holes, open relays, and spam servers to the spam 
processor -->
-            <!-- For this set to function properly, the spam processor must be 
configured. -->
-            <mailet match="InSpammerBlacklist=dnsbl.njabl.org." 
class="ToProcessor">
-                <processor>spam</processor>
-                <notice>550 Requested action not taken: rejected - see 
http://njabl.org/</notice>
-            </mailet>
             <mailet match="All" class="ToProcessor">
                 <processor>transport</processor>
             </mailet>
@@ -73,7 +48,6 @@
             </mailet>
         </processor>
 
-
         <processor state="transport" enableJmx="true">
             <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
                 <name>X-UserIsAuth</name>
@@ -91,13 +65,25 @@
             <mailet match="RecipientIsLocal" class="Sieve"/>
             <mailet match="RecipientIsLocal" class="AddDeliveredToHeader"/>
             <mailet match="RecipientIsLocal" class="LocalDelivery"/>
-            <!--
             <mailet match="HostIsLocal" class="ToProcessor">
                 <processor>local-address-error</processor>
                 <notice>550 - Requested action not taken: no such user 
here</notice>
             </mailet>
-            -->
-            <mailet match="SMTPAuthSuccessful" class="RemoteDelivery">
+
+            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
+                <processor>relay</processor>
+            </mailet>
+            <mailet 
match="HasMailAttribute=org.apache.james.jmap.send.MailMetaData.messageId" 
class="ToProcessor">
+                <processor>relay</processor>
+            </mailet>
+
+            <mailet match="All" class="ToProcessor">
+                <processor>relay-denied</processor>
+            </mailet>
+        </processor>
+
+        <processor state="relay" enableJmx="true">
+            <mailet match="All" class="RemoteDelivery">
                 <outgoingQueue>outgoing</outgoingQueue>
                 <delayTime>5000, 100000, 500000</delayTime>
                 <maxRetries>25</maxRetries>
@@ -106,9 +92,6 @@
                 <sendpartial>true</sendpartial>
                 <bounceProcessor>bounces</bounceProcessor>
             </mailet>
-            <mailet match="All" class="ToProcessor">
-                <processor>relay-denied</processor>
-            </mailet>
         </processor>
 
         <processor state="spam" enableJmx="true">
@@ -141,7 +124,7 @@
             </mailet>
             <mailet match="All" class="ToRepository">
                 <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
-                <notice>Warning: You are sending an e-mail to a remote server. 
You must be authentified to perform such an operation</notice>
+                <notice>Warning: You are sending an e-mail to a remote server. 
You must be authenticated to perform such an operation</notice>
             </mailet>
         </processor>
 
@@ -154,33 +137,6 @@
             </mailet>
         </processor>
 
-        <processor state="sieve-manager-check" enableJmx="true">
-            <!-- Only local users can manage their scripts -->
-            <mailet match="RecipientIsLocal" class="ToProcessor">
-                <processor>sieve-manager</processor>
-            </mailet>
-            <!-- Notify other people about their failure -->
-            <mailet match="All" class="Bounce">
-                <inline>heads</inline>
-                <attachment>none</attachment>
-                <passThrough>false</passThrough>
-                <prefix>[REJECTED]</prefix>
-                <notice>
-                    You can't send messages to configure SIEVE on this serveur 
unless you are the official SIEVE manager.
-                </notice>
-            </mailet>
-            <mailet match="All" class="Null"/>
-        </processor>
-
-        <processor state="sieve-manager">
-            <mailet match="All" class="SetMailAttribute">
-                
<org.apache.james.SMTPAuthUser>true</org.apache.james.SMTPAuthUser>
-            </mailet>
-            <mailet match="All" 
class="org.apache.james.transport.mailets.managesieve.ManageSieveMailet">
-                
<helpURL>file:/root/james-server-app-3.0.0-beta5-SNAPSHOT/conf/managesieve.help.txt</helpURL>
-            </mailet>
-            <mailet match="All" class="Null"/>
-        </processor>
     </processors>
 
 </mailetcontainer>

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/dockerfiles/run/guice/cassandra/destination/conf/managesieve.help.txt
----------------------------------------------------------------------
diff --git 
a/dockerfiles/run/guice/cassandra/destination/conf/managesieve.help.txt 
b/dockerfiles/run/guice/cassandra/destination/conf/managesieve.help.txt
deleted file mode 100644
index f45c78d..0000000
--- a/dockerfiles/run/guice/cassandra/destination/conf/managesieve.help.txt
+++ /dev/null
@@ -1,112 +0,0 @@
-managesieve implements the commands defined by RFC 5804 
((http://tools.ietf.org/html/rfc5804) to manage sieve scripts via mail 
messages. A mail is sent to the managesieve user with the command and 
parameters in the subject header. Sieve scripts are exchanged as mail 
attachments.
-
-Consult your mail administrator for the name of the managesieve user 
configured for your installation.
-
-Users MUST be SMTP authenticated to execute all except the CAPABILITY and HELP 
commands (see note (1) below).
-
-Commands are executed and answered within the namespace of the sending user as 
denoted by the sender header of the mail. Thus, a command such as LISTSCRIPTS 
lists the scripts within namespace of the user identified by the sender header.
-
-The supported commands are summarised in "Command Summary" below. Generally 
the responses are self describing. For full details see RFC 5804 - Commands 
(http://tools.ietf.org/html/rfc5804#section-2).
-
-In these descriptions the following keywords apply:
-
-- sieve-name
-    The name of a sieve script enclosed in parentheses, eg: "my script". An 
empty name is not allowed.
-- active-sieve-name
-    As sieve-name, except an empty name, eg: "", is allowed.
-- old-sieve-name
-    As sieve-name
-- new-sieve-name
-    As sieve-name    
-- sieve-script
-    A mail attachment recognised as a sieve script. This is the first 
attachment in a mail satisfying any of these characteristics:
-        - A MIME type of "application/sieve"
-        - A filename with the suffix ".sieve"
-        - A filename with the suffix ".siv"
-    Returned sieve-scripts always have the MIME type of "application/sieve"
-
-Command Summary
----------------
-
-CAPABILITY
-    Subject:
-        CAPABILITY
-    Attachments: 
-        none
-Answers the capabilities of the underlying sieve inplementation.
-
-CHECKSCRIPT
-    Subject:
-        CHECKSCRIPT
-    Attachments: 
-        sieve-script
-Verifies the attached sieve-script without storing it on the server.
-
-DELETESCRIPT
-    Subject: 
-        DELETESCRIPT sieve-name
-    Attachments: 
-        none
-Deletes the named sieve script.
-
-GETACTIVE
-    Subject: 
-        GETACTIVE
-    Attachments: 
-        none
-Answers the active sieve script as an attachment.
-
-GETSCRIPT
-    Subject: 
-        GETSCRIPT sieve-name
-    Attachments: 
-        none
-Answers the named sieve script as an attachment.
-
-HAVESPACE
-    Subject: 
-        HAVESPACE sieve-name number
-    Attachments: 
-        none
-Answers OK if there is available space to store a script with the given name 
of the given size, else NO.
-
-HELP
-    Subject: 
-        HELP
-    Attachments: 
-        none
-Answers this text.
-
-LISTSCRIPTS
-    Subject: 
-        LISTSCRIPTS
-    Attachments: 
-        none
-Answers a list of the sieve scripts stored on the server, indicating which, if 
any, is the active script.
-
-PUTSCRIPT
-    Subject: 
-        PUTSCRIPT sieve-name
-    Attachments: 
-        sieve-script
-Verifies the attached sieve-script and if there are no errors stores it on the 
server using the given name.
-
-RENAMESCRIPT
-    Subject: 
-        RENAMESCRIPT old-sieve-name new-sieve-name
-    Attachments: 
-        none
-Renames the script stored on the server named old-sieve-name to new-sieve-name.
-
-SETACTIVE
-    Subject: 
-        SETACTIVE active-sieve-name
-    Attachments: 
-        none
-Sets the active script on the server to the given name. Use an empty string, 
"", to deactivate all scripts.
-
-Notes
------
-1) Some mail servers optionally allow configurations that enable local clients 
to post without SMTP authentication, such configurations will fail as 
managesieve requires SMTP authentication in all circumstances. To repeat, users 
MUST be SMTP authenticated to execute all except the CAPABILITY and HELP 
commands.
-
-

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/dockerfiles/run/guice/jpa/destination/conf/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/dockerfiles/run/guice/jpa/destination/conf/mailetcontainer.xml 
b/dockerfiles/run/guice/jpa/destination/conf/mailetcontainer.xml
index 35fca6a..29248b8 100644
--- a/dockerfiles/run/guice/jpa/destination/conf/mailetcontainer.xml
+++ b/dockerfiles/run/guice/jpa/destination/conf/mailetcontainer.xml
@@ -33,44 +33,21 @@
         <processor state="root" enableJmx="true">
             <mailet match="All" class="PostmasterAlias"/>
             <mailet match="RelayLimit=30" class="Null"/>
-            <!-- Hook on sievemana...@james.linagora.com
-                 Mail send to this address will get interpreted with SIEVE 
Manage -->
-            <mailet match="RecipientIs=sievemana...@james.linagora.com" 
class="ToProcessor">
-                <processor>sieve-manager-check</processor>
-            </mailet>
-            <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="All" class="SetMailAttribute">
-                <spamChecked>true</spamChecked>
-            </mailet>
-            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="InSpammerBlacklist=query.bondedsender.org." 
class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <!-- Check for delivery from a known spam server -->
-            <!-- This set of matchers/mailets redirect all emails from known 
-->
-            <!-- black holes, open relays, and spam servers to the spam 
processor -->
-            <!-- For this set to function properly, the spam processor must be 
configured. -->
-            <mailet match="InSpammerBlacklist=dnsbl.njabl.org." 
class="ToProcessor">
-                <processor>spam</processor>
-                <notice>550 Requested action not taken: rejected - see 
http://njabl.org/</notice>
-            </mailet>
             <mailet match="All" class="ToProcessor">
                 <processor>transport</processor>
             </mailet>
         </processor>
 
         <processor state="error" enableJmx="true">
+            <mailet match="All" class="MetricsMailet">
+                <metricName>mailetContainerErrors</metricName>
+            </mailet>
             <mailet match="All" class="Bounce"/>
             <mailet match="All" class="ToRepository">
                 <repositoryPath>file://var/mail/error/</repositoryPath>
             </mailet>
         </processor>
 
-
         <processor state="transport" enableJmx="true">
             <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
                 <name>X-UserIsAuth</name>
@@ -84,9 +61,28 @@
                 <name>bcc</name>
             </mailet>
             <mailet match="All" class="RecipientRewriteTable" />
+            <mailet match="RecipientIsLocal" class="Sieve"/>
             <mailet match="RecipientIsLocal" class="AddDeliveredToHeader"/>
             <mailet match="RecipientIsLocal" class="LocalDelivery"/>
-            <mailet match="SMTPAuthSuccessful" class="RemoteDelivery">
+            <mailet match="HostIsLocal" class="ToProcessor">
+                <processor>local-address-error</processor>
+                <notice>550 - Requested action not taken: no such user 
here</notice>
+            </mailet>
+
+            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
+                <processor>relay</processor>
+            </mailet>
+            <mailet 
match="HasMailAttribute=org.apache.james.jmap.send.MailMetaData.messageId" 
class="ToProcessor">
+                <processor>relay</processor>
+            </mailet>
+
+            <mailet match="All" class="ToProcessor">
+                <processor>relay-denied</processor>
+            </mailet>
+        </processor>
+
+        <processor state="relay" enableJmx="true">
+            <mailet match="All" class="RemoteDelivery">
                 <outgoingQueue>outgoing</outgoingQueue>
                 <delayTime>5000, 100000, 500000</delayTime>
                 <maxRetries>25</maxRetries>
@@ -95,18 +91,21 @@
                 <sendpartial>true</sendpartial>
                 <bounceProcessor>bounces</bounceProcessor>
             </mailet>
-            <mailet match="All" class="ToProcessor">
-                <processor>relay-denied</processor>
-            </mailet>
         </processor>
 
         <processor state="spam" enableJmx="true">
+            <mailet match="All" class="MetricsMailet">
+                <metricName>mailetContainerSpam</metricName>
+            </mailet>
             <mailet match="All" class="ToRepository">
                 <repositoryPath>file://var/mail/spam/</repositoryPath>
             </mailet>
         </processor>
 
         <processor state="local-address-error" enableJmx="true">
+            <mailet match="All" class="MetricsMailet">
+                <metricName>mailetContainerLocalAddressError</metricName>
+            </mailet>
             <mailet match="All" class="Bounce">
                 <attachment>none</attachment>
             </mailet>
@@ -116,48 +115,27 @@
         </processor>
 
         <processor state="relay-denied" enableJmx="true">
+            <mailet match="All" class="MetricsMailet">
+                <metricName>mailetContainerRelayDenied</metricName>
+            </mailet>
             <mailet match="All" class="Bounce">
                 <attachment>none</attachment>
             </mailet>
             <mailet match="All" class="ToRepository">
                 <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
-                <notice>Warning: You are sending an e-mail to a remote server. 
You must be authentified to perform such an operation</notice>
+                <notice>Warning: You are sending an e-mail to a remote server. 
You must be authenticated to perform such an operation</notice>
             </mailet>
         </processor>
 
         <processor state="bounces" enableJmx="true">
-            <mailet match="All" class="DSNBounce">
-                <passThrough>false</passThrough>
+            <mailet match="All" class="MetricsMailet">
+                <metricName>bounces</metricName>
             </mailet>
-        </processor>
-
-        <processor state="sieve-manager-check" enableJmx="true">
-            <!-- Only local users can manage their scripts -->
-            <mailet match="RecipientIsLocal" class="ToProcessor">
-                <processor>sieve-manager</processor>
-            </mailet>
-            <!-- Notify other people about their failure -->
-            <mailet match="All" class="Bounce">
-                <inline>heads</inline>
-                <attachment>none</attachment>
+            <mailet match="All" class="DSNBounce">
                 <passThrough>false</passThrough>
-                <prefix>[REJECTED]</prefix>
-                <notice>
-                    You can't send messages to configure SIEVE on this serveur 
unless you are the official SIEVE manager.
-                </notice>
             </mailet>
-            <mailet match="All" class="Null"/>
         </processor>
 
-        <processor state="sieve-manager">
-            <mailet match="All" class="SetMailAttribute">
-                
<org.apache.james.SMTPAuthUser>true</org.apache.james.SMTPAuthUser>
-            </mailet>
-            <mailet match="All" 
class="org.apache.james.transport.mailets.managesieve.ManageSieveMailet">
-                
<helpURL>file:/root/james-server-app-3.0.0-beta5-SNAPSHOT/conf/managesieve.help.txt</helpURL>
-            </mailet>
-            <mailet match="All" class="Null"/>
-        </processor>
     </processors>
 
 </mailetcontainer>

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/dockerfiles/run/spring/destination/conf/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/dockerfiles/run/spring/destination/conf/mailetcontainer.xml 
b/dockerfiles/run/spring/destination/conf/mailetcontainer.xml
index 498e1ac..29248b8 100644
--- a/dockerfiles/run/spring/destination/conf/mailetcontainer.xml
+++ b/dockerfiles/run/spring/destination/conf/mailetcontainer.xml
@@ -33,44 +33,21 @@
         <processor state="root" enableJmx="true">
             <mailet match="All" class="PostmasterAlias"/>
             <mailet match="RelayLimit=30" class="Null"/>
-            <!-- Hook on sievemana...@james.linagora.com
-                 Mail send to this address will get interpreted with SIEVE 
Manage -->
-            <mailet match="RecipientIs=sievemana...@james.linagora.com" 
class="ToProcessor">
-                <processor>sieve-manager-check</processor>
-            </mailet>
-            <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="All" class="SetMailAttribute">
-                <spamChecked>true</spamChecked>
-            </mailet>
-            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="InSpammerBlacklist=query.bondedsender.org." 
class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <!-- Check for delivery from a known spam server -->
-            <!-- This set of matchers/mailets redirect all emails from known 
-->
-            <!-- black holes, open relays, and spam servers to the spam 
processor -->
-            <!-- For this set to function properly, the spam processor must be 
configured. -->
-            <mailet match="InSpammerBlacklist=dnsbl.njabl.org." 
class="ToProcessor">
-                <processor>spam</processor>
-                <notice>550 Requested action not taken: rejected - see 
http://njabl.org/</notice>
-            </mailet>
             <mailet match="All" class="ToProcessor">
                 <processor>transport</processor>
             </mailet>
         </processor>
 
         <processor state="error" enableJmx="true">
+            <mailet match="All" class="MetricsMailet">
+                <metricName>mailetContainerErrors</metricName>
+            </mailet>
             <mailet match="All" class="Bounce"/>
             <mailet match="All" class="ToRepository">
                 <repositoryPath>file://var/mail/error/</repositoryPath>
             </mailet>
         </processor>
 
-
         <processor state="transport" enableJmx="true">
             <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
                 <name>X-UserIsAuth</name>
@@ -80,6 +57,9 @@
                 <name>X-WasSigned</name>
                 <value>true</value>
             </mailet>
+            <mailet match="All" class="RemoveMimeHeader">
+                <name>bcc</name>
+            </mailet>
             <mailet match="All" class="RecipientRewriteTable" />
             <mailet match="RecipientIsLocal" class="Sieve"/>
             <mailet match="RecipientIsLocal" class="AddDeliveredToHeader"/>
@@ -88,7 +68,21 @@
                 <processor>local-address-error</processor>
                 <notice>550 - Requested action not taken: no such user 
here</notice>
             </mailet>
-            <mailet match="SMTPAuthSuccessful" class="RemoteDelivery">
+
+            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
+                <processor>relay</processor>
+            </mailet>
+            <mailet 
match="HasMailAttribute=org.apache.james.jmap.send.MailMetaData.messageId" 
class="ToProcessor">
+                <processor>relay</processor>
+            </mailet>
+
+            <mailet match="All" class="ToProcessor">
+                <processor>relay-denied</processor>
+            </mailet>
+        </processor>
+
+        <processor state="relay" enableJmx="true">
+            <mailet match="All" class="RemoteDelivery">
                 <outgoingQueue>outgoing</outgoingQueue>
                 <delayTime>5000, 100000, 500000</delayTime>
                 <maxRetries>25</maxRetries>
@@ -97,18 +91,21 @@
                 <sendpartial>true</sendpartial>
                 <bounceProcessor>bounces</bounceProcessor>
             </mailet>
-            <mailet match="All" class="ToProcessor">
-                <processor>relay-denied</processor>
-            </mailet>
         </processor>
 
         <processor state="spam" enableJmx="true">
+            <mailet match="All" class="MetricsMailet">
+                <metricName>mailetContainerSpam</metricName>
+            </mailet>
             <mailet match="All" class="ToRepository">
                 <repositoryPath>file://var/mail/spam/</repositoryPath>
             </mailet>
         </processor>
 
         <processor state="local-address-error" enableJmx="true">
+            <mailet match="All" class="MetricsMailet">
+                <metricName>mailetContainerLocalAddressError</metricName>
+            </mailet>
             <mailet match="All" class="Bounce">
                 <attachment>none</attachment>
             </mailet>
@@ -118,48 +115,27 @@
         </processor>
 
         <processor state="relay-denied" enableJmx="true">
+            <mailet match="All" class="MetricsMailet">
+                <metricName>mailetContainerRelayDenied</metricName>
+            </mailet>
             <mailet match="All" class="Bounce">
                 <attachment>none</attachment>
             </mailet>
             <mailet match="All" class="ToRepository">
                 <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
-                <notice>Warning: You are sending an e-mail to a remote server. 
You must be authentified to perform such an operation</notice>
+                <notice>Warning: You are sending an e-mail to a remote server. 
You must be authenticated to perform such an operation</notice>
             </mailet>
         </processor>
 
         <processor state="bounces" enableJmx="true">
-            <mailet match="All" class="DSNBounce">
-                <passThrough>false</passThrough>
+            <mailet match="All" class="MetricsMailet">
+                <metricName>bounces</metricName>
             </mailet>
-        </processor>
-
-        <processor state="sieve-manager-check" enableJmx="true">
-            <!-- Only local users can manage their scripts -->
-            <mailet match="RecipientIsLocal" class="ToProcessor">
-                <processor>sieve-manager</processor>
-            </mailet>
-            <!-- Notify other people about their failure -->
-            <mailet match="All" class="Bounce">
-                <inline>heads</inline>
-                <attachment>none</attachment>
+            <mailet match="All" class="DSNBounce">
                 <passThrough>false</passThrough>
-                <prefix>[REJECTED]</prefix>
-                <notice>
-                    You can't send messages to configure SIEVE on this serveur 
unless you are the official SIEVE manager.
-                </notice>
             </mailet>
-            <mailet match="All" class="Null"/>
         </processor>
 
-        <processor state="sieve-manager">
-            <mailet match="All" class="SetMailAttribute">
-                
<org.apache.james.SMTPAuthUser>true</org.apache.james.SMTPAuthUser>
-            </mailet>
-            <mailet match="All" 
class="org.apache.james.transport.mailets.managesieve.ManageSieveMailet">
-                
<helpURL>file:/root/james-server-app-3.0.0-beta5-SNAPSHOT/conf/managesieve.help.txt</helpURL>
-            </mailet>
-            <mailet match="All" class="Null"/>
-        </processor>
     </processors>
 
 </mailetcontainer>

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/dockerfiles/run/spring/destination/conf/managesieve.help.txt
----------------------------------------------------------------------
diff --git a/dockerfiles/run/spring/destination/conf/managesieve.help.txt 
b/dockerfiles/run/spring/destination/conf/managesieve.help.txt
deleted file mode 100644
index f45c78d..0000000
--- a/dockerfiles/run/spring/destination/conf/managesieve.help.txt
+++ /dev/null
@@ -1,112 +0,0 @@
-managesieve implements the commands defined by RFC 5804 
((http://tools.ietf.org/html/rfc5804) to manage sieve scripts via mail 
messages. A mail is sent to the managesieve user with the command and 
parameters in the subject header. Sieve scripts are exchanged as mail 
attachments.
-
-Consult your mail administrator for the name of the managesieve user 
configured for your installation.
-
-Users MUST be SMTP authenticated to execute all except the CAPABILITY and HELP 
commands (see note (1) below).
-
-Commands are executed and answered within the namespace of the sending user as 
denoted by the sender header of the mail. Thus, a command such as LISTSCRIPTS 
lists the scripts within namespace of the user identified by the sender header.
-
-The supported commands are summarised in "Command Summary" below. Generally 
the responses are self describing. For full details see RFC 5804 - Commands 
(http://tools.ietf.org/html/rfc5804#section-2).
-
-In these descriptions the following keywords apply:
-
-- sieve-name
-    The name of a sieve script enclosed in parentheses, eg: "my script". An 
empty name is not allowed.
-- active-sieve-name
-    As sieve-name, except an empty name, eg: "", is allowed.
-- old-sieve-name
-    As sieve-name
-- new-sieve-name
-    As sieve-name    
-- sieve-script
-    A mail attachment recognised as a sieve script. This is the first 
attachment in a mail satisfying any of these characteristics:
-        - A MIME type of "application/sieve"
-        - A filename with the suffix ".sieve"
-        - A filename with the suffix ".siv"
-    Returned sieve-scripts always have the MIME type of "application/sieve"
-
-Command Summary
----------------
-
-CAPABILITY
-    Subject:
-        CAPABILITY
-    Attachments: 
-        none
-Answers the capabilities of the underlying sieve inplementation.
-
-CHECKSCRIPT
-    Subject:
-        CHECKSCRIPT
-    Attachments: 
-        sieve-script
-Verifies the attached sieve-script without storing it on the server.
-
-DELETESCRIPT
-    Subject: 
-        DELETESCRIPT sieve-name
-    Attachments: 
-        none
-Deletes the named sieve script.
-
-GETACTIVE
-    Subject: 
-        GETACTIVE
-    Attachments: 
-        none
-Answers the active sieve script as an attachment.
-
-GETSCRIPT
-    Subject: 
-        GETSCRIPT sieve-name
-    Attachments: 
-        none
-Answers the named sieve script as an attachment.
-
-HAVESPACE
-    Subject: 
-        HAVESPACE sieve-name number
-    Attachments: 
-        none
-Answers OK if there is available space to store a script with the given name 
of the given size, else NO.
-
-HELP
-    Subject: 
-        HELP
-    Attachments: 
-        none
-Answers this text.
-
-LISTSCRIPTS
-    Subject: 
-        LISTSCRIPTS
-    Attachments: 
-        none
-Answers a list of the sieve scripts stored on the server, indicating which, if 
any, is the active script.
-
-PUTSCRIPT
-    Subject: 
-        PUTSCRIPT sieve-name
-    Attachments: 
-        sieve-script
-Verifies the attached sieve-script and if there are no errors stores it on the 
server using the given name.
-
-RENAMESCRIPT
-    Subject: 
-        RENAMESCRIPT old-sieve-name new-sieve-name
-    Attachments: 
-        none
-Renames the script stored on the server named old-sieve-name to new-sieve-name.
-
-SETACTIVE
-    Subject: 
-        SETACTIVE active-sieve-name
-    Attachments: 
-        none
-Sets the active script on the server to the given name. Use an empty string, 
"", to deactivate all scripts.
-
-Notes
------
-1) Some mail servers optionally allow configurations that enable local clients 
to post without SMTP authentication, such configurations will fail as 
managesieve requires SMTP authentication in all circumstances. To repeat, users 
MUST be SMTP authenticated to execute all except the CAPABILITY and HELP 
commands.
-
-

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/mpt/impl/smtp/cassandra/src/test/resources/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/cassandra/src/test/resources/mailetcontainer.xml 
b/mpt/impl/smtp/cassandra/src/test/resources/mailetcontainer.xml
index 699ca91..a1bfb08 100644
--- a/mpt/impl/smtp/cassandra/src/test/resources/mailetcontainer.xml
+++ b/mpt/impl/smtp/cassandra/src/test/resources/mailetcontainer.xml
@@ -34,10 +34,6 @@
             <mailet match="All" class="PostmasterAlias"/>
             <mailet match="RelayLimit=30" class="Null"/>
 
-            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-
             <mailet match="All" class="ToProcessor">
                 <processor>transport</processor>
             </mailet>
@@ -69,10 +65,6 @@
             </mailet>
             <mailet match="RecipientIsLocal" 
class="org.apache.james.jmap.mailet.VacationMailet"/>
             <mailet match="All" class="RecipientRewriteTable" />
-            <!-- <mailet match="HostIsLocal" class="ToProcessor">
-                <processor>local-address-error</processor>
-                <notice>550 - Requested action not taken: no such user 
here</notice>
-            </mailet> -->
             <mailet match="All" class="RemoteDelivery">
                 <outgoingQueue>outgoing</outgoingQueue>
                 <delayTime>5 minutes</delayTime>
@@ -87,9 +79,6 @@
                 <sendpartial>false</sendpartial>
                 <bounceProcessor>bounces</bounceProcessor>
             </mailet>
-            <!-- mailet match="All" class="ToProcessor">
-                <processor>relay-denied</processor>
-            </mailet-->
         </processor>
 
         <processor state="local-address-error" enableJmx="true">

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/server/container/guice/memory-guice/sample-configuration/mailetcontainer.xml
----------------------------------------------------------------------
diff --git 
a/server/container/guice/memory-guice/sample-configuration/mailetcontainer.xml 
b/server/container/guice/memory-guice/sample-configuration/mailetcontainer.xml
index 40885cd..1a4343f 100644
--- 
a/server/container/guice/memory-guice/sample-configuration/mailetcontainer.xml
+++ 
b/server/container/guice/memory-guice/sample-configuration/mailetcontainer.xml
@@ -33,31 +33,6 @@
         <processor state="root" enableJmx="true">
             <mailet match="All" class="PostmasterAlias"/>
             <mailet match="RelayLimit=30" class="Null"/>
-            <!-- Hook on sievemana...@james.linagora.com
-                 Mail send to this address will get interpreted with SIEVE 
Manage -->
-            <mailet match="RecipientIs=sievemana...@james.linagora.com" 
class="ToProcessor">
-                <processor>sieve-manager-check</processor>
-            </mailet>
-            <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="All" class="SetMailAttribute">
-                <spamChecked>true</spamChecked>
-            </mailet>
-            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="InSpammerBlacklist=query.bondedsender.org." 
class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <!-- Check for delivery from a known spam server -->
-            <!-- This set of matchers/mailets redirect all emails from known 
-->
-            <!-- black holes, open relays, and spam servers to the spam 
processor -->
-            <!-- For this set to function properly, the spam processor must be 
configured. -->
-            <mailet match="InSpammerBlacklist=dnsbl.njabl.org." 
class="ToProcessor">
-                <processor>spam</processor>
-                <notice>550 Requested action not taken: rejected - see 
http://njabl.org/</notice>
-            </mailet>
             <mailet match="All" class="ToProcessor">
                 <processor>transport</processor>
             </mailet>
@@ -70,7 +45,6 @@
             </mailet>
         </processor>
 
-
         <processor state="transport" enableJmx="true">
             <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
                 <name>X-UserIsAuth</name>

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailetcontainer.xml
----------------------------------------------------------------------
diff --git 
a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailetcontainer.xml
 
b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailetcontainer.xml
index 28bdcee..6a76330 100644
--- 
a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailetcontainer.xml
+++ 
b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailetcontainer.xml
@@ -33,8 +33,6 @@
         <processor state="root" enableJmx="false">
             <mailet match="All" class="PostmasterAlias"/>
             <mailet match="RelayLimit=30" class="Null"/>
-            <!-- Hook on sievemana...@james.linagora.com
-                 Mail send to this address will get interpreted with SIEVE 
Manage -->
             <mailet match="All" class="ToProcessor">
                 <processor>transport</processor>
             </mailet>
@@ -44,7 +42,6 @@
             <mailet match="All" class="Bounce"/>
         </processor>
 
-
         <processor state="transport" enableJmx="false">
             <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
                 <name>X-UserIsAuth</name>

http://git-wip-us.apache.org/repos/asf/james-project/blob/67e89cc4/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/resources/mailetcontainer.xml
----------------------------------------------------------------------
diff --git 
a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/resources/mailetcontainer.xml
 
b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/resources/mailetcontainer.xml
index 28bdcee..6a76330 100644
--- 
a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/resources/mailetcontainer.xml
+++ 
b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/resources/mailetcontainer.xml
@@ -33,8 +33,6 @@
         <processor state="root" enableJmx="false">
             <mailet match="All" class="PostmasterAlias"/>
             <mailet match="RelayLimit=30" class="Null"/>
-            <!-- Hook on sievemana...@james.linagora.com
-                 Mail send to this address will get interpreted with SIEVE 
Manage -->
             <mailet match="All" class="ToProcessor">
                 <processor>transport</processor>
             </mailet>
@@ -44,7 +42,6 @@
             <mailet match="All" class="Bounce"/>
         </processor>
 
-
         <processor state="transport" enableJmx="false">
             <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
                 <name>X-UserIsAuth</name>


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

Reply via email to