Commit Graph

55 Commits

Author SHA1 Message Date
Adrià Casajús 2eb5feaa8f
Small improvements (#2082)
* Update logs with more relevant info for debugging purposes

* Improved logs for alias creation rate-limit

* Reduce sudo time to 120 secs

* log fixes

* Fix missing object to add to the session
2024-04-08 15:05:51 +02:00
Adrià Casajús 7ec7e06c2b
Move alias transfer util outside the views to make it importable (#1855) 2023-08-31 13:42:44 +02:00
Adrià Casajús 689ef3a579
Check if the domain has a deleted alias (#1764)
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2023-06-01 17:33:58 +02:00
Spitfireap b849d1cfa7
Simpler csv export (#1383)
* Export alias in csv

* reformating

* template

* Improved contributing script and doc

* Updated test

* removed csv export from GDPR export archive

* added test for new route

* fix trailing space

* moved test to new utils file
2022-11-23 13:51:08 +01:00
Son Nguyen Kim a88a8ff2be
add more logging (#1223) 2022-08-09 10:01:55 +02:00
Adrià Casajús 1f040fcebc
PR comments 2022-04-28 18:43:10 +02:00
Adrià Casajús 8e35a09788
Add methods to check if alias will be auto-created 2022-04-28 15:10:38 +02:00
Son 845b53b03f not send emails to inform about an alias can't be created to disabled user 2022-04-28 12:10:40 +02:00
Son 841621dbe2 handle the case mailboxes is empty in try_auto_create_via_domain 2022-01-13 09:33:32 +01:00
Son 37bb7655d5 remove unused import 2022-01-06 15:30:33 +01:00
Son 9ff323c746 make sure to set custom_domain_id when creating a new alias 2022-01-06 15:29:37 +01:00
Son b7e8324e5a move get_custom_domain() to alias_utils 2022-01-06 15:20:09 +01:00
Son 33bd7dbcd6 refactor 2022-01-06 14:57:01 +01:00
Son de9f994fe2 check suffix in try_auto_create 2022-01-06 11:12:26 +01:00
Son 6cb55e27f3 make sure alias that starts with bounce prefix can't be automatically created 2022-01-05 15:16:04 +01:00
Son 01a8a0343e log when an alias is deleted 2021-12-31 11:18:08 +01:00
Son 79ca39a625 use regex_match instead of re.fullmatch() 2021-12-14 15:00:32 +01:00
Son 083b56b9a6 if user.disable_automatic_alias_note, do not add alias note 2021-10-23 18:24:28 +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 8301015afd do not use email_validator in get_email_domain_part() 2021-09-27 12:13:41 +02:00
Son Nguyen Kim 3443499ab9 add note for alias auto created with directory too 2021-09-22 09:45:42 +02:00
Son Nguyen Kim 1a32b654d0 refactor 2021-09-22 09:45:00 +02:00
Son Nguyen Kim 7674d8480e refactor: rename 2021-09-22 09:44:35 +02:00
Son Nguyen Kim ff1238a56f add alias note when auto creating alias via domain 2021-09-22 09:43:48 +02:00
Son Nguyen Kim 1d09d76cb2 use re2 instead of re to avoid ReDOS attack 2021-09-21 10:57:36 +02:00
Son Nguyen Kim e5a8ce1492 use AutoCreateRule instead of custom_domain.auto_create_regex when creating new alias 2021-09-20 18:29:36 +02:00
Son Nguyen Kim 005a760710 handle case catch_all is enabled but custom_domain.auto_create_regex is already set 2021-09-20 12:32:39 +02:00
Son Nguyen Kim 344f8e67d2 take into account custom_domain.auto_create_regex in try_auto_create_catch_all_domain() 2021-09-17 17:43:12 +02:00
Son Nguyen Kim 2b84168d68 validate address in try_auto_create 2021-09-17 17:42:16 +02:00
Son Nguyen Kim 5ac78f2694 reformat 2021-09-08 11:29:55 +02:00
Son NK 2f96322977 make sure BOUNCE_PREFIX_FOR_REPLY_PHASE can't be used as directory name or for creating aliases on-the-fly 2021-05-25 17:59:40 +02:00
Son NK ceacf8e3a7 support dot in alias prefix 2021-04-30 11:37:17 +02:00
Son NK 0e94c329d1 handle alias too long error 2021-01-11 15:45:41 +01:00
Son NK ce3dae2a07 inform user when an alias can't be created when a directory is disabled 2020-12-07 10:55:13 +01:00
Son NK 5b9dc88c67 make sure alias prefix cannot be more than 40 chars 2020-11-18 10:38:35 +01:00
Son NK a890557c7f Use check_alias_prefix() to check alias prefix 2020-11-03 10:39:08 +01:00
Son NK 5da7953a64 handle the case a directory alias is created concurrently 2020-10-23 11:55:01 +02:00
Son NK e79522b638 take into account Premium domains 2020-10-15 16:21:31 +02:00
Son NK 805e78cad1 rename email_belongs_to_alias_domains -> email_belongs_to_default_domains 2020-10-14 18:46:05 +02:00
Son NK ed2e748d1e sanitize envelope mail_from and rcpt_tos 2020-09-14 17:30:01 +02:00
Son NK 18263c2fd5 handle case alias already created in try_auto_create_catch_all_domain() 2020-09-14 12:18:15 +02:00
Son NK 77c67c5314 create aliases_for_mailbox() and nb_email_log_for_mailbox() 2020-08-30 19:56:45 +02:00
Son NK fdedc24358 black new version 2020-08-27 10:20:48 +02:00
Son NK eb6647d62e fix 2020-08-23 20:24:46 +02:00
Son NK 77bfa67402 fix delete_alias: do not use IntegrityError 2020-08-23 20:17:50 +02:00
Son NK 2cae0200a8 use delete_alias(alias,user) instead of Alias.delete, DomainDeletedAlias.create, DeletedAlias.create 2020-08-14 12:02:33 +02:00
Son NK 41e2283d93 domain catch-all alias belongs to domain mailboxes 2020-08-01 12:31:43 +02:00
Son NK 6437ee46e0 use LOG.exception instead of LOG.error to provide stacktrace 2020-07-17 12:59:07 +02:00
Son NK 83e540d1d4 Create directory alias with directory mailboxes 2020-06-05 22:30:32 +02:00
Son NK a4f8dc9c9d Use AliasInTrashError instead of DeletedAlias.get_by check when trying to create alias automatically 2020-05-23 19:45:26 +02:00