linagora / tmail-backend

GNU Affero General Public License v3.0
41 stars 22 forks source link

Contact/calendar support for TMail #311

Open chibenwa opened 3 years ago

chibenwa commented 3 years ago

User story

Contact

WHEN I type an Email address when I send an email,
THEN I want auto completion suggestions

The current solution for this is to rely solely on the phone contacts and on a database on the mobile.

Limitations:

We wish to add backend support for autocompletion including:

Calendar

WHEN I receive an Email about an event (invitation)
THEN I should have information about this event
AND I should be able to manage my attendance from my mails

Nowadays received emails adds events on your calendar. However TMail have so far no strong support for Calendars

Screenshot of OpenPaaS bluebar feature:

Screenshot from 2021-10-25 13-08-05.png

Screenshot from 2021-10-25 13-08-18.png

Objectives

A (web) mail application clearly needs some kind of integration with a calendar / contact app (we speak of trinity).

To provide such a trinity in TMail we would like:

Non goals: We do not wish to offer a strong support for contact/calendar management and to replace the contact/calendar team.

Technical solutions

Calendar

1. JMAP Event/parse should allow the TMail fronts to parse an ICS attachment into a structured JSON representing and event.

They should be able to use it to display all bluebar related data

2. EventAttendance storage (memory + API + contract). 3. We also provide a Cassandra implementation of this.

This will be queried by JMAP to know the attendance status of an event.

3. EventAttendance/get + EventAttendance/set should allow one to manage its event attendance over JMAP

4. AMQP synchronisation

To achieve this TMail with receive/send specific AMQP messages.

Contact

1. Implement an EmailContactAutoCompletionEngine (memory and ElasticSearch)

It will allow storing email addresses of a contact of the user.

Given I auto complete bte it will search %bte%.

Use NGrams in ElasticSearch to implement this.

2. Implement a mailet to populate EmailContactAutoCompletionEngine

Recipients are added to the contact base of the sender.

3. Implement EmailContact/query

This can be used by mobile apps/web mail to auto-complete results (can be used by mobile apps to provide more results.

4. AMQP sync

We will receive an AMQP message telling us this, and we need to update our auto-complete DB accordingly.

5. User auto-complete.

When I add a user in the combined user repository, Then is gets added to a domain auto completion DB (similar to 1.). Domain users should be included in EmailContact/query(3.)

vttranlina commented 2 years ago

Will we still implement bloomfilter before indexing?

chibenwa commented 2 years ago

Will we still implement bloomfilter before indexing?

No it have a lot of downsides that may lead to corectness issues.

IMO we can imagine doing a get before indexing to avoid poluting ElasticSearch index...