Commit Graph

61 Commits

Author SHA1 Message Date
Adrià Casajús
da09db3864
Do not allow free users to create reverse alias to reduce abuse (#2013)
* Do not allow free users to create reverse alias to reduce abuse

* Update format

* Move function under user

* Update tests
2024-01-16 14:51:01 +01:00
Adrià Casajús
6e4f6fe540
Sanitize alias, contacts, mailboxes and users before creating them (#1829)
* 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>
2023-08-03 10:20:25 +02:00
Adrià Casajús
bec8cb2292
Alias domain as contact domain (#1689)
* Use the alias domain for contacts

* Check there are not duplicate emails

* Check also in trash

* Use helper

* Set VERP for the forward phase to the contact domain

* Add pgp_fingerprint as index for contacts

* Removed check trash

* Only use reply domains for sl domains

* Configure via db wether the domain can be used as a reverse_domain

* Fix: typo

* reverse logic

* fix migration

* fix test

---------

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
Co-authored-by: Son <nguyenkims@users.noreply.github.com>
2023-04-20 12:14:53 +02:00
Adrià Casajús
7f9ce5641f
Feat: Added parallel limiter to prevent sqlalchemy transaction issues (#1360)
* Feat: Added parallel limiter to prevent sqlalchemy transaction issues

* Remove logs

* Moved initialization to its own file

* Throw exception

* Added test

* Add redis to gh actions

* Added v6 to the name

* Removed debug prints

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-10-27 10:07:02 +02:00
Adrià Casajús
d324e2fa79
Fix: Add csrf verification to directory updates (#1358)
* Fix: Add csrf verification to directory updates

* Update templates/dashboard/directory.html

* Added csrf for delete account form

* Fix tests

* Added CSRF check for settings page

* Added csrf to batch import

* Added CSRF to alias dashboard and alias transfer

* Added csrf to contact manager

* Added csrf to mailbox

* Added csrf for mailbox detail

* Added csrf to domain detail

* Lint

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-10-27 10:04:47 +02:00
Adrià Casajús
bcd4383e05
Sanitize the highlight contact id (#1160)
* Sanitize also parameter

* Formatting

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-07-15 17:48:42 +02:00
Adrià Casajús
67be5ba050
Enforce int params in routes (#1159)
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-07-15 17:10:00 +02:00
Adrià Casajús
52cd9d2692
Simplify condition 2022-05-12 19:02:06 +02:00
Adrià Casajús
75dd20ebcc
Fix condition 2022-05-12 19:01:04 +02:00
Adrià Casajús
0c896100a4
Update html 2022-05-12 18:46:42 +02:00
Adrià Casajús
bfb1ae6371
PR comments 2022-05-12 18:42:16 +02:00
Adrià Casajús
39b035a123
Added docs 2022-05-12 18:36:12 +02:00
Adrià Casajús
9066116b7e
Simplified method 2022-05-12 18:33:13 +02:00
Adrià Casajús
4d07bc9d31
Moved global flag to config 2022-05-12 18:30:46 +02:00
Adrià Casajús
caff70ea38
Set global config to enable/disable feature 2022-05-12 16:35:51 +02:00
Adrià Casajús
5dde39eb37
Prevent free users from creating reverse-alias 2022-05-12 13:20:05 +02:00
Son
1bdae7fbe8 handle CannotCreateContactForReverseAlias when user creates a new contact 2022-01-07 10:47:36 +01:00
Son
ad622df071 make sure a contact with website_email=reverse alias of another contact can't be created 2022-01-07 10:04:12 +01:00
Son
b0822519eb only show the navigation arrow when #contacts > PAGE_LIMIT 2021-10-23 16:08:43 +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 Nguyen Kim
e5a388dffb optimize import 2021-09-10 17:37:33 +02:00
Son Nguyen Kim
61d9f7ee43 refactor 2021-09-10 17:31:29 +02:00
Son Nguyen Kim
3ad4b6b76f use flanker instead of parseaddr_unicode 2021-09-10 17:06:38 +02:00
Son Nguyen Kim
55dcd63654 support search on contact page 2021-07-14 18:57:25 +02:00
Son Nguyen Kim
aa799fa339 Revert "Do not return contact alias activity on the contact manager page"
This reverts commit 45891bed36.

# Conflicts:
#	app/dashboard/views/alias_contact_manager.py
2021-07-14 17:21:07 +02:00
Son Nguyen Kim
b98e913304 fix contact page 2021-07-13 22:25:53 +02:00
Son Nguyen Kim
45891bed36 Do not return contact alias activity on the contact manager page 2021-07-13 19:27:45 +02:00
Son NK
09d00df363 reformat imports 2021-06-27 17:50:36 +02:00
Son NK
e9adb3270d use sanitize_email instead of .lower().strip().replace(" ", "") 2021-01-11 12:29:40 +01:00
Son Nguyen Kim
bf139f83b3
Merge pull request #342 from herrboyer/linting
Linting
2020-12-07 17:45:50 +01:00
Renaud Boyer
5d948faf56 black 2020-12-06 22:11:58 +01:00
Son NK
ce2d68a64d take into account include_sender_in_reverse_alias when creating reverse-alias 2020-12-06 19:37:20 +01:00
Renaud Boyer
7bac9e82b9 linting 2020-12-06 18:04:29 +01:00
Son NK
319078fceb use contact email when generating reply-email 2020-11-18 10:24:39 +01:00
Son NK
75ba1669e0 Create generate_reply_email() and refactor 2020-11-16 19:15:09 +01:00
Son NK
a989545505 make sure alias contact address is valid 2020-11-03 11:13:43 +01:00
Son NK
04a418e655 fix contact name always converted to lowercase 2020-11-03 11:11:55 +01:00
Son NK
9fafddd603 use is_valid_email instead of regex 2020-11-03 11:11:09 +01:00
Son NK
299f7d3fba remove unnecessary sanitize 2020-09-14 17:58:15 +02:00
Son NK
e291a71037 fix duplicate contact on contact page 2020-09-14 11:38:01 +02:00
Son NK
fdedc24358 black new version 2020-08-27 10:20:48 +02:00
Son NK
f213469e9f display nb-reply, nb-forward on alias contact page 2020-08-26 11:45:07 +02:00
Son NK
4ee38823b8 make sure to strip and lower email 2020-06-11 23:35:24 +02:00
Son NK
c47fb44c1e Pagination for contact page 2020-05-23 22:34:46 +02:00
Son NK
ca6350cc27 optimize import in all files 2020-04-25 13:49:39 +02:00
Son NK
2619333cc6 remove uses of website_from 2020-04-05 15:39:48 +02:00
Son NK
fbcac59c7f Set contact name when adding contact via contact manager 2020-04-05 12:29:00 +02:00
Son NK
9c22bf479a rename 2020-04-05 12:19:37 +02:00
Son NK
5ff8ae00e5 only lower the email part when creating new contact 2020-04-02 21:30:36 +02:00
Son NK
7f85ec30bd Improve contact manager: lowercase the contact address before adding 2020-04-01 20:31:47 +02:00