When trying to decrypt instances that were either not encrypted or
did not have an _ownerEncSessionKey (but a bucketKey), we failed to
set the instance on the entityUpdateData. Instead of checking for
existence of the _ownerEncSessionKey, we now resolve the optional
sessionKey using the cryptoFacade.
Co-authored-by: abp <abp@tutao.de>
Instead of applying inbox rules based on the unread mail state in the
inbox folder, we introduce the new isInboxRuleApplied boolean flag on
the mail type. If a mail has been processed by the leader client, which
is checking for matching inbox rules, the isInboxRuleApplied flag is
set to true. If there is a matching rule the flag is updated through the
MoveMailService, if there is no matching rule, the flag is updated
using the IsInboxRuleAppliedStateService. Both requests are
throttled / debounced.
This new inbox rule handing solves the following two problems:
- when clicking on a notification it could still happen,
that sometimes the inbox rules where not applied
- when the inbox folder had a lot of unread mails, the loading time did
massively increase, since inbox rules were re-applied on every load
Co-authored-by: abp <abp@tutao.de>
Implement a local machine learning model for client-side spam filtering.
The local model is implemented using tensorflow "LayersModel" to train
separate models in all available mailboxes, resulting in one model
per ownerGroup (i.e. mailbox).
Initially, the training data is aggregated from the last 30 days of
received mails, and the data is stored in a separate offline database
table named spam_classification_training_data. The trained model is
stored in the table spam_classification_model. The initial training
starts after indexing, with periodic training happening
every 30 minutes and on each subsequent login.
The model will predict on incoming mails once we have received the
entity event for said mail, moving it to either inbox or spam folder.
When users move mails, we update the training data labels accordingly,
by adjusting the isSpam classification and isSpamConfidence values in
the offline database. The MoveMailService now contains a moveReason,
which indicates that the mail has been moved by our spam filter.
Client-side spam filtering can be activated using the
SpamClientClassification feature flag, and is for now only
available on the desktop client.
Co-authored-by: sug <sug@tutao.de>
Co-authored-by: kib <104761667+kibibytium@users.noreply.github.com>
Co-authored-by: abp <abp@tutao.de>
Co-authored-by: map <mpfau@users.noreply.github.com>
Co-authored-by: jhm <17314077+jomapp@users.noreply.github.com>
Co-authored-by: frm <frm@tutao.de>
Co-authored-by: das <das@tutao.de>
Co-authored-by: nif <nif@tutao.de>
Co-authored-by: amm <amm@tutao.de>
Reviewed by jhm, abp, das.
The library is added to support training a spam classification model on
client. A custom rollupTensorFlow was created to only use the needed
methods on the final file, which also has multiple stubs which remove
code which is unwanted such as Requests.
Co-authored-by: jhm <17314077+jomapp@users.noreply.github.com>
Co-authored-by: abp <abp@tutao.de>
State colors don't use Material 3 color tokens, instead they are based
on outline_variant with varying alphas.
For whitelabel, we use the generated theme's outline_variant and the
same alpha values as the base theme.
Close#9744
Co-authored-by: ivk <ivk@tutao.de>
Co-authored-by: hrb-hub <hrb-hub@users.noreply.github.com>
We want to use offline storage (SQLite) for autosaved drafts as it will
allow the locally saved draft to be accessible when offline. This means
we refactor ConfigurationDatabase.
We still want to use the same encoding methods, as it provides a simple
way to put in data without having to worry about making some complex
schema.
Closes#9743
Co-authored-by: ivk <ivk@tutao.de>
Previously suspension handling was not working because SDK was
expecting the headers to be lowercased. This was not the case
for Swift impl of RestClient.
Additionally, fix logging errors from notification extension by
setting correct privacy modifier when interpolating.
Close#9740
Co-authored-by: hrb-hub <hrb-hub@users.noreply.github.com>
Caused by the shortcut being enabled when the `MailViewerViewModel` is
`null`, which happens because `!viewModel()?.isDraftMail()` is true when
the mail is not draft but also when the viewModel is null.
The same is true for the replyAll and forward shortcuts.
Close#9736