Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto complete: a task to build user contacts from SENT mailbox #1265

Open
quantranhong1999 opened this issue Oct 28, 2024 · 6 comments
Open
Assignees
Labels

Comments

@quantranhong1999
Copy link
Member

Why

A task to build auto-complete index from the addresses that users sent mails to in the SENT mailbox.

Would help us in several cases:

  • We can not reindex the contact indices.
    e.g. [Bug] No autosuggestions for recipient address tmail-flutter#3229. Rational: TWP stg/prod shared the same contact indices with tmail.linagora.com -> we needed to split the contact indices -> no data in the new TWP contacts indices yet, while we can not just reindex them using the tmail.linagora.com data...

  • We migrate users' mailboxes from another system.
    => It would be helpful IMO to build auto-complete data from users' existing SENT emails which would help users have a better uninterrupted experience

How

Write a TMail task that:

  • traverse users' SENT mailbox
  • for each MessageResult get Headers, then parse the contacts from TO, CC, and BCC headers using Mime4j e.g. MimeMessageHeadersUtil
  • index the contacts using EmailAddressContactSearchEngine

DoD

Tests + documentation for the task

@quantranhong1999 quantranhong1999 added the enhancement New feature or request label Oct 28, 2024
@quantranhong1999
Copy link
Member Author

e.g. linagora/tmail-flutter#3229

Solved this issue using Reindex a subset of documents.

{
  "source": {
    "index": "user_contact_v2",
    "query": {
      "wildcard": {
        "accountId": {
          "value": "*@stg.lin-saas.com"
        }
      }
    }
  },
  "dest": {
    "index": "twp-mail-stg-user-contact"
  }
}

@chibenwa
Copy link
Member

Love the idea, I moved this into Todo as we could leverage this on the MU project.

Cc @guimard

@hungphan227 hungphan227 self-assigned this Oct 30, 2024
@chibenwa
Copy link
Member

Second thought about it...

What we shall do is not build directly the autocomplete DB but rather ingest those contacts onto OpenPaaS (by sending AMQP messages onto the collector:email queue)

#311 will then make sure we get those onto the auto-complete search engine.

Cc @HoussemNasri

@chibenwa
Copy link
Member

We shall also leverage something like a bloom filter in order not to report duplicates.

@Arsnael
Copy link
Member

Arsnael commented Oct 31, 2024

What we shall do is not build directly the autocomplete DB but rather ingest those contacts onto OpenPaaS (by sending AMQP messages onto the collector:email queue)

That works in the case we use tmail with openpaas... but what if we don't?

@chibenwa
Copy link
Member

That works in the case we use tmail with openpaas... but what if we don't?

Environments with OpenPaaS: CNB, MU, linagora.com
Environments without OpenPaaS: TWP

Then we would need two tasks (or at least 2 modes for one task) in order to be able to perform either one or the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants