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 bt...@apache.org on 2018/01/30 09:56:23 UTC

[1/6] james-project git commit: JAMES-2293 Add more explanations about the Mail Repository feature.

Repository: james-project
Updated Branches:
  refs/heads/master 27fd46dc4 -> 6f6513dff


JAMES-2293 Add more explanations about the Mail Repository feature.


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

Branch: refs/heads/master
Commit: 4c525bcba294572d4150f3c02a45434beb6e3cd3
Parents: c702d05
Author: benwa <bt...@linagora.com>
Authored: Thu Jan 25 13:38:54 2018 +0700
Committer: benwa <bt...@linagora.com>
Committed: Tue Jan 30 16:49:38 2018 +0700

----------------------------------------------------------------------
 src/site/xdoc/server/feature-persistence.xml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/4c525bcb/src/site/xdoc/server/feature-persistence.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/server/feature-persistence.xml b/src/site/xdoc/server/feature-persistence.xml
index 7f70ff6..4c8c1a2 100644
--- a/src/site/xdoc/server/feature-persistence.xml
+++ b/src/site/xdoc/server/feature-persistence.xml
@@ -51,6 +51,24 @@
     </subsection>
   
     <subsection name="Mail Repository Store Persistence">
+
+      <p>Mail repository allow the administrator to store mail being processed in the mailet-container. The mails are typically
+      added by the <strong>ToRepository</strong> mailet. Then for Guice wiring <a href="manage-webadmin.html">webAdmin</a> API allows to read, delete and
+      reprocess these mails.</p>
+
+        <p>
+          Typical use cases might be:
+          <ul>
+            <li>Error management: mails can be stored if an error is encountered during the mail processing, be the error caused by a bug,
+                a configuration mistake, a parsing error, temporary unavailable services. Reprocessing the mails once the problem fixed allows to
+                avoid data loss. Note that you can use mail repositories of different types on the same James server in order to not
+                be dependant from a single data-store.</li>
+            <li>Debugging: MDC context allows to follow mail processing, and isolate logs of a single mail. You can then configure
+                James in order to collect all mails processed in one part of your pipeline, and thus better understand this one.</li>
+            <li>Data collection: Collect spam, suspicious mails and much more. You can then later on analyze them or for instance train
+                your anti-spam system.</li>
+          </ul>
+        </p>
   
       <p>Available Mail Repository Store are defined in mailrepositorystore.xml. 
          Each has an URL prefix (file, db, dbfile,...) that can be used in mailetcontainer.xml 


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


[2/6] james-project git commit: JAMES-2293 Provide documentation for WebAdmin MailRepositories endpoints

Posted by bt...@apache.org.
JAMES-2293 Provide documentation for WebAdmin MailRepositories endpoints


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

Branch: refs/heads/master
Commit: c702d058aa39b98bc8581eb544c7cf615da96936
Parents: 27fd46d
Author: benwa <bt...@linagora.com>
Authored: Thu Jan 25 13:22:10 2018 +0700
Committer: benwa <bt...@linagora.com>
Committed: Tue Jan 30 16:49:38 2018 +0700

----------------------------------------------------------------------
 src/site/markdown/server/manage-webadmin.md | 328 ++++++++++++++++++++++-
 1 file changed, 326 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/c702d058/src/site/markdown/server/manage-webadmin.md
----------------------------------------------------------------------
diff --git a/src/site/markdown/server/manage-webadmin.md b/src/site/markdown/server/manage-webadmin.md
index 337c1c0..b99c794 100644
--- a/src/site/markdown/server/manage-webadmin.md
+++ b/src/site/markdown/server/manage-webadmin.md
@@ -1,7 +1,8 @@
 Web administration for JAMES
 ============================
 
-The web administration supports for now the CRUD operations on the domains,the users, their mailboxes and their quotas, as described in the following sections.
+The web administration supports for now the CRUD operations on the domains, the users, their mailboxes and their quotas,
+ managing mail repositories, performing cassandra migrations, and much more, as described in the following sections.
 
 **WARNING**: This API allow authentication only via the use of JWT. If not configured with JWT, an administrator should ensure an attacker can not use this API.
 
@@ -591,6 +592,329 @@ Response codes:
  - 400: Group structure or member is not valid
  - 500: Internal error
 
