* feat: set up UserAuditLog
* refactor: extract payment callbacks into their own files + handle subscription user_audit_log
* feat: handle account linking for user audit log
* chore: user_audit_log for mailboxes
* chore: user_audit_log for custom domains
* chore: user_audit_log for contacts
* chore: user_audit_log for directories
* fix: do not enforce cronjob being defined in choices + enable user deletion
* chore: user_audit_log for user deletion
* refactor: change emit_user_audit_log function to receive the full user object
* feat: add user_audit_log migration
* test: fix tests
* test: add some tests for user_audit_log
* fix: spf record verification user_audit_log
* chore: add missing index to user_audit_log.created_at
* chore: add missing index to alias_audit_log.created_at
* fix: improve MX and SPF domain handling
* fix: do not use get_instance function
* fix: legacy use of tuples instead of MxRecord
* refactor: rename partner custom domain variables
* Update render function to receive user always as a param
(cherry picked from commit fb53632298b08ab40bb82b8c8724a0bf254b2632)
* Add user to the kwargs
* add User.enable_data_breach_check column
* user can turn on/off the data breach check
* only run data breach check for user who enables it
* add tips to run tests using a local DB (without docker)
* refactor True check
* trim trailing space
* fix test
* Apply suggestions from code review
Co-authored-by: Adrià Casajús <acasajus@users.noreply.github.com>
* format
---------
Co-authored-by: Son NK <son@simplelogin.io>
Co-authored-by: Adrià Casajús <acasajus@users.noreply.github.com>
* Delete old email_log entries in batches to avoid table lock
* Avoid nested join
* Commiting after the batch delete
* Added statement count print
* Rename var
* Accounts to be scheduled to be deleted cannot receive emails or login
* Create model and create migration for user
* Add test for the cron function
* Move logic to one place
* Use the class name to call the static delete method
* Sanitize alias, contacts, mailboxes and users before creating them
* Updated comments and moved crons to run when load is low
* Run the stats at the same time as previously
---------
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
* Yield on big queries and check the trial is active in the query directly
* Eagerly load the hibp aliases to check
* Updated trial condition
* Also yield referral
---------
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
* Rate limit the sudo route
* Add missing indexes
* Updated index
* Update index creation to run with concurrent
* With autocommit block
---------
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
* remove unused email statuses
* add more logging
* use text_header if html_header not set
* improve email
* add a header about PGP failure when forward emails can't be encrypted
* remove unused email status
* Create a token to exchange for a cookie
* Added Route to exchange token for cookie
* add missing migration
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
* Send email to users with a subscription and a partner plan upgrade
* Update double-subscription-partner.html
* Update double-subscription-partner.txt.jinja2
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
Co-authored-by: Son Nguyen Kim <nguyenkims@users.noreply.github.com>