* Update render function to receive user always as a param
(cherry picked from commit fb53632298b08ab40bb82b8c8724a0bf254b2632)
* Add user to the kwargs
* 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
* 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
* 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>
* 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>
* Do not allow to use email alias as account email when linking
* Add missing status
* Remove TODO
* Also break contact as email loop
* Better test names
* Allow a reverse alias to send an email to an alias
* Ident fix
* Removed invalid test
---------
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
* Notify another mailbox about an email sent by a mailbox to a reverse alias
* keep reverse alias in CC and To header
* use alias as From to hint that the email is sent from the alias
* keep original subject, improve wording
* only add DKIM if custom domain has DKIM enabled
* replace any reverse alias by real address for all contacts
* improve logging
* fix comment
* Request contacts in batches of 100 to avoid loading the db
* Fix typo
* Added tests for the contact replacement
* Increase batch size to 1k
* Revert and use only reply_email and website_email
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
* remove TO header if it's set to "undisclosed-recipients:;"
more info on https://www.rfc-editor.org/rfc/rfc4356.txt
* remove unnecessary indentation character in plain text email
* remove unused email statuses
* add more logging
* use text_header if html_header not set
* improve email
* add a header about PGP failure when forward emails can't be encrypted
* remove unused email status
* origin/master: (29 commits)
PR comments
support "enabled" param in /api/v2/aliases
Update PGPy to 0.5.4 to allow for python 3.10
Also install libpq-dev
Fix python 3.10
Add methods to check if alias will be auto-created
PR comments
Allow sending messages in a background thread
Use the proper import for newrelic agent
not send emails to inform about an alias can't be created to disabled user
prevent disabled user from using the api
make sure disabled user can't create new alias
Put version version between " so it is 3.10 instead of 3.1
Add workflow for python 3.10
Remove it for all creds
Do not send the transports to the js part since we have not stored them previously
move help to menu on small screen
only show the help button on desktop
use another logo for mobile
add new parameter disabled in /GET /api/v2/aliases
...