+## Administrating mail repositories
+
+### Listing mail repositories
+
+```
+curl -XGET http://ip:port/mailRepositories
+```
+
+The answer looks like:
+
+```
+[
+    {
+        "repository": "file://var/mail/error/",
+        "id": "file%3A%2F%2Fvar%2Fmail%2Ferror%2F"
+    },
+    {
+        "repository": "file://var/mail/relay-denied/",
+        "id": "file%3A%2F%2Fvar%2Fmail%2Frelay-denied%2F"
+    },
+    {
+        "repository": "file://var/mail/spam/",
+        "id": "file%3A%2F%2Fvar%2Fmail%2Fspam%2F"
+    },
+    {
+        "repository": "file://var/mail/address-error/",
+        "id": "file%3A%2F%2Fvar%2Fmail%2Faddress-error%2F"
+    }
+]
+```
+
+You can use `id`, the encoded URL of the repository, to access it in later requests.
+
+Response codes:
+
+ - 200: The list of mail repositories
+ - 500: Internal error
+
+### Getting additional information for a mail repository
+
+```
+curl -XGET http://ip:port/mailRepositories/encodedUrlOfTheRepository/
+```
+
+Resource name `encodedUrlOfTheRepository` should be the resource id of an existing mail repository. Example:
+
+```
+curl -XGET http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/
+```
+
+The answer looks like:
+
+```
+{
+   "repository": "file://var/mail/error/",
+   "id": "file%3A%2F%2Fvar%2Fmail%2Ferror%2F",
+   "size": 243
+}
+```
+
+Response codes:
+
+ - 200: Additonnal information for that repository
+ - 404: This repository can not be found
+ - 500: Internal error
+
+### Listing mails contained in a mail repository
+
+```
+curl -XGET http://ip:port/mailRepositories/encodedUrlOfTheRepository/mails
+```
+
+Resource name `encodedUrlOfTheRepository` should be the resource id of an existing mail repository. Example:
+
+```
+curl -XGET http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/mails
+```
+
+The answer will contains all mailKey contained in that repository.
+
+```
+[
+    "mail-key-1",
+    "mail-key-2",
+    "mail-key-3"
+]
+```
+
+Note that this can be used to read mail details.
+
+You can pass additional URL parameters to this call in order to limit the output:
+ - A limit: no more elements than the specified limit will be returned. This needs to be strictly positive. If no value is specified, no limit will be applied.
+ - An offset: allow to skip elements. This needs to be positive. Default value is zero.
+
+Example:
+
+```
+curl -XGET http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/mails?limit=100&offset=500
+```
+
+Response codes:
+
+ - 200: The list of mail keys contained in that mail repository
+ - 400: Invalid parameters
+ - 404: This repository can not be found
+ - 500: Internal error
+
+### Reading a mail details
+
+```
+curl -XGET http://ip:port/mailRepositories/encodedUrlOfTheRepository/mails/mailKey
+```
+
+Resource name `encodedUrlOfTheRepository` should be the resource id of an existing mail repository. Resource name `mailKey` should be the key of a mail stored in that repository. Example:
+
+```
+curl -XGET http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/mails/mail-key-1
+```
+
+Response looks like:
+
+```
+{
+    "name": "mail-key-1",
+    "sender": "sender@domain.com",
+    "recipients": ["recipient1@domain.com", "recipient2@domain.com"],
+    "state": "address-error",
+    "error": "A small message explaining what happened to that mail..."
+}
+```
+
+Response codes:
+
+ - 200: Details of the mail
+ - 404: This repository or mail can not be found
+ - 500: Internal error
+
+### Removing a mail from a mail repository
+
+```
+curl -XDELETE http://ip:port/mailRepositories/encodedUrlOfTheRepository/mails/mailKey
+```
+
+Resource name `encodedUrlOfTheRepository` should be the resource id of an existing mail repository. Resource name `mailKey` should be the key of a mail stored in that repository. Example:
+
+```
+curl -XDELETE http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/mails/mail-key-1
+```
+
+Response codes:
+
+ - 204: This mail no longer exists in this repository
+ - 404: This repository can not be found
+ - 500: Internal error
+
+### Removing all mails from a mail repository
+
+
+```
+curl -XDELETE http://ip:port/mailRepositories/encodedUrlOfTheRepository/mails
+```
+
+Resource name `encodedUrlOfTheRepository` should be the resource id of an existing mail repository. Example:
+
+```
+curl -XDELETE http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/mails
+```
+
+The response to that request will be the scheduled `taskId` :
+
+```
+{"taskId":"5641376-02ed-47bd-bcc7-76ff6262d92a"}
+```
+
+Positionned headers:
+
+ - Location header indicates the location of the resource associated with the scheduled task. Example:
+
+```
+Location: /tasks/3294a976-ce63-491e-bd52-1b6f465ed7a2
+```
+
+Response codes:
+
+ - 201: Success. Corresponding task id is returned.
+ - 404: Could not find that mail repository
+ - 500: Internal error
+
+The scheduled task will have the following type `clearMailRepository` and the following `additionalInformation`:
+
+```
+{
+  "repositoryUrl":"file://var/mail/error/",
+  "initialCount": 243,
+  "remainingCount": 17
+}
+```
+
+### Reprocessing mails from a mail repository
+
+Sometime, you want to re-process emails stored in a mail repository. For instance, you can make a configuration error, or there can be a James bug that makes processing of some mails fail. Those mail will be stored in a mail repository. Once you solved the problem, you can reprocess them.
+
+To reprocess mails from a repository:
+
+```
+curl -XPATCH http://ip:port/mailRepositories/encodedUrlOfTheRepository/mails?action=reprocess
+```
+
+Resource name `encodedUrlOfTheRepository` should be the resource id of an existing mail repository. Example:
+
+For instance:
+
+```
+curl -XPATCH http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/mails?action=reprocess
+```
+
+Additional query paramaters are supported:
+ - `queue` allow you to target the mail queue you want to enqueue the mails in.
+ - `processor` allow you to overwrite the state of the reprocessing mails, and thus select the processors they will start their processing in.
+
+
+For instance:
+
+```
+curl -XPATCH http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/mails?action=reprocess&processor=transport&queue=spool
+```
+
+Note that the `action` query parameter is compulsary and can only take value `reprocess`.
+
+
+The response to that request will be the scheduled `taskId` :
+
+```
+{"taskId":"5641376-02ed-47bd-bcc7-76ff6262d92a"}
+```
+
+Positionned headers:
+
+ - Location header indicates the location of the resource associated with the scheduled task. Example:
+
+```
+Location: /tasks/3294a976-ce63-491e-bd52-1b6f465ed7a2
+```
+
+Response codes:
+
+ - 201: Success. Corresponding task id is returned.
+ - 404: Could not find that mail repository
+ - 500: Internal error
+
+The scheduled task will have the following type `reprocessingAllTask` and the following `additionalInformation`:
+
+```
+{
+  "repositoryUrl":"file://var/mail/error/",
+  "targetQueue":"spool",
+  "targetProcessor":"transport",
+  "initialCount": 243,
+  "remainingCount": 17
+}
+```
+
+### Reprocessing a specific mail from a mail repository
+
+To reprocess a specific mail from a mail repository:
+
+```
+curl -XPATCH http://ip:port/mailRepositories/encodedUrlOfTheRepository/mails/mailKey?action=reprocess
+```
+
+Resource name `encodedUrlOfTheRepository` should be the resource id of an existing mail repository. Resource name `mailKey` should be the key of a mail stored in that repository. Example:
+
+For instance:
+
+```
+curl -XPATCH http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/mails/name1?action=reprocess
+```
+
+Additional query paramaters are supported:
+ - `queue` allow you to target the mail queue you want to enqueue the mails in.
+ - `processor` allow you to overwrite the state of the reprocessing mails, and thus select the processors they will start their processing in.
+
+
+For instance:
+
+```
+curl -XPATCH http://ip:port/mailRepositories/file%3A%2F%2Fvar%2Fmail%2Ferror%2F/mails/name1?action=reprocess&processor=transport&queue=spool
+```
+
+Note that the `action` query parameter is compulsary and can only take value `reprocess`.
+
+
+The response to that request will be the scheduled `taskId` :
+
+```
+{"taskId":"5641376-02ed-47bd-bcc7-76ff6262d92a"}
+```
+
+Positionned headers:
+
+ - Location header indicates the location of the resource associated with the scheduled task. Example:
+
+```
+Location: /tasks/3294a976-ce63-491e-bd52-1b6f465ed7a2
+```
+
+Response codes:
+
+ - 201: Success. Corresponding task id is returned.
+ - 404: Could not find that mail repository
+ - 500: Internal error
+
+The scheduled task will have the following type `reprocessingOneTask` and the following `additionalInformation`:
+
+```
+{
+  "repositoryUrl":"file://var/mail/error/",
+  "targetQueue":"spool",
+  "targetProcessor":"transport",
+  "mailKey":"name1"
+}
+```
+
 ## Task management
 
 Some webadmin features schedules tasks. The task management API allow to monitor and manage the execution of the following tasks.
