PRB: MAPI_W_PARTIAL_SUCCESS When Creating a Forward Rule

Last reviewed: February 3, 1998
Article ID: Q180200
The information in this article applies to:
  • Exchange Development Kit (EDK), version 5.0

SYMPTOMS

Creating rules to forward mail to other users is common. Forwarding rules created using HrStringToAction(), HrStringToRestriction(), and HrInsert() returns a MAPI_W_PARTIAL_SUCCESS on the HrInsert() even though the other two calls HrStringToAction() and HrStringToRestriction() complete successfully.

CAUSE

The restriction for a forwarding rule requires the FL_LOOSE flag. The address list that is part of the action structure is missing the PR_RECIPIENT_TYPE property.

RESOLUTION

Add the following code after the call to create the restriction:

   lpRes->res.resContent.ulFuzzyLevel =   FL_SUBSTRING |
                                          FL_IGNORECASE |
                                          FL_LOOSE;

Add the following code after the call to create the action:

   if (lpActs->lpAction->acttype == OP_FORWARD)
   {
      lpActs->lpAction[0].lpadrlist->aEntries->ulReserved1 = 1L;
      lpActs->lpAction[0].lpadrlist->aEntries->cValues += 1;
      lpActs->lpAction[0].lpadrlist->aEntries->
          rgPropVals[0].Value.MVbin.lpbin +=
          sizeof(SPropValue)/sizeof(SBinary);
      memset(&(lpActs->lpAction[0].lpadrlist->aEntries->
          rgPropVals[lpActs->lpAction[0].lpadrlist->
          aEntries->cValues-1]),254,sizeof(SPropValue));
      lpActs->lpAction[0].lpadrlist->aEntries->
          rgPropVals[lpActs->lpAction[0].lpadrlist->
          aEntries->cValues-1].ulPropTag = PR_RECIPIENT_TYPE;
      lpActs->lpAction[0].lpadrlist->aEntries->
          rgPropVals[lpActs->lpAction[0].lpadrlist->
          aEntries->cValues-1].Value.ul = MAPI_TO;
    }

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a restriction using HrStringToRestriction().

  2. Create an action using the HrStringToAction().

  3. Insert the rule into the rules table.

Keywords          : EDKAPI
Version           : WINDOWS:5.0
Platform          : WINDOWS
Issue type        : kbprb


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 3, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.