return MAPI_E_TOO_COMPLEX;
}
- /* FIXME: We only support PR_ANR */
+ /* FIXME: We only support a very few query types */
res_prop = (struct PropertyRestriction_r *)&(restriction->res.resProperty);
- if ((res_prop->ulPropTag != PR_ANR) && (res_prop->ulPropTag != PR_ANR_UNICODE)) {
+ if ((res_prop->ulPropTag == PR_ANR) || (res_prop->ulPropTag == PR_ANR_UNICODE)) {
+ /* Ambiguous name resolution */
+ recipient = (res_prop->ulPropTag == PR_ANR) ?
+ res_prop->lpProp->value.lpszA :
+ res_prop->lpProp->value.lpszW;
+
+ ret = ldb_search(emsabp_ctx->samdb_ctx, emsabp_ctx->mem_ctx, &res,
+ ldb_get_default_basedn(emsabp_ctx->samdb_ctx),
+ LDB_SCOPE_SUBTREE, recipient_attrs,
+ "(&(objectClass=user)(sAMAccountName=*%s*)(!(objectClass=computer)))",
+ recipient);
+ } else if ((res_prop->ulPropTag == PR_ACCOUNT) || (res_prop->ulPropTag == PR_ACCOUNT_UNICODE)) {
+ const char *account_name = (res_prop->ulPropTag == PR_ACCOUNT) ? res_prop->lpProp->value.lpszA : res_prop->lpProp->value.lpszW;
+ DEBUG(5, ("* [%s:%d][%s] account name: %s\n", __FILE__, __LINE__, __FUNCTION__, account_name));
+ ret = ldb_search(emsabp_ctx->samdb_ctx, emsabp_ctx->mem_ctx, &res,
+ ldb_get_default_basedn(emsabp_ctx->samdb_ctx),
+ LDB_SCOPE_SUBTREE, recipient_attrs,
+ "(&(objectClass=user)(sAMAccountName=%s)(!(objectClass=computer)))",
+ account_name);
+ } else {
+ /* another query type */
+ DEBUG(0, ("! [%s:%d][%s] real lookup not supported yet\n", __FILE__, __LINE__, __FUNCTION__));
return MAPI_E_NO_SUPPORT;
}
-
- recipient = (res_prop->ulPropTag == PR_ANR) ?
- res_prop->lpProp->value.lpszA :
- res_prop->lpProp->value.lpszW;
-
- ret = ldb_search(emsabp_ctx->samdb_ctx, emsabp_ctx->mem_ctx, &res,
- ldb_get_default_basedn(emsabp_ctx->samdb_ctx),
- LDB_SCOPE_SUBTREE, recipient_attrs,
- "(&(objectClass=user)(sAMAccountName=*%s*)(!(objectClass=computer)))",
- recipient);
if (ret != LDB_SUCCESS) {
return MAPI_E_NOT_FOUND;