Commit Graph

42 Commits

Author SHA1 Message Date
Girish Ramakrishnan 58d66b5293 mail: resolve list members 2019-11-06 21:45:54 -08:00
Girish Ramakrishnan 7a96e4858a Not found messages at the db level 2019-10-24 20:48:38 -07:00
Girish Ramakrishnan 1a8496d61e Move MailError to BoxError 2019-10-24 14:10:23 -07:00
Girish Ramakrishnan 657a2cac2f Add pagination to mailbox listing 2019-10-22 10:12:06 -07:00
Girish Ramakrishnan 8af7dbc35a group -> list 2019-08-23 16:36:19 -07:00
Girish Ramakrishnan dfa61f1b2d rework how app mailboxes are allocated
Our current setup had a mailbox allocated for an app during app
install (into the mailboxes table). This has many issues:

* When set to a custom mailbox location, there was no way to access
  this mailbox even via IMAP. Even when using app credentials, we
  cannot use IMAP since the ldap logic was testing on the addon type
  (most of our apps only use sendmail addon and thus cannot recvmail).

* The mailboxes table was being used to add hidden 'app' type entries.
  This made it very hard for the user to understand why a mailbox conflicts.
  For example, if you set an app to use custom mailbox 'blog', this is
  hidden from all views.

The solution is to let an app send email as whatever mailbox name is
allocated to it (which we now track in the apps table. the default is in the
db already so that REST response contains it). When not using
Cloudron email, it will just send mail as that mailbox and the auth
checks the "app password" in the addons table. Any replies to that
mailbox will end up in the domain's mail server (not our problem).

When using cloudron email, the app can send mail like above. Any responses
will not end anywhere and bounce since there is no 'mailbox'. This is the
expected behavior. If user wants to access this mailbox name, he can
create a concrete mailbox and set himself as owner OR set this as
an alias.

For apps using the recvmail addon, the workflow is to actually create
a mailbox at some point. Currently, we have no UI for this 'flow'.
It's fine because we have only meemo using it.

Intuitive much!
2018-12-06 22:13:32 -08:00
Girish Ramakrishnan 37e16c7a4c Force owner type to be user 2018-12-06 13:00:57 -08:00
Girish Ramakrishnan 41b0c3242e Make function name clearer 2018-12-06 12:47:50 -08:00
Girish Ramakrishnan bf0dd935e5 mail: add type field 2018-04-07 21:29:44 -07:00
Girish Ramakrishnan b6335a327c Rename TYPE_* to OWNER_TYPE_* 2018-04-07 18:33:30 -07:00
Girish Ramakrishnan 605dc00422 mail: add members field for lists
we have to track the members of a list in the mail app separately
from groups. this is required because users can now have multiple
mailboxes. and because of that we cannot do a 1-1 mapping of group
members to mailboxes anymore. the ui is changed to select mailboxes
when creating a list.
2018-04-05 16:07:38 -07:00
Girish Ramakrishnan 2c8fa01d6d mail: split the functions to add list and mailbox 2018-04-05 15:01:28 -07:00
Girish Ramakrishnan f8a731f63a Add routes to change the mailbox and list owner 2018-04-03 14:12:43 -07:00
Johannes Zellner 045ea4681a Do not return an error on mailinglist listing if none exists
We usually return the empty array, to avoid the need for specific error
handling
2018-04-01 21:51:56 +02:00
Girish Ramakrishnan bcf3e71979 Add API to remove mailboxes by domain 2018-02-11 01:18:29 -08:00
Johannes Zellner d95a670dd7 Add mailing lists routes and logic 2018-01-26 11:25:45 +01:00
Girish Ramakrishnan f93963540e Add maildb
also, migrate values from settings table to maildb
2018-01-20 23:47:08 -08:00
Johannes Zellner 14d575f514 Make mailboxdb aware of domain field 2017-11-20 20:01:50 +01:00
Girish Ramakrishnan 0a8adaac9f filter out empty usernames from groups
Fixes #472
2017-11-06 11:09:40 -08:00
Girish Ramakrishnan 444ca1888b remove dead comment 2017-03-20 15:14:06 -07:00
Girish Ramakrishnan 330c9054b4 add/del/update user mailbox as part of transaction 2017-02-14 10:42:32 -08:00
Johannes Zellner 4bad31f7cc Skip mailbox update if name has not changed 2016-12-15 16:57:29 +01:00
Johannes Zellner d1161b3ff8 Add mailboxdb.updateName() 2016-12-15 16:57:29 +01:00
Girish Ramakrishnan 10ff0f559c Show error if mailbox already exists 2016-09-28 12:00:05 -07:00
Girish Ramakrishnan a78e17b036 Do not return aliases as mailboxes 2016-09-28 10:26:41 -07:00
Girish Ramakrishnan 20708ad25a return members of mailing list 2016-09-27 16:27:22 -07:00
Girish Ramakrishnan bd2848932e test ldap mailing list search 2016-09-27 15:56:02 -07:00
Girish Ramakrishnan 0d3169c787 remove mailboxdb.listGroups 2016-09-27 12:51:33 -07:00
Girish Ramakrishnan 9d9278b6f2 s/by/for 2016-09-26 14:02:23 -07:00
Girish Ramakrishnan 55b80ac81f update mailbox on username change 2016-09-25 23:51:39 -07:00
Girish Ramakrishnan 1f1f56b431 Fix mailboxdb API 2016-09-25 23:21:55 -07:00
Girish Ramakrishnan baa2dbbf39 Add alias and list ldap routes 2016-09-25 21:34:52 -07:00
Girish Ramakrishnan 4b34f823a7 implement ldap mailbox get 2016-09-25 16:46:11 -07:00
Girish Ramakrishnan c158548c19 remove ununsed mailboxdb.getAll 2016-09-25 16:46:08 -07:00
Girish Ramakrishnan 2b1a94dc8d Add mailboxdb.getByOwnerId 2016-09-23 17:35:48 -07:00
Girish Ramakrishnan 49baad349c remove mailbox routes and move it to users 2016-09-23 15:45:40 -07:00
Girish Ramakrishnan 00ee2eea39 Remove code to push aliases
The mail-addon will query via LDAP
2016-09-23 15:14:07 -07:00
Girish Ramakrishnan 1d77c42269 Add ownerId to mailbox fields 2016-09-22 15:51:57 -07:00
Girish Ramakrishnan 3ee9f70113 return alias info in mailbox response 2016-05-29 23:14:24 -07:00
Girish Ramakrishnan ce927bfa22 alias
also remove id since it's not useful for mailbox case (not like
mailbox can be renamed and we need a fixed it)
2016-05-27 22:20:08 -07:00
Girish Ramakrishnan f735fd8172 add mailboxes tests 2016-05-27 17:43:25 -07:00
Girish Ramakrishnan 77457d1ea9 initial mailbox db and model code 2016-05-27 10:36:47 -07:00