Commit Graph

66 Commits

Author SHA1 Message Date
Carlos Quintana a70baad478 Implement Alias Trash (#2417)
* wip: start implementing alias trash

* Added alias trash dashboard page

* test: delete_alias changes

* Format html

* fix: mailbox deletion

* feat: add delete_alias_action setting in dashboard settings

* chore: disable alias when trashing it

* Add restore tests

* Move tras/restore to alias_actions

* rename alias_actions to alias_delete

* Remove alias_actions

* Send events and alias audit log on alias restore

* feat: adapt queries to trashed alias

* chore: add metrics on alias trash actions

* fix: missing empty arg

* Add rate limit for restore and restore all

* fix: mailbox alias count

* feat: properly handle alias deletion for custom domain deletion

* chore: add error logs

* chore: update alias trash copy + change Trash location

* feat: make can_create_new_alias not take trashed aliases into account

* chore: update mailbox deletion dialog copy

---------

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2025-03-18 10:10:56 +01:00
Carlos Quintana 78aa169c10 feat: add monitoring to job runner (#2404)
* feat: add monitoring to job runner

* feat: add proper error handling in job runner

* chore: unify newrelic metric
2025-02-27 15:42:20 +00:00
Carlos Quintana b06f6dde76 refactor: move job names to enum in constants (#2401) 2025-02-26 16:52:49 +01:00
Carlos Quintana f5de78f2e1 chore: add query limit to job runner (#2399) 2025-02-26 10:05:55 +01:00
Carlos Quintana abdbbe98a2 feat: job runner priorities (#2394)
* feat: job runner priorities

* chore: remove duplicate index
2025-02-25 16:28:01 +01:00
Adrià Casajús 9c3f346280 Allow several job runners to run in parallel (#2281)
* Allow several job runners to run in parallel

* Fix test

* fix: job_runner

---------

Co-authored-by: Carlos Quintana <carlos.quintana@proton.ch>
2025-02-25 15:02:51 +01:00
Carlos Quintana ffb070cd19 chore: offer version in newrelic events (#2380)
* chore: offer version in newrelic events

* chore: send version event on startup and on other services
2025-02-05 10:09:52 +00:00
Adrià Casajús 062675207c Allow to select wether we want to send the deletion email when deleting a mailbox (#2335) 2024-11-28 11:31:11 +00:00
Adrià Casajús ccd687f091 Add job to send events to webhook (#2282)
* Add job to send events to webhook

* Apply comments

---------

Co-authored-by: Carlos Quintana <74399022+cquintana92@users.noreply.github.com>
2024-10-23 17:01:32 +02:00
Carlos Quintana 35f6e67053 feat: user audit log (#2266)
* 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
2024-10-16 16:57:59 +02:00
Carlos Quintana ed5e62d479 fix: custom_domain deleted error (#2245) 2024-10-02 09:45:54 +02:00
Carlos Quintana d0ba7675f0 chore: event changes (#2227)
* chore: change max_retries to 10

* chore: only send custom domain deleted event if it is not a partner domain

* chore: newrelic events metric names rename

* chore: emit failed events metric

* chore: migration for contact.flags and custom_domain.pending_deletion

* chore: mark custom_domain as pending_deletion when deleting it

* chore: add event type to metric
2024-09-19 16:20:56 +02:00
Carlos Quintana 737c561227 fix: specify default dispatcher in job runner (#2191) 2024-08-23 09:11:47 +02:00
Adrià Casajús 2d841e9bc0 Update render function to receive user always as a param (#2141)
* Update render function to receive user always as a param

(cherry picked from commit fb53632298b08ab40bb82b8c8724a0bf254b2632)

* Add user to the kwargs
2024-07-03 12:59:16 +00:00
Son Nguyen Kim 209ed65ebc Disable pgp onboarding proton mail (#2122)
* show app page

* Do not send onboarding PGP email to Proton mailbox

---------

Co-authored-by: Son NK <son@simplelogin.io>
2024-06-10 11:58:04 +00:00
Adrià Casajús 8a77a8b251 Create jobs to trigger sending all alias as create events (#2126)
* Create jobs to trigger sending all alias as create events

* Set events in past tense

* fix test

* Removed debug log

* Log messages
2024-06-07 13:36:18 +00:00
Son Nguyen Kim b487b01442 Fix format (#1554)
* after deleting an alias, user should stay on the same page

* fix email indentation
2023-01-25 13:16:29 +01:00
Adrià Casajús 81eb56e213 Tranfer aliases to a new mailbox when deleting mailboxes (#1534)
* Set up npm clean install instead of npm install in order to keep the version of npm packages 🎨

* Add option to transfer the alias to a new mailbox when a mailbox is deleted

* Moved alias transfer to job

* Lint

* Update forms

* Revert dockerfile change

Co-authored-by: ewen <ewen.coppens@a1.digital>
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2023-01-17 11:55:34 +01:00
Adrià Casajús 0284719dbb Fix: Remove * from a param (typo) (#1498)
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-12-19 11:45:04 +01:00
Adrià Casajús 9378b8a17d Fix: Return email in the get_communication_email always and search for the alias when needed (#1497)
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-12-19 09:23:53 +01:00
Adrià Casajús 73c0429cad Fix: Set oneclick link for unsubscribe of the newsletter for tx emails (#1465)
* Feat: Add unsub oneclick to the base transactional email template

* Format

* Removed unused

* Format

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-12-13 16:59:14 +01:00
Adrià Casajús 88dd07e48d Feature: Use new job status to retry killed jobs (#1130)
* Feature: Use new job status to retry killed jobs

* Set attermpts and time via config

* Update timing condition

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-07-01 11:14:53 +02:00
Adrià Casajús 5fa41d6ccf Add state management to job (#1113)
* Add state management to job

* Add migration

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-06-28 09:22:48 +02:00
Adrià Casajús fbb59a1531 Send welcome mail to proton created users (#1099)
* Send welcome mail to proton created users

* Skip import

* Use new logo

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-06-20 11:36:16 +02:00
Adrià Casajús 3d3d408a8f Fix: logic failed the onboarding-1 job (#1085)
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-06-14 09:00:52 +02:00
Adrià Casajús e688f04d6b Send full user report asynchronously on request (#1029)
* Send full user report asynchronously

* Fix test

* Filter some fields before exporting

* Fix: Domain -> CustomDomain

* format settings html

* not include RefusedEmail as they are not usable by user and are automatically deleted

* send the export to the user email

* change email and setting wording

* fix user can only export data once

* remove alias export section

* remove unused import

* fix flake8

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
Co-authored-by: Son <nguyenkims@users.noreply.github.com>
2022-06-07 10:45:04 +02:00
Son 08c7aa8b98 ignore smtp errors for onboarding emails 2022-01-03 10:01:56 +01:00
Son 335a89f912 enable email sending retry in job runner 2021-12-28 16:43:26 +01:00
Son d8a23ba9d3 fix email template 2021-11-15 11:55:22 +01:00
Son a99ac24b72 cron, init app, job runner: wrap in an app context to benefit from app setup like database cleanup, sentry integration, etc 2021-10-26 10:52:28 +02:00
Son ced31edda2 flake8 2021-10-13 11:52:41 +02:00
Son cfe88b5df2 use job system to delete domain 2021-10-13 11:43:44 +02:00
Son fbabe6fb44 use job system for deleting mailbox 2021-10-13 11:40:15 +02:00
Son eb0e327402 remove "with app.app_context():" 2021-10-12 14:47:01 +02:00
Son 372466ab06 do not use flask-sqlalchemy
- add __tablename__ for all models
- use sa and orm instead of db
- rollback all changes in tests
- remove session in @app.teardown_appcontext
2021-10-12 14:36:47 +02:00
Son b602f7e746 update send from alias video 2021-10-11 17:08:48 +02:00
Son Nguyen Kim 5ac78f2694 reformat 2021-09-08 11:29:55 +02:00
Son NK bdec7ff5e4 use info level for case user is deleted in the meantime 2021-05-24 11:10:17 +02:00
Son NK 7946879308 schedule account deletion 2021-04-23 11:50:26 +02:00
Son NK ac216e7a08 use create_light_app in job runner 2021-03-29 10:56:42 +02:00
Sylvia van Os e02d95216f Remove unused imports and var assignments 2021-03-13 15:46:12 +01:00
Sylvia van Os 44ae20816a WIP: Import test 2021-03-10 23:08:33 +01:00
Sylvia van Os 1915c8d09d Export and import mailbox info with alias 2021-03-09 21:09:58 +01:00
Son NK e9adb3270d use sanitize_email instead of .lower().strip().replace(" ", "") 2021-01-11 12:29:40 +01:00
Renaud Boyer 1fa64941c9 linitng 2020-12-06 11:25:41 +01:00
Son NK 85a1d67c6f put browser extension onboarding email to the welcome email 2020-10-22 11:46:15 +02:00
Son NK 677f150fef add unsubscribe header to com emails 2020-10-22 10:44:05 +02:00
Son NK c8e92af4d3 improve onboarding emails wordings 2020-09-30 11:53:07 +02:00
Son NK 85beb774c7 fix onboarding email 2020-09-12 15:51:43 +02:00
Son NK 09380915fb use user first alias to for onboarding emails 2020-09-12 14:33:27 +02:00