Skip to content

Commit

Permalink
exmdb: support OL-style public folder references in store_eid_to_user…
Browse files Browse the repository at this point in the history
… RPC
  • Loading branch information
jengelh committed Jan 10, 2024
1 parent 9c4c3cb commit 12add2a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
9 changes: 9 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Development 2.21.8
==================

Enhancements:

* twostep_ruleproc: support OL-style public folder references in
store_eid_to_user RPC


Gromox 2.21 (2024-01-08)
========================

Expand Down
1 change: 1 addition & 0 deletions exch/exmdb/common_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ E(get_user_lang)
E(get_timezone)
E(get_maildir)
E(get_homedir)
E(get_homedir_by_id)
E(get_id_from_username)
E(get_user_ids)
E(get_domain_ids)
Expand Down
1 change: 1 addition & 0 deletions exch/exmdb/listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static void *mdpls_thrwork(void *param)
NULL == common_util_get_timezone ||
NULL == common_util_get_maildir ||
common_util_get_homedir == nullptr ||
common_util_get_homedir_by_id == nullptr ||
NULL == common_util_get_id_from_username ||
NULL == common_util_get_domain_ids ||
ems_send_mail == nullptr) {
Expand Down
1 change: 1 addition & 0 deletions exch/exmdb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ static BOOL svc_exmdb_provider(int reason, void **ppdata)
E(common_util_get_domain_ids, "get_domain_ids");
E(common_util_get_maildir, "get_maildir");
E(common_util_get_homedir, "get_homedir");
E(common_util_get_homedir_by_id, "get_homedir_by_id");
E(common_util_get_id_from_maildir, "get_id_from_maildir");
E(common_util_get_id_from_homedir, "get_id_from_homedir");
E(common_util_get_id_from_username, "get_id_from_username");
Expand Down
15 changes: 10 additions & 5 deletions exch/exmdb/store2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <gromox/mapidefs.h>
#include <gromox/rop_util.hpp>
#include <gromox/tie.hpp>
#include <gromox/usercvt.hpp>
#include "db_engine.h"

using LLU = unsigned long long;
Expand Down Expand Up @@ -62,19 +63,23 @@ BOOL exmdb_server::store_eid_to_user(const char *, const STORE_ENTRYID *store_ei
char **maildir, uint32_t *user_id, uint32_t *domain_id)
{
unsigned int uid = 0, domid = 0;
enum display_type dt;
char md[256];
if (store_eid == nullptr || store_eid->pserver_name == nullptr)
return false;
if (store_eid->wrapped_provider_uid == g_muidStorePrivate) {
enum display_type dt;
if (!common_util_get_user_ids(store_eid->pserver_name, &uid, &domid, &dt) ||
!common_util_get_maildir(store_eid->pserver_name, md, std::size(md)))
return false;
} else {
unsigned int orgid;
if (!common_util_get_domain_ids(store_eid->pserver_name, &domid, &orgid) ||
!common_util_get_homedir(store_eid->pserver_name, md, std::size(md)))
} else if (store_eid->wrapped_provider_uid == g_muidStorePublic) {
std::string es_result;
if (cvt_essdn_to_username(store_eid->pmailbox_dn,
g_exmdb_org_name, cu_id2user, es_result) != ecSuccess ||
!common_util_get_user_ids(es_result.c_str(), &uid, &domid, &dt) ||
!common_util_get_homedir_by_id(domid, md, std::size(md)))
return false;
} else {
return false;
}
*maildir = common_util_dup(md);
*user_id = uid;
Expand Down

0 comments on commit 12add2a

Please sign in to comment.