james-project.git
2 years agoJAMES-2893 Move test-run.log in target
Benoit Tellier [Mon, 23 Mar 2020 04:23:56 +0000 (11:23 +0700)] 
JAMES-2893 Move test-run.log in target

This prevents intelliJ from thinking this is a build file and to think
log FQDN is a class reference...

2 years ago[Build time] Speedup ComputeMessageFastViewProjectionListenerTest
Benoit Tellier [Mon, 23 Mar 2020 04:17:08 +0000 (11:17 +0700)] 
[Build time] Speedup ComputeMessageFastViewProjectionListenerTest

One minute build time gains

2 years agoJAMES-3078 Remove Jetty utilities
Benoit Tellier [Sat, 21 Mar 2020 04:03:33 +0000 (11:03 +0700)] 
JAMES-3078 Remove Jetty utilities

No longer in use

2 years agoJAMES-3078 Migrate mock SMTP to reactor-netty
Benoit Tellier [Sat, 21 Mar 2020 04:01:36 +0000 (11:01 +0700)] 
JAMES-3078 Migrate mock SMTP to reactor-netty

2 years agoJAMES-3121 Write Cassandra time serie tables improvements upgrade instructions
Gautier DI FOLCO [Wed, 18 Mar 2020 15:58:06 +0000 (16:58 +0100)] 
JAMES-3121 Write Cassandra time serie tables improvements upgrade instructions

2 years agoJAMES-3121 Increase bloom_filter_fp_chance for Cassandra tables
Gautier DI FOLCO [Thu, 19 Mar 2020 10:05:00 +0000 (11:05 +0100)] 
JAMES-3121 Increase bloom_filter_fp_chance for Cassandra tables

2 years agoJAMES-3121 Use LeveledCompationStrategy for Cassandra eventStore table
Gautier DI FOLCO [Thu, 19 Mar 2020 09:50:06 +0000 (10:50 +0100)] 
JAMES-3121 Use LeveledCompationStrategy for Cassandra eventStore table

2 years agoJAMES-3121 Use SizeTieredCompationStrategy for Cassandra tables
Gautier DI FOLCO [Thu, 19 Mar 2020 09:45:54 +0000 (10:45 +0100)] 
JAMES-3121 Use SizeTieredCompationStrategy for Cassandra tables

According to https://docs.datastax.com/en/dse/5.1/dse-dev/datastax_enterprise/config/configChooseCompactStrategy.html

Migrating some tables to SizeTieredCompationStrategy will be more
efficient when data is not to frequent upsert or immutable.