@@ -688,4 +1012,4 @@ Will return a list of Execution reports that are currently in progress.
 Response codes:
 
  - 200: A list of corresponding tasks is returned
- - 400: Invalid status value
\ No newline at end of file
+ - 400: Invalid status value


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


[5/6] james-project git commit: JAMES-2293 Add news post about the new features

Posted by bt...@apache.org.
JAMES-2293 Add news post about the new features


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

Branch: refs/heads/master
Commit: 113bb75d32fb76f25d600edfb9d68d272a7fea74
Parents: f0ba224
Author: Raphael Ouazana <ra...@linagora.com>
Authored: Fri Jan 26 17:50:26 2018 +0100
Committer: benwa <bt...@linagora.com>
Committed: Tue Jan 30 16:49:40 2018 +0700

----------------------------------------------------------------------
 .../_posts/2018-01-26-admin-features.markdown   | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/113bb75d/src/homepage/_posts/2018-01-26-admin-features.markdown
----------------------------------------------------------------------
diff --git a/src/homepage/_posts/2018-01-26-admin-features.markdown b/src/homepage/_posts/2018-01-26-admin-features.markdown
new file mode 100644
index 0000000..9baa2cd
--- /dev/null
+++ b/src/homepage/_posts/2018-01-26-admin-features.markdown
@@ -0,0 +1,24 @@
+---
+layout: post
+title:  "New administration features: manage your queues and your reporitories"
+date:   2018-01-26 00:00:22 +0200
+categories: james update
+---
+
+An often asked feature for James is the ability to handle the mails, that after some processing,
+have landed in a [repository], for example /var/mail/error/.
+
+A brand new webadmin API allows you to handle the content of these repositories, see the documentation in [manage-webadmin].
+It allows you to list the repositories, their content, but also to reprocess one or several mails in the processor and queue
+of your choice.
+
+Oh! And bonus, now you can forget this non scalable file repository and use the brand new Cassandra repository!
+
+On the same documentation page you will also find the new mail queue management API, done to list queued mails, remove some
+of them regarding different criteria, but also flush delayed mails.
+
+Most of the work on these already usable features is done, but we still have some ideas for related improvements. [Contributions] are welcomed!
+
+[repository]: http://james.apache.org/server/feature-persistence.html
+[Contributions]: https://issues.apache.org/jira/issues/?jql=project%20%3D%20JAMES%20AND%20resolution%20%3D%20Unresolved%20AND%20labels%20in%20(feature)%20AND%20component%20%20in%20(Queue%2C%20%22MailStore%20%26%20MailRepository%22)%20AND%20type%20in%20(Improvement)
+[manage-webadmin]: https://james.apache.org/server/manage-webadmin.html


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


[3/6] james-project git commit: JAMES-2291 Expose configuration for Cassandra Mail repository

Posted by bt...@apache.org.
JAMES-2291 Expose configuration for Cassandra Mail repository


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

Branch: refs/heads/master
Commit: 8b109e99181544f11d5f40f12673d8a346ef6b95
Parents: 4c525bc
Author: benwa <bt...@linagora.com>
Authored: Thu Jan 25 13:45:20 2018 +0700
Committer: benwa <bt...@linagora.com>
Committed: Tue Jan 30 16:49:39 2018 +0700

----------------------------------------------------------------------
 .../cassandra-ldap/destination/conf/mailrepositorystore.xml     | 5 +++++
 .../guice/cassandra/destination/conf/mailrepositorystore.xml    | 5 +++++
 .../src/test/resources/mailrepositorystore.xml                  | 5 +++++
 .../src/test/resources/mailrepositorystore.xml                  | 5 +++++
 4 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/8b109e99/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailrepositorystore.xml b/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailrepositorystore.xml
index acca810..299bd53 100644
--- a/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailrepositorystore.xml
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/conf/mailrepositorystore.xml
@@ -30,5 +30,10 @@
             <!-- Set if the messages should be listed sorted. False by default -->
             <config FIFO="false" CACHEKEYS="true"/>
         </mailrepository>
+        <mailrepository class="org.apache.james.mailrepository.cassandra.CassandraMailRepository">
+            <protocols>
+                <protocol>cassandra</protocol>
+            </protocols>
+        </mailrepository>
     </mailrepositories>
 </mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/8b109e99/dockerfiles/run/guice/cassandra/destination/conf/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/dockerfiles/run/guice/cassandra/destination/conf/mailrepositorystore.xml b/dockerfiles/run/guice/cassandra/destination/conf/mailrepositorystore.xml
index acca810..299bd53 100644
--- a/dockerfiles/run/guice/cassandra/destination/conf/mailrepositorystore.xml
+++ b/dockerfiles/run/guice/cassandra/destination/conf/mailrepositorystore.xml
@@ -30,5 +30,10 @@
             <!-- Set if the messages should be listed sorted. False by default -->
             <config FIFO="false" CACHEKEYS="true"/>
         </mailrepository>
+        <mailrepository class="org.apache.james.mailrepository.cassandra.CassandraMailRepository">
+            <protocols>
+                <protocol>cassandra</protocol>
+            </protocols>
+        </mailrepository>
     </mailrepositories>
 </mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/8b109e99/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailrepositorystore.xml b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailrepositorystore.xml
index 3ca4a1d..3386c33 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailrepositorystore.xml
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/resources/mailrepositorystore.xml
@@ -27,5 +27,10 @@
             </protocols>
             <config FIFO="false" CACHEKEYS="true"/>
         </mailrepository>
+        <mailrepository class="org.apache.james.mailrepository.cassandra.CassandraMailRepository">
+            <protocols>
+                <protocol>cassandra</protocol>
+            </protocols>
+        </mailrepository>
     </mailrepositories>
 </mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/8b109e99/server/protocols/webadmin-integration-test/src/test/resources/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin-integration-test/src/test/resources/mailrepositorystore.xml b/server/protocols/webadmin-integration-test/src/test/resources/mailrepositorystore.xml
index 3ca4a1d..3386c33 100644
--- a/server/protocols/webadmin-integration-test/src/test/resources/mailrepositorystore.xml
+++ b/server/protocols/webadmin-integration-test/src/test/resources/mailrepositorystore.xml
@@ -27,5 +27,10 @@
             </protocols>
             <config FIFO="false" CACHEKEYS="true"/>
         </mailrepository>
+        <mailrepository class="org.apache.james.mailrepository.cassandra.CassandraMailRepository">
+            <protocols>
+                <protocol>cassandra</protocol>
+            </protocols>
+        </mailrepository>
     </mailrepositories>
 </mailrepositorystore>


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


[4/6] james-project git commit: JAMES-2291 Document cassandra MailRepository implementation

Posted by bt...@apache.org.
JAMES-2291 Document cassandra MailRepository implementation


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

Branch: refs/heads/master
Commit: f0ba22408734b567f59adff7fd4da7f38a94362b
Parents: 8b109e9
Author: benwa <bt...@linagora.com>
Authored: Thu Jan 25 13:47:10 2018 +0700
Committer: benwa <bt...@linagora.com>
Committed: Tue Jan 30 16:49:40 2018 +0700

----------------------------------------------------------------------
 src/site/xdoc/server/config-mailrepositorystore.xml | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/f0ba2240/src/site/xdoc/server/config-mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/server/config-mailrepositorystore.xml b/src/site/xdoc/server/config-mailrepositorystore.xml
index 9564849..f4ab529 100644
--- a/src/site/xdoc/server/config-mailrepositorystore.xml
+++ b/src/site/xdoc/server/config-mailrepositorystore.xml
@@ -33,8 +33,8 @@
     
       <p>Consult <a href="https://github.com/apache/james-project/tree/master/server/app/src/main/resources/mailrepositorystore.xml">mailrepositorystore.xml</a> in GIT to get some examples and hints.</p>
 
-      <p>Mail Repository Stores are distinguished by where they store data.  There are five types of 
-        storage: File, Database, DBFile, MBox and JCR.</p>
+      <p>Mail Repository Stores are distinguished by where they store data.  There are several types of
+        storage: File, Database, Cassandra, DBFile, MBox and JCR.</p>
         
     </subsection>
         
@@ -106,7 +106,10 @@
       <p>If you enable this you need to make sure that embedded Jackrabbit instance is started as well. Check the container configuration</p>
         
     </subsection>
-  
+
+    <subsection name="CassandraMailRepository">
+      <p>Cassandra Guice wiring allows to use the <code>cassandra://</code> protocol for your ToRepository mailets.</p>
+    </subsection>
   </section>
 
 </body>


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


[6/6] james-project git commit: JAMES-2292 Provide documentation for WebAdmin MailQueue endpoints

Posted by bt...@apache.org.
JAMES-2292 Provide documentation for WebAdmin MailQueue endpoints


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

Branch: refs/heads/master
Commit: 6f6513dffc90386e3167506301a85431c940e5b5
Parents: 113bb75
Author: Antoine Duprat <ad...@linagora.com>
Authored: Fri Jan 26 15:30:27 2018 +0100
Committer: benwa <bt...@linagora.com>
Committed: Tue Jan 30 16:51:42 2018 +0700

----------------------------------------------------------------------
 src/site/markdown/server/manage-webadmin.md | 111 +++++++++++++++++++++++
 1 file changed, 111 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/6f6513df/src/site/markdown/server/manage-webadmin.md
----------------------------------------------------------------------
diff --git a/src/site/markdown/server/manage-webadmin.md b/src/site/markdown/server/manage-webadmin.md
index b99c794..e7cc226 100644
--- a/src/site/markdown/server/manage-webadmin.md
+++ b/src/site/markdown/server/manage-webadmin.md
@@ -915,6 +915,117 @@ The scheduled task will have the following type `reprocessingOneTask` and the fo
 }
 ```
 
+## Administrating mail queues
+
+### Listing mail queues
+
+```
+curl -XGET http://ip:port/mailQueues
+```
+
+The answer looks like:
+
+```
+["outgoing","spool"]
+```
+
+Response codes:
+
+ - 200: The list of mail queuess
+ - 500: Internal error
+
+### Getting a mail queue details
+
+```
+curl -XGET http://ip:port/mailQueues/mailQueueName
+```
+
+Resource name mailQueueName is the name of a mail queue, this command will return the details of the given mail queue. For instance:
+
+```
+{"name":"outgoing","size":0}
+```
+
+Response codes:
+
+ - 200: Success
+ - 400: Mail queue is not valid
+ - 404: The mail queue does not exist
+ - 500: Internal error
+
+### Listing the mails of a mail queue
+
+```
+curl -XGET http://ip:port/mailQueues/mailQueueName/mails
+```
+
+Additional URL query parameters:
+
+ - `limit`: Maximum number of mails returned in a single call. Only strictly positive integer values are accepted. Example:
+ 
+```
+curl -XGET http://ip:port/mailQueues/mailQueueName/mails?limit=100
+```
+
+The answer looks like:
+
+```
+[{
+  "name": "Mail1516976156284-8b3093b9-eebf-4c40-9c26-1450f4fcdc3c-to-test.com",
+  "sender": "user@james.linagora.com",
+  "recipients": ["someone@test.com"],
+  "nextDelivery": "1969-12-31T23:59:59.999Z"
+}]
+```
+
+Response codes:
+
+ - 200: Success
+ - 400: Mail queue is not valid or limit is invalid
+ - 404: The mail queue does not exist
+ - 500: Internal error
+
+### Deleting mails from a mail queue
+
+```
+curl -XDELETE http://ip:port/mailQueues/mailQueueName/mails?sender=senderMailAddress
+```
+
+This request should have exactly one query parameter from the following list:
+* sender: which is a mail address (i.e. sender@james.org)
+* name: which is a string
+* recipient: which is a mail address (i.e. recipient@james.org)
+
+The mails from the given mail queue matching the query parameter will be deleted.
+
+
+Response codes:
+
+ - 204: Success (No content)
+ - 400: Invalid request
+ - 404: The mail queue does not exist
+ - 500: Internal error
+
+### Flushing mails from a mail queue
+
+```
+curl -XPATCH http://ip:port/mailQueues/mailQueueName?delayed=true \
+  -d '{"delayed": false}'
+```
+
+This request should have the query parameter *delayed* set to *true*, in order to indicate only delayed mails are affected.
+The payload should set the `delayed` field to false inorder to remove the delay. This is the only supported combination,
+and it performs a flush.
+
+The mails delayed in the given mail queue will be flushed.
+
+Response codes:
+
+ - 204: Success (No content)
+ - 400: Invalid request
+ - 404: The mail queue does not exist
+ - 500: Internal error
+
 ## Task management
 
 Some webadmin features schedules tasks. The task management API allow to monitor and manage the execution of the following tasks.


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