Commit graph

730 commits

Author SHA1 Message Date
Adrià Casajús
e8575f5853 Add tests 2025-07-28 15:33:20 +02:00
Adrià Casajús
2946ff6707 Moved custom domains check to its own module and close session after every loop 2025-07-23 08:19:24 +02:00
Adrià Casajús
794bb28990 Added missing eager loading 2025-07-23 08:19:24 +02:00
Adrià Casajús
3b2f0eb44e Add method to check if alias is created from partner 2025-06-16 14:54:10 +02:00
Adrià Casajús
71330c7703 Move unmark to abuser file 2025-06-16 13:16:29 +02:00
Bohdan Shtepan
4975c89066
SL abuser system improvements (#2494)
* IDTEAM-4828: Allow to search abuser by user id not just by email.

* IDTEAM-4827: Add abuser admin logs to abuser page.

* IDTEAM-4826: Run the abuser bundle generation in a job with low prio.
2025-06-11 10:53:34 +02:00
Bohdan Shtepan
deafb529fa
feat: added abuser utils for main abuser (un)archiving flows. (#2468)
* feat: added abuser utils for main abuser (un)archiving flows.

* feat: update the abuser utils to use external secrets in conjuction with HMAC; add abuser audit log.

* fix: revert the DB_URI part.

* feat: address feedback.

* feat: address feedback.

* feat: address feedback.

* feat: address feedback.

* feat: address feedback.
2025-05-19 14:59:50 +02:00
Carlos Quintana
b13a07bd6b
fix: commit alias deletion on API + add filter on trashed aliases in api (#2470) 2025-05-15 08:34:21 +00:00
Adrià Casajús
f7882e971e fix: use the domain part of the domain to check if it is a proton addrss 2025-05-14 11:02:47 +02:00
Carlos Quintana
a3d7732ed8
test: skip apple payment test (#2457) 2025-05-07 16:39:09 +02:00
Carlos Quintana
b4945bde33
feat: add job to schedule subscription sync (#2443) 2025-04-30 10:08:11 +02:00
Carlos Quintana
0e95f3d047
feat: allow to limit max email recipients (#2436)
* feat: allow to limit max email recipients

* Set cmake min version

---------

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2025-04-14 16:03:02 +02:00
Carlos Quintana
c7cbc7a4c8
chore: update error message alias custom domain (#2432) 2025-04-04 12:36:59 +02:00
Carlos Quintana
7a707bdb6d
fix: trash custom domain alias deletes it (#2429)
* fix: trash custom domain alias deletes it

* chore: remove redundant commits
2025-03-27 16:33:49 +01:00
Carlos Quintana
9e8ee6467c
fix: only allow api_to_cookie if is for same user (#2423) 2025-03-20 15:45:24 +01:00
Adrià Casajús
3962ab5fb0
Preserve Unsubscribe header and create one that always unsubs via alias (#2419)
* Preserve original unsubs

* Preserve original behaviour in an extra header
2025-03-19 10:59:18 +01:00
Carlos Quintana
84364a1684
feat: alias restore check quota (#2418)
* feat: alias restore check quota

* Update app/dashboard/views/alias_trash.py

Co-authored-by: Adrià Casajús <acasajus@users.noreply.github.com>

* Update app/dashboard/views/alias_trash.py

Co-authored-by: Adrià Casajús <acasajus@users.noreply.github.com>

---------

Co-authored-by: Adrià Casajús <acasajus@users.noreply.github.com>
2025-03-18 11:05:09 +00:00
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
352be83839
deps: update flask-limiter and redis deps (#2406) 2025-03-04 09:48:38 +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
59957ec08b
chore: fix regex warnings on python 3.12 (#2400)
* deps: update some dependencies to fix warnings

* chore: move from sl.local to sl.lan for local development

* fix: mark string as regex

* chore: move facebook import to handler so its not global

* test: fix tests

* style: lint fixes

* test: move all .test and .local to .lan

* ci: do not use setup-python in lint
2025-02-26 15:41:50 +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
Adrià Casajús
7e77afa4fc
Fix: if there's an expired manual sub, extend it (#2393) 2025-02-21 14:44:31 +01:00
Adrià Casajús
869ea8bd7d
Set mailbox verified on pre-verified email change 2025-02-11 10:53:21 +01:00
Adrià Casajús
da93431df8
Clear new_email on verified email change (#2383) 2025-02-06 10:27:35 +01:00
Adrià Casajús
e17ae4210b
Proper check of mx domains (#2382)
* Proper check of mx domains

* Moved proton servers to config

* Added function

* Make sure we have a global dns

* Typo
2025-02-05 14:28:08 +01:00
Adrià Casajús
8d8ca3312a
Send event on account unlink (#2379)
* Send event on account unlink

* Move unlink to its own module
2025-02-05 09:44:42 +00:00
Adrià Casajús
b0a94acaba
Handle the case for duplicate new_email (#2378) 2025-02-04 15:35:14 +00:00
Adrià Casajús
91e614ab50
Do not allow lifetime coupons for lifetime partneri (#2376) 2025-02-03 11:20:12 +01:00
Adrià Casajús
a609b3b312
Multi domain check (#2372)
* Accept partner and sl domains

* fix

* Fix html

* properly calculate mx_domains

* Improve custom domain admin template

* reformat
2025-01-31 16:36:35 +00:00
Carlos Quintana
ff79fa020f
feat: index cleanup and add missing ones (#2369)
* feat: index cleanup and add missing ones

* chore: remove case in favour of greatest in query

* fix: do not remove mailbox->user index

* Fix test due to random ordering

* Create rollback

* Bad syntax

* fix order also

* test: fix ordering

* fix: ordering on mailboxes

---------

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2025-01-31 10:50:33 +01:00
Adrià Casajús
c14d7e2098
Handle multiple emails in reply-to header (#2365) 2025-01-24 10:20:50 +00:00
Adrià Casajús
f4b56788d7
Extract mailbox email change into an util (#2366)
* Extract mailbox email change into an util

* Update validation mailbox

* Add tests

* extract mailbox cancel

* Use simple field
2025-01-24 10:16:04 +00:00
Adrià Casajús
f232a2af89
Refactor coupon management and send proper events (#2363)
* Refactor coupon management and send proper events

* Refactor coupon management and send proper events

* Add missing case

* Updated with comments

* Use model table names

* renamed tablename to table

* Use sqlalchemy
2025-01-23 12:36:13 +01:00
Adrià Casajús
864b5d13ff
Two fixes (#2357)
* Preserve the flags when creating the user from the partner and do not deliver if user is pending deletion

* Fix test
2025-01-15 15:50:28 +00:00
Adrià Casajús
2387d30caa
Sanitize the mailbox email before creating it 2024-11-28 17:29:44 +01:00
Adrià Casajús
24987649a9
Add test 2024-11-28 12:32:42 +01:00
Adrià Casajús
0f8408b99c
Add support for more Received header formats to extract the queue id (#2333) 2024-11-28 11:11:53 +00:00
Adrià Casajús
14137326e9
Allow to use header from if domain is aligned with envelope (#2332)
* Use the mail_from when receiving a mail to the reverse alias if the domain is aligned with the VERP email

* Extracted function to a different file
2024-11-27 15:43:45 +00:00
Adrià Casajús
665c01d710
Add lifetime in partner subscriptions (#2331)
* Add lifetime in partner subscriptions

* Add lifetime display

* Fixed change
2024-11-27 11:05:03 +00:00
Adrià Casajús
dd2cfaea8b
Try to catch the race condidion when creating the user with a partner (#2320) 2024-11-14 09:54:13 +01:00
Adrià Casajús
813de9d40b
Fix: If the alias is created for a partner domain, mark it as partner created (#2312) 2024-11-08 12:04:28 +01:00
Carlos Quintana
a8ca2d3d37
revert: userid storing on deleted alias (#2305) 2024-11-06 11:24:54 +00:00
Carlos Quintana
31c8a766be
feat: preserve user id on alias deleted (#2304) 2024-11-06 09:16:54 +00:00
Adrià Casajús
7295a2052f
Mark if a verification code has been deleted (#2290) 2024-10-25 08:29:33 +00:00
Carlos Quintana
d65994c3c6
fix: missing None check on alias contacts api (#2288) 2024-10-24 07:50:35 +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
Adrià Casajús
9646f84b79
Only send new alias events on user creation (#2285)
* Only send new alias events on user creation

(cherry picked from commit ab8f998dd40dc83c8f8a528a156ba50eae376aaf)

* Trigger a sync when a new partner user is created

* Improve tests

* Move it to the partner_utils

---------

Co-authored-by: Carlos Quintana <74399022+cquintana92@users.noreply.github.com>
2024-10-23 11:18:03 +02:00