2 years agoJAMES-3121 Disable read_repair for Cassandra time serie tables (EnqueuedMail and...
Gautier DI FOLCO [Wed, 18 Mar 2020 15:35:21 +0000 (16:35 +0100)] 
JAMES-3121 Disable read_repair for Cassandra time serie tables (EnqueuedMail and DeletedMail)

According to https://stackoverflow.com/a/43676007

> Recommendations: if the table is for time series data, it can be set to 0 (zero).
> For other tables, the more performant strategy is to set dc_local_read_repair_chance to 0.1
>
> Source : http://docs.datastax.com/en/cql/3.1/cql/cql_reference/tabProp.html#tabProp__cql_tabprop_more_read_repairs

2 years agoJAMES-3121 Use TimeWindowCompationStrategy for Cassandra time serie tables (EnqueuedM...
Gautier DI FOLCO [Wed, 18 Mar 2020 15:32:24 +0000 (16:32 +0100)] 
JAMES-3121 Use TimeWindowCompationStrategy for Cassandra time serie tables (EnqueuedMail and DeletedMail)

2 years agoJAMES-3122 Remove LogEnabled deprecated API
Benoit Tellier [Fri, 20 Mar 2020 07:05:35 +0000 (14:05 +0700)] 
JAMES-3122 Remove LogEnabled deprecated API

2 years agoJAMES-3122 Upgrade to log4J2 in server/app
Benoit Tellier [Thu, 19 Mar 2020 07:16:49 +0000 (14:16 +0700)] 
JAMES-3122 Upgrade to log4J2 in server/app

LOG4J 1 is deprecated and had been reported not to play well with Java 9+

https://www.mail-archive.com/server-user@james.apache.org/msg16315.html

2 years agoJAMES-3105 Limit concurrency of mailbox counters recomputation
Benoit Tellier [Fri, 20 Mar 2020 03:53:46 +0000 (10:53 +0700)] 
JAMES-3105 Limit concurrency of mailbox counters recomputation

2 years agoJAMES-3113 UsersRepository::getUsername
Benoit Tellier [Fri, 20 Mar 2020 03:04:41 +0000 (10:04 +0700)] 
JAMES-3113 UsersRepository::getUsername

2 years agoJAMES-3113 JamesMailetContext: Remove unused storeMail method
Benoit Tellier [Wed, 18 Mar 2020 03:39:01 +0000 (10:39 +0700)] 
JAMES-3113 JamesMailetContext: Remove unused storeMail method

This public method is unused, not implemented, and not part of the interface.

2 years agoJAMES-3113 LocalResources: propagate exceptions
Benoit Tellier [Wed, 18 Mar 2020 03:37:19 +0000 (10:37 +0700)] 
JAMES-3113 LocalResources: propagate exceptions

Avoid taking wrong business decisions upon technical exceptions

2 years agoJAMES-3113 LocalResources: rely on Username POJO
Benoit Tellier [Wed, 18 Mar 2020 03:13:31 +0000 (10:13 +0700)] 
JAMES-3113 LocalResources: rely on Username POJO

2 years agoJAMES-3113 LocalResources: cosmetic fixes
Benoit Tellier [Wed, 18 Mar 2020 03:11:53 +0000 (10:11 +0700)] 
JAMES-3113 LocalResources: cosmetic fixes

 - Visibility
 - Location

2 years agoJAMES-3119 Strong type ProtocolSession
Gautier DI FOLCO [Wed, 18 Mar 2020 12:08:57 +0000 (13:08 +0100)] 
JAMES-3119 Strong type ProtocolSession

2 years agoUpgrade play-json to 2.8
Matthieu Baechler [Thu, 19 Mar 2020 09:51:34 +0000 (10:51 +0100)] 
Upgrade play-json to 2.8

2 years agoJAMES-3082 define different wait times for event bus in tests
Rémi KOWALSKI [Wed, 11 Mar 2020 13:10:55 +0000 (14:10 +0100)] 
JAMES-3082 define different wait times for event bus in tests

2 years agoJAMES-3082 use a specific RetryBackOffConfiguration for tests with a shorter first...
Rémi KOWALSKI [Wed, 11 Mar 2020 10:44:10 +0000 (11:44 +0100)] 
JAMES-3082 use a specific RetryBackOffConfiguration for tests with a shorter first backoff delay

2 years agoJAMES-3082 set a rabbitMQ connection network recovery interval of 1 second in test
Rémi KOWALSKI [Wed, 11 Mar 2020 09:58:54 +0000 (10:58 +0100)] 
JAMES-3082 set a rabbitMQ connection  network recovery interval of 1 second in test

2 years agoJAMES-3113 Split JamesMailetContext responsibilities
Benoit Tellier [Tue, 17 Mar 2020 02:05:56 +0000 (09:05 +0700)] 
JAMES-3113 Split JamesMailetContext responsibilities

2 years agoJAMES-3113 Mails send from an alias should be considered as localSender
Benoit Tellier [Thu, 12 Mar 2020 13:28:24 +0000 (20:28 +0700)] 
JAMES-3113 Mails send from an alias should be considered as localSender

2 years agoJAMES-3116 Single insert on mailbox counters upon add and remove message
Benoit Tellier [Fri, 13 Mar 2020 14:40:09 +0000 (21:40 +0700)] 
JAMES-3116 Single insert on mailbox counters upon add and remove message

2 years agoJAMES-3116 Group reading count & unseen
Benoit Tellier [Fri, 13 Mar 2020 14:08:00 +0000 (21:08 +0700)] 
JAMES-3116 Group reading count & unseen

Also remove countUnseen

2 years agoJAMES-3120 don't save mail if no-op in RemoveMimeHeader mailet
Rémi Kowalski [Tue, 17 Mar 2020 15:56:47 +0000 (16:56 +0100)] 
JAMES-3120 don't save mail if no-op in RemoveMimeHeader mailet

2 years agoJAMES-3120 add test to demonstrate that RemoteMimeHeader will fail to process no...
Rémi Kowalski [Tue, 17 Mar 2020 15:55:01 +0000 (16:55 +0100)] 
JAMES-3120 add test to demonstrate that RemoteMimeHeader will fail to process no-op a mail with incorrect headers

2 years agoUpdate downloads links to use downloads.apache.org instead of /dist
Raphael Ouazana [Thu, 19 Mar 2020 14:29:09 +0000 (15:29 +0100)] 
Update downloads links to use downloads.apache.org instead of /dist

2 years agoJAMES-3078 Dependency fix
Rene Cordier [Wed, 11 Mar 2020 07:03:36 +0000 (14:03 +0700)] 
JAMES-3078 Dependency fix

2 years agoJAMES-3078 Cleanup jmap-draft
Rene Cordier [Wed, 11 Mar 2020 07:00:54 +0000 (14:00 +0700)] 
JAMES-3078 Cleanup jmap-draft

2 years agoJAMES-3078 Simplify JettyHttpServer
Rene Cordier [Wed, 11 Mar 2020 06:58:37 +0000 (13:58 +0700)] 
JAMES-3078 Simplify JettyHttpServer

2 years agoJAMES-3078 Guice bindings
Rene Cordier [Wed, 11 Mar 2020 06:57:13 +0000 (13:57 +0700)] 
JAMES-3078 Guice bindings

s/JMAPConfiguration/JMAPDraftConfiguration

2 years agoJAMES-3078 JMAPApiRoutes
Rene Cordier [Wed, 11 Mar 2020 06:47:57 +0000 (13:47 +0700)] 
JAMES-3078 JMAPApiRoutes

2 years agoJAMES-3078 DefaultMailboxesReactiveProvisioner and tests
Rene Cordier [Wed, 11 Mar 2020 06:47:14 +0000 (13:47 +0700)] 
JAMES-3078 DefaultMailboxesReactiveProvisioner and tests

2 years agoJAMES-3078 UserProvisioner and tests
Rene Cordier [Wed, 11 Mar 2020 06:46:38 +0000 (13:46 +0700)] 
JAMES-3078 UserProvisioner and tests

2 years agoJAMES-3078 UploadRoutes
Rene Cordier [Wed, 11 Mar 2020 06:45:46 +0000 (13:45 +0700)] 
JAMES-3078 UploadRoutes

2 years agoJAMES-3078 Download routes and tests
Rene Cordier [Wed, 11 Mar 2020 06:41:55 +0000 (13:41 +0700)] 
JAMES-3078 Download routes and tests

2 years agoJAMES-3078 Authentication routes and filters
Rene Cordier [Wed, 11 Mar 2020 05:00:40 +0000 (12:00 +0700)] 
JAMES-3078 Authentication routes and filters

With tests, CORS, access tokens, ...

2 years agoJAMES-3078 small exception refactoring for jmap-draft
Rene Cordier [Wed, 11 Mar 2020 05:09:17 +0000 (12:09 +0700)] 
JAMES-3078 small exception refactoring for jmap-draft

2 years agoJAMES-3078 Reactor-Netty JMAPServer implementation
Rene Cordier [Wed, 11 Mar 2020 04:44:59 +0000 (11:44 +0700)] 
JAMES-3078 Reactor-Netty JMAPServer implementation

2 years ago[Refactoring] Delete unused classes
Rene Cordier [Tue, 3 Mar 2020 02:08:04 +0000 (09:08 +0700)] 
[Refactoring] Delete unused classes

2 years agoJAMES-3111 Log statements using Consistency level ALL
Benoit Tellier [Tue, 10 Mar 2020 10:40:26 +0000 (17:40 +0700)] 
JAMES-3111 Log statements using Consistency level ALL

2 years agoJAMES-3111 Use a retry policy to decrease consistency level when All
Benoit Tellier [Tue, 10 Mar 2020 10:31:53 +0000 (17:31 +0700)] 
JAMES-3111 Use a retry policy to decrease consistency level when All

2 years agoJAMES-3072 Add an entry for mailbox export in the CHANGELOG
LanKhuat [Fri, 13 Mar 2020 07:42:47 +0000 (14:42 +0700)] 
JAMES-3072 Add an entry for mailbox export in the CHANGELOG

2 years agoJAMES-3072 Add documentation for mailboxes export route in webadmin
LanKhuat [Fri, 13 Mar 2020 07:41:46 +0000 (14:41 +0700)] 
JAMES-3072 Add documentation for mailboxes export route in webadmin

2 years agoJAMES-3072 Add MailboxesExportRoutes module
LanKhuat [Tue, 10 Mar 2020 09:29:49 +0000 (16:29 +0700)] 
JAMES-3072 Add MailboxesExportRoutes module

2 years agoJAMES-3072 Move bindings for backup task from MailboxRoutesModule to new module
LanKhuat [Tue, 10 Mar 2020 04:04:12 +0000 (11:04 +0700)] 
JAMES-3072 Move bindings for backup task from MailboxRoutesModule to new module

2 years agoJAMES-3072 MailboxesExportTask webadmin integration test
Lan [Fri, 6 Mar 2020 10:46:10 +0000 (17:46 +0700)] 
JAMES-3072 MailboxesExportTask webadmin integration test

2 years agoJAMES-3072 MailboxesExportTask guice binding
Lan [Fri, 6 Mar 2020 10:28:31 +0000 (17:28 +0700)] 
JAMES-3072 MailboxesExportTask guice binding

2 years agoJAMES-3072 Add test for failing case
Lan [Fri, 6 Mar 2020 10:12:13 +0000 (17:12 +0700)] 
JAMES-3072 Add test for failing case

2 years agoJAMES-3072 Simplify test setup
Lan [Fri, 6 Mar 2020 10:03:21 +0000 (17:03 +0700)] 
JAMES-3072 Simplify test setup

2 years agoJAMES-3072 Add Task for Mailboxes Export Service
Lan [Fri, 6 Mar 2020 09:06:03 +0000 (16:06 +0700)] 
JAMES-3072 Add Task for Mailboxes Export Service

2 years agoJAMES-3112 Fluentify CanSendFromContact domain mapping creation
Benoit Tellier [Thu, 12 Mar 2020 10:59:49 +0000 (17:59 +0700)] 
JAMES-3112 Fluentify CanSendFromContact domain mapping creation

2 years agoJAMES-3112 Upgrade notes and Changelog
Benoit Tellier [Thu, 12 Mar 2020 10:29:56 +0000 (17:29 +0700)] 
JAMES-3112 Upgrade notes and Changelog

2 years ago[Refactoring] Fluentify Username::withOtherDomain
Benoit Tellier [Tue, 10 Mar 2020 07:58:25 +0000 (08:58 +0100)] 
[Refactoring] Fluentify Username::withOtherDomain

2 years ago[Refactoring] Add toString to ClassName
Benoit Tellier [Tue, 10 Mar 2020 07:55:56 +0000 (08:55 +0100)] 
[Refactoring] Add toString to ClassName

2 years agoJAMES-3112 Better document RRT mapping types
Benoit Tellier [Tue, 10 Mar 2020 02:26:50 +0000 (09:26 +0700)] 
JAMES-3112 Better document RRT mapping types

2 years agoJAMES-3112 distinguish Domain Alias from Domain Mapping RRTs
Benoit Tellier [Tue, 10 Mar 2020 01:54:20 +0000 (08:54 +0700)] 
JAMES-3112 distinguish Domain Alias from Domain Mapping RRTs

Domain mapping is intended for technical purposes, and should not be
taken into account for user allowed from.

Domain aliases are user exposed, and should be taken into account for
user eallowed from.

2 years agoJAMES-3115 Do not catch then retrow configuration exceptions
Benoit Tellier [Fri, 13 Mar 2020 11:28:30 +0000 (18:28 +0700)] 
JAMES-3115 Do not catch then retrow configuration exceptions

2 years agoJAMES-3115 Fail when typo in mailet-container configuration file.µ
Benoit Tellier [Fri, 13 Mar 2020 11:27:47 +0000 (18:27 +0700)] 
JAMES-3115 Fail when typo in mailet-container configuration file.µ

Before that the exception was interpreted as a missing key of the
configuration file, leading to the default one to be used.

2 years ago[Refactoring] rename DeleteMailsFromMailQueueTask fields to make it clear arguments...
Matthieu Baechler [Mon, 24 Feb 2020 11:00:37 +0000 (12:00 +0100)] 
[Refactoring] rename DeleteMailsFromMailQueueTask fields to make it clear arguments are optionals

2 years agoJAMES-3070 strong type MailQueueName
Matthieu Baechler [Thu, 20 Feb 2020 15:51:38 +0000 (16:51 +0100)] 
JAMES-3070 strong type MailQueueName

2 years agoJAMES-3070 listCreatedMailQueues should only return queue names
Matthieu Baechler [Wed, 19 Feb 2020 15:45:22 +0000 (16:45 +0100)] 
JAMES-3070 listCreatedMailQueues should only return queue names

2 years agoJAMES-3070 Don't use cache for RabbitMQ Mailqueue Consumer
Matthieu Baechler [Wed, 19 Feb 2020 15:10:23 +0000 (16:10 +0100)] 
JAMES-3070 Don't use cache for RabbitMQ Mailqueue Consumer

    Make MailQueue Closeable to free resources when using non-cached
    implementations.

    For that we needed to take care about MailQueue lifecycle at every
    usage place.

2 years ago[Refactoring] replace old-school Guava FP with Java 8 Streams
Matthieu Baechler [Fri, 28 Feb 2020 17:20:32 +0000 (18:20 +0100)] 
[Refactoring] replace old-school Guava FP with Java 8 Streams

2 years ago[Refactoring] replace stream on Map by forEach
Matthieu Baechler [Fri, 28 Feb 2020 17:10:34 +0000 (18:10 +0100)] 
[Refactoring] replace stream on Map by forEach

2 years ago[Refactoring] replace loops by removeIf
Matthieu Baechler [Fri, 28 Feb 2020 17:08:51 +0000 (18:08 +0100)] 
[Refactoring] replace loops by removeIf

2 years ago[Refactoring] replace Guava Function by java Function
Matthieu Baechler [Fri, 28 Feb 2020 17:05:08 +0000 (18:05 +0100)] 
[Refactoring] replace Guava Function by java Function

2 years ago[Refactoring] replace inner class by a lambda
Matthieu Baechler [Fri, 28 Feb 2020 17:01:07 +0000 (18:01 +0100)] 
[Refactoring] replace inner class by a lambda

2 years ago[Refactoring] unnecessary explicit generics
Matthieu Baechler [Fri, 28 Feb 2020 16:59:02 +0000 (17:59 +0100)] 
[Refactoring] unnecessary explicit generics

2 years agoJAMES-3118 Minor fixes in manage-webadmin.md
Gautier DI FOLCO [Mon, 16 Mar 2020 13:30:40 +0000 (14:30 +0100)] 
JAMES-3118 Minor fixes in manage-webadmin.md

2 years agoJAMES-3118 Be more explicit when an alias creation fails
Gautier DI FOLCO [Mon, 16 Mar 2020 13:27:48 +0000 (14:27 +0100)] 
JAMES-3118 Be more explicit when an alias creation fails

2 years agoJAMES-3072: MailboxesBackup ExportService
Tran Tien Duc [Wed, 19 Feb 2020 04:51:31 +0000 (11:51 +0700)] 
JAMES-3072: MailboxesBackup ExportService

2 years ago[Refactoring] integrate filePrefix directly with string
Tran Tien Duc [Wed, 19 Feb 2020 03:10:01 +0000 (10:10 +0700)] 
[Refactoring] integrate filePrefix directly with string

2 years agoJAMES-3074 UidValidity sanitizing at the IMAP level
Benoit Tellier [Mon, 2 Mar 2020 06:10:25 +0000 (07:10 +0100)] 
JAMES-3074 UidValidity sanitizing at the IMAP level

2 years agoJAMES-3074 Changelog & upgrade instructions for JPA & Cassandra as well
Benoit Tellier [Wed, 26 Feb 2020 08:08:58 +0000 (15:08 +0700)] 
JAMES-3074 Changelog & upgrade instructions for JPA & Cassandra as well

2 years agoJAMES-3074 Enforce UidValidity to be always valid
Benoit Tellier [Wed, 26 Feb 2020 08:00:54 +0000 (15:00 +0700)] 
JAMES-3074 Enforce UidValidity to be always valid

We handle invalid values before creating the UidValidity POJO hence
there are no longer reasons not to do a strong validation here

2 years agoJAMES-3074 UidValidity sanitizing at the IMAP level
Benoit Tellier [Wed, 26 Feb 2020 07:56:06 +0000 (14:56 +0700)] 
JAMES-3074 UidValidity sanitizing at the IMAP level

2 years agoJAMES-3074 JPA: On the fly UidValidity sanitizing
Benoit Tellier [Wed, 26 Feb 2020 07:47:41 +0000 (14:47 +0700)] 
JAMES-3074 JPA: On the fly UidValidity sanitizing

Impact: minor. Statistically, one entry out of 2 billion is affected.

2 years agoJAMES-3074 Cassandra: On the fly UidValidity sanitizing
Benoit Tellier [Wed, 26 Feb 2020 07:37:19 +0000 (14:37 +0700)] 
JAMES-3074 Cassandra: On the fly UidValidity sanitizing

Impact: minor. Statistically, one entry out of 2 billion is affected.

2 years agoJAMES-3074 Maildir: On the fly UidValidity sanitizing
Benoit Tellier [Wed, 26 Feb 2020 05:01:12 +0000 (12:01 +0700)] 
JAMES-3074 Maildir: On the fly UidValidity sanitizing

Impact: major. All the generated value are invalids.

2 years agoPROTOCOLS-121 Use enabled cipher suites in createPipelineFactory
janbusch [Wed, 4 Mar 2020 16:00:19 +0000 (17:00 +0100)] 
PROTOCOLS-121 Use enabled cipher suites in createPipelineFactory

For the created ChannelPipelineFactory to actually take into account the enabled cipher suites that have been set while constructing the NettyServer instance, they have to be given to the AbstractSSLAwareChannelPipelineFactory constructor.

2 years agoJAMES-3105 Documentation for webadmin endpoint
Benoit Tellier [Sat, 7 Mar 2020 07:12:27 +0000 (14:12 +0700)] 
JAMES-3105 Documentation for webadmin endpoint

2 years agoJAMES-3105 Changelog entry
Benoit Tellier [Sat, 7 Mar 2020 07:06:17 +0000 (14:06 +0700)] 
JAMES-3105 Changelog entry

2 years agoJAMES-3105 Piggy back message denormalization checks on mailbox counters recomputation
Benoit Tellier [Sat, 7 Mar 2020 06:50:11 +0000 (13:50 +0700)] 
JAMES-3105 Piggy back message denormalization checks on mailbox counters recomputation

We can piggy back a partial check of the message denormalization upon
counter recomputation (partial because we cannot detect missing
entries in the "list messages in mailbox" denormalization table)

2 years agoJAMES-3105 Guice bindings
Benoit Tellier [Fri, 6 Mar 2020 16:09:57 +0000 (23:09 +0700)] 
JAMES-3105 Guice bindings

2 years agoJAMES-3105 Webadmin endpoint to recompute mailbox counters
Benoit Tellier [Fri, 6 Mar 2020 16:05:23 +0000 (23:05 +0700)] 
JAMES-3105 Webadmin endpoint to recompute mailbox counters

Proposed endpoint:

```
curl -XPST http://ip:port/mailboxes?task=RecomputeMailboxCounters
```

2 years agoJAMES-3105 Task for recomputing mailbox counters
Benoit Tellier [Fri, 6 Mar 2020 15:45:03 +0000 (22:45 +0700)] 
JAMES-3105 Task for recomputing mailbox counters

A simple wrapper around the already existing service...

2 years agoJAMES-3105 Add a service for recomputing mailbox counters
Benoit Tellier [Fri, 6 Mar 2020 15:36:42 +0000 (22:36 +0700)] 
JAMES-3105 Add a service for recomputing mailbox counters

Algorithm:

 - List existing mailboxes
 - List their messages
 - Check them against their source of truth
 - Compute mailbox counter values
 - And reset the value of the counter if needed

Limitations:

This won't be friendly in the face of concurrent operations, which
would be ignored during the recomputation of the counter of the
given mailbox. However the source of truth is unaffected hence,
upon rerunning the algorithm, the result will be eventually correct.

We rely on the "listing messages by mailbox" projection (that we
recheck). Missing entries in there will be ignored until the given
projection is healed (currently unsupported).

2 years agoJAMES-3105 Allow resetting counters
Benoit Tellier [Fri, 6 Mar 2020 15:36:25 +0000 (22:36 +0700)] 
JAMES-3105 Allow resetting counters

Resetting counters is intrinsecly flowed in the face of concurrent operations.

2 years agoJAMES-3105 Add a MailboxCounters::toString method to ease debugging
Benoit Tellier [Sat, 7 Mar 2020 03:12:41 +0000 (10:12 +0700)] 
JAMES-3105 Add a MailboxCounters::toString method to ease debugging

2 years agoJAMES-3107 Log request when P99 is exceeded
Benoit Tellier [Sun, 8 Mar 2020 07:17:15 +0000 (14:17 +0700)] 
JAMES-3107 Log request when P99 is exceeded

Given our current tooling I struggle to correctly review slow requests
from James.

My current procedure is:
  - In grafana identify timestamp of a spike
  - Groke logs in kibana until I find something that could correspond
  - Pray and hope my analisys stands.

This is both time consumming, hard to do and unreliable.

Identifying slow queries is important as it can point us to critical
path to optimize.

Hence I propose to log an info message when p99 is exceeded for high
level function (JMAP methods, IMAP processors, matcher mailet and
overall processing, mailbox listeners, and remote delivery).

In order to avoid log spamming I propose to only log when a
function-specified threshold is exceeded (defaulting to 100ms)

I belive it will help us coming up with more meaningful performance
analysis and better fixes for the greater goods of our prduction
platforms.

2 years agoJAMES-3108 Stop james server upon graceful shutdown
Benoit Tellier [Mon, 9 Mar 2020 02:25:05 +0000 (09:25 +0700)] 
JAMES-3108 Stop james server upon graceful shutdown

James should not shut down immediatly on SIGTERM, but it gracefully terminates connections.

In a kubernetes context for instance:

```
It might take some time before a component such as kube-proxy or the Ingress controller is notified of the endpoint changes.

Hence, traffic might still flow to the Pod despite it being marked as terminated.

The app should stop accepting new requests on all remaining connections, and close these once the outgoing queue is drained.

If you need a refresher on how endpoints are propagated in your cluster, read this article on how to handle client requests properly.
```

(Source: https://learnk8s.io/production-best-practices)

I think it also makes sens out of this context.

A graceful shutdown furthermore decrease the risk of inconsistencies in the underlying datastores (Cassandra)

2 years agoJAMES-3108 Add a marker interface for Guice main classes
Benoit Tellier [Sun, 8 Mar 2020 14:57:50 +0000 (21:57 +0700)] 
JAMES-3108 Add a marker interface for Guice main classes

We can furthermore group common lifecycle code

2 years agoJAMES-1759 WebAdmin route to test user existence
Benoit Tellier [Thu, 5 Mar 2020 04:08:52 +0000 (11:08 +0700)] 
JAMES-1759 WebAdmin route to test user existence

Convenient when the input of user list is super large

2 years agoJAMES-3044 Upgrade JSOUP to 1.13.1
Benoit Tellier [Fri, 6 Mar 2020 04:22:28 +0000 (11:22 +0700)] 
JAMES-3044 Upgrade JSOUP to 1.13.1

 - Many performance enhancement are shipped in 1.13.1

```
memory optimizations, reducing the retained size of a Document by ~ 39%,
and allocations by ~ 9%
```

Ships:

  * Bugfix: in CharacterReader when parsing an input stream, could throw
    a Mark Invalid exception if the reader was marked, a bufferUp
    occurred, and then the reader was rewound.
    <https://github.com/jhy/jsoup/issues/1324>

Which we noticed in production, even after a 1.12.2 upgrade.

Other bug fixes and enhancements are documented.

CF https://github.com/jhy/jsoup/blob/master/CHANGES

2 years agoJAMES-3103 Add a test showing message are dispatched to registered keys qfter outage
Benoit Tellier [Fri, 6 Mar 2020 14:34:44 +0000 (21:34 +0700)] 
JAMES-3103 Add a test showing message are dispatched to registered keys qfter outage

2 years agoJAMES-3103 Add a prefix to EventBus' queue name
Gautier DI FOLCO [Fri, 6 Mar 2020 12:51:30 +0000 (13:51 +0100)] 
JAMES-3103 Add a prefix to EventBus' queue name