none
how to add email to blocked senders list using C++ Extended MAPI RRS feed

  • Question

  • We are able to access the junk email rule using the PidTagExtendedRuleMessageCondition property of Extended MAPI but unable to modify it to add a email id to blocked senders list.

    Can anyone please help us how to modify the PidTagExtendedRuleMessageCondition property using C++ Extended MAPI

    Monday, January 2, 2017 9:05 AM

All replies

  • Hello Prasoona,

    Have you tried using MFCMAPI (an open-source utility) for setting a property manually?

    Note, you can explore the required sample code easily in that case. See MFCMAPI demonstrates MAPI client code for more information.  


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Monday, January 2, 2017 7:39 PM
  • I am able to update the property but once we close and open the outlook it is not retaining the property value set using my program but it is setting to the one which is set in outlook.
    Thursday, January 5, 2017 6:38 AM
  • What code exactly do you have now?

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Saturday, January 7, 2017 10:32 PM
  • What is the exact problem that you are running into? Parsing the blob? Or corrupting it when saving?

    If using Redemption is an option, it exposes the RDOJunkEmailOptions that allows to add to the blocked senders list. The code is implemented using Extended MAPI.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, January 9, 2017 6:18 AM
  • We are not using Redemption.

    We are implementing using Extended MAPI and followed MS-OXCSPAM to update the property

    We are implementing Outllook addin which will update the safe senders and blocked senders list based on some logic. The addin is able to add email id to Safe Sender and Block Senders list by updating the property PR_EXTENDED_RULE_MSG_CONDITION but we are facing below issues

    • It is not visible in the UI, but property PR_EXTENDED_RULE_MSG_CONDITION is updated and appending and searching email id to the updated list till outlook is open. We are able to see the updated property correctly in MFCMAPI application.
    • Once Outlook was closed, the Property is not retaining the list

    Below are the option we used to update the property.

    lppProp->OpenProperty(ulPropTag, &IID_IStream, STGM_READWRITE | MAPI_UNICODE, MAPI_MODIFY, reinterpret_cast<LPUNKNOWN *>(&lpStmSource));

    lpStmSource->SetSize(size);

    lpStmSource->Write(m_lpsOutputValue->Value.bin.lpb, m_lpsOutputValue->Value.bin.cb, &bytesWritten);

    lpStmSource->Commit(STGC_DEFAULT);

    lpStmSource->Release();

    lppProp->SaveChanges(KEEP_OPEN_READWRITE);

    All the above functions are returning S_OK without any error and the property is also updated correctly. We are able to see it in MFCMAPI but it is not visible in UI and once outlook i closed it is not retaining the property and old value is seen in MFCMAPI aswell. Not sure if I am not using correct flags or what.

    Please advise on how we can reatain the property and make it visible in UI aswell. Please let me know if you need further information.

    Tuesday, January 10, 2017 5:41 AM
  • Hi,

    Since your issues is complicated, I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day! 

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 16, 2017 2:40 AM
    Moderator
  • Thanks

    Please update one you find some solution.

    Friday, January 20, 2017 6:36 AM