none
Is it possible to efficiently search for all mail with inline images using EWS? RRS feed

  • Question

  • It is easy enough to search for mails that have 'real' attachments.

    And I can iterate through all emails and test each for html body, and if html, check for isinline in the attachment collection.

    But I would rather like to reduce the number of emails returned from an EWS mail item Search to just those that have inline images.  Is this possible?

    I am struggling to find what properties I can effectively use in a search.  Is there a way to obtain the complete set of attributes/properties that can be used in a search expression?

    And there are different ways to perform searches as well
      AQS Search String [only limited search fields?]
    vs SearchFilter.IsEqualTo([?BodyType?], [?is html type?])

    so confusing!


    Merlin Beedell

    Wednesday, October 5, 2016 12:50 PM

All replies

  • You could try using the smartnoAttach property https://msdn.microsoft.com/en-us/library/bb821024(v=office.12).aspx in a searchfilter eg

                ExtendedPropertyDefinition SmartNoAttach = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Common, 0x8514, MapiPropertyType.Boolean);
                SearchFilter sf23 = new SearchFilter.IsEqualTo(SmartNoAttach,true);

    The problem with that is your going to get a lot message returned that has a rich signatures because inline attachments are most commonly used with this.

    With SearchFilters I would suggest you use a Mapi editor like OutlookSpy or MFCMapi to see what properties are available to filter on. For AQS there's a full list of indexed properties https://technet.microsoft.com/en-us/library/jj983804(v=exchg.150).aspx 

    Cheers
    Glen

    Thursday, October 6, 2016 1:28 AM
  • Thank you very much.

    I will spend some time re-coding the current AQS Search, which is too basic (I believe) to support this level of search.  If it works then I will post an update.

    I think it would be useful for the MS documentation to point devs at this sort of information!

    Merlin


    Merlin Beedell

    Friday, October 7, 2016 8:20 AM