Outlook Junk Mail Settings RRS feed

  • Question

  • I am working on an add-in that manages Outlook's Junk Mail settings. In both the blocked sender and safe sender lists it is possible to specify full email addresses (e.g. or domains (e.g., .  Blocked senders and domains are written to the PR_SPAM_JUNK_SENDERS_W (0x041A010F) property.  Similar behavior is followed for the safe sender's list and the safe recipient's list. For blocking, portions of domain names for substring matching ( e.g., xyz.) are written to property 0x0426010F.  In a non-Exchange environment the individual entries that appear in Outlook's UI lists are saved properties in a user's profile in one string that contains the semicolon delimited items sorted into what appears to be an ascending order.  The saved ordering of these semicolon delimited entries a profile is not the same as the order in which they appear in Outlook's UI or within my add-in's sorted listbox.

    I have tried sorting the entries of these lists by storing them as wstrings within a vector and then using the sort function on the vector.  I have tested by using wcscmp, _wcsicmp, lstrcmpi and CompareStringEx (with various settings) as the predicate for the sort function.  So far none of my testing has reliably replicated Outlook's behavior.

    Does anyone know how Outlook orders the semicolon delimited entries in the saved property strings? 
    Friday, May 1, 2015 2:36 PM

All replies

  • I don't think that anybody knows (except Outlook developers) how Outlook sorts the list in the UI.
    Friday, May 1, 2015 2:53 PM
  • Hi RLWA32,

    As Eugene said that, we don’t know how that data stored.

    On the other hand, based on my test in outlook 2013, the recipients order are the same as the UI displayed.



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 4, 2015 6:33 AM
  • Starain,

    Thank you for your reply.  The very first thing that I tried was to use a sorted listbox.  However, my testing discovered that Outlook does not use the sort order of addresses/domains that are displayed in the UI when it actually stores the data as semicolon delimited components of a string that as the profile property.  This is especially noticeable for any address/domain that contains other than alphanumeric characters .   For example, the domain "" is stored prior to the domain "" in the profile property but appears subsequent in a UI listobx.  That is why I have attempted to sort the addresses/domains outside of the UI.

    Monday, May 4, 2015 1:56 PM