785 Commits

Author SHA1 Message Date
Carlos Quintana 3f2f32691c feat: drop pgp keys and signatures on reply 2026-03-13 10:55:28 +01:00
Adrià Casajús 59e58878cb Increase mail limit 2026-02-03 16:43:05 +01:00
Adrià Casajús 55feb87bbc remove optional 2026-01-22 10:37:57 +01:00
Adrià Casajús 22f791605c Do not send duplicate notifications to different mailboxes when replying 2026-01-22 10:37:57 +01:00
Adrià Casajús c51c6d7f03 Do not sent notifications to disabled mailboxes or users 2026-01-21 12:04:37 +01:00
Adrià Casajús b324d77def Email sent to a disabled by admin mailbox goes to quarantine 2026-01-21 12:04:37 +01:00
Carlos Quintana db39c276eb feat: skip forwarding to admin-disabled mailboxes 2026-01-16 16:17:42 +01:00
Carlos Quintana 861119cfca fix: import in email_handler 2026-01-14 12:36:13 +01:00
Carlos Quintana f387089013 feat: use rust pgp 2026-01-14 12:36:13 +01:00
Adrià Casajús 300aeca0af Update log command 2025-11-07 11:37:19 +01:00
Adrià Casajús b0de3aa7b7 Stop replies if the aliases are trashed 2025-11-03 14:30:24 +01:00
chrisblech f43c86fcad fix: ruff-format 2025-10-14 16:15:28 +02:00
chrisblech da760f6d33 improve debugging: save bounces to (internal/unknown) transactional mails to disk 2025-10-14 16:15:28 +02:00
Adrià Casajús fc12e5204d Add main sentry trace to email handler 2025-06-18 12:46:34 +02:00
Adrià Casajús 2afb58d079 Set sentry trace configuration 2025-06-18 12:46:34 +02:00
Adrià Casajús 2871cf2a94 Update event dimensions 2025-06-16 19:15:39 +02:00
Carlos Quintana 93d270baf4 chore: change log messages for email_handler 2025-06-02 13:18:58 +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
Adrià Casajús bb4d51d6e0 Preserve List-ID (#2420) 2025-03-19 15:05:25 +01: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 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 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 3168cbd785 Manage parse_address error 2025-01-28 12:09:36 +01:00
Adrià Casajús 4865f0c281 Fix: allow reply-contact to be none 2025-01-27 12:51:29 +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 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 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
Carlos Quintana 8457a46cb3 Fix/none or object deleted crashes (#2295)
* fix: handle None-case when get_or_create contact

* chore: use already-calculated fields in order not to depend on the instance
2024-10-28 09:50:25 +01:00
Carlos Quintana bdb0c8bd08 feat: alias audit log (#2261)
* feat: alias audit log

* feat: crontab to delete old alias_audit_log entries

* Unified messages

---------

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2024-10-14 12:45:00 +02:00
Carlos Quintana 9bc0c7d24d chore: extract alias recipient name into function (#2252) 2024-10-08 12:48:53 +02:00
Adrià Casajús b59ca3e47c Move more contact creation logic to a single function (#2234)
* Move more contact creation logic to a single function

* Reordered parameters

* Fix invalid arguments
2024-09-27 16:04:32 +02:00
Adrià Casajús 38d377acb3 Extract contact creation logic to an external function (#2228)
* Extract contact creation logic to an external function

* PR comments
2024-09-20 10:11:57 +02:00
Adrià Casajús 025d4feba0 Sync on partner user creation + several fixes (#2214)
* Do not close session since it leads to orphan user object

* Redirect instead of render to avoid having to have a mailbox object

* On inital partner link/login trigger sync

* Update github action upload/artifact to v4

* Remove sys.exit used to test script locally

* Simplified script to update alias flags and note
2024-09-12 16:58:20 +02:00
Adrià Casajús 25022b4ad8 Several fixes (#2157)
* Ensure uploaded pictures are images and delete the previous ones

* Add CSRF protection to admin routes

* Only allow https urls in the client envs

* Close connection to try to get a new one

* Missing parameter

* start_time can be non existant. Set a default value
2024-07-18 12:48:18 +00:00
Carlos Quintana cccd65d93a fix: contact duplicate key (#2150) 2024-07-10 10:46:54 +00: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
Carlos Quintana 3e0b7bb369 Add sync events (#2113)
* feat: add protocol buffers for events

* chore: add EventDispatcher

* chore: add WebhookEvent class

* chore: emit events

* feat: initial version of event listener

* chore: emit user plan change with new timestamp

* feat: emit metrics + add alias status to create event

* chore: add newrelic decorator to functions

* fix: event emitter fixes

* fix: take null end_time into account

* fix: avoid double-commits

* chore: move UserDeleted event to User.delete method

* db: add index to sync_event created_at and taken_time columns

* chore: add index to model
2024-05-23 10:27:08 +02:00
Adrià Casajús 80c8bc820b Do not double count AlilasMailboxes with Aliases (#2095)
* Do not double count aliasmailboxes with aliases

* Keep Sl-Queue-id
2024-04-30 16:41:47 +02:00
Adrià Casajús 36cf530ef8 Preserve X-SL-Queue-Id (#2076) 2024-03-22 11:00:06 +01:00
Adrià Casajús f2fcaa6c60 Cleanup also messsage-id headers from linebreaks (#2067) 2024-03-18 14:27:38 +01:00
Adrià Casajús a7d4bd15a7 If the transactional_id is None do nothing 2024-03-04 17:47:06 +01:00
Adrià Casajús 565f6dc142 If there is no transactional id, skip it (#2047) 2024-03-04 17:44:19 +01:00
Adrià Casajús 97e68159c5 Fix: Never use NOREPLY to create contacts (#2039) 2024-02-27 09:29:53 +01:00
Adrià Casajús 173ae6a221 Allow to soft-delete users (#2034)
* Allow the possibility of soft-deleting users

* Unschedule for delete after link

* Add dry run to the cron
2024-02-22 17:38:34 +01:00
Adrià Casajús 31896ff262 Replace black and flake8 with ruff (#1943) 2023-11-21 16:42:18 +01:00
Son Nguyen Kim fd1744470b allow BCC (#1894)
Co-authored-by: Son NK <son@simplelogin.io>
2023-09-26 10:00:33 +02:00
Adrià Casajús 373c30e53b Schedule deletion of users (#1872)
* 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
2023-09-10 22:11:50 +02:00
Son Nguyen Kim 5714403976 Can use generic subject without pgp (#1847)
* improve wording for hide my subject option

* can use generic subject on a non-pgp mailbox

---------

Co-authored-by: Son NK <son@simplelogin.io>
2023-08-24 22:47:31 +02:00
Adrià Casajús 366631ee93 Limit length of contact names (#1837)
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2023-08-04 16:17:45 +02:00
Adrià Casajús 4bf925fe6f Revert contact creation (#1836)
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2023-08-04 14:01:21 +02:00