Query like:
select Id, Body, isRichText, Title, Type from CaseFeed where ParentId = ‘50090000008cXoS’
where
If Type = ContentPost, then it is an attachment. Then check for ContentType of the file
if(contenttype ==’image/jpeg’ || contenttype==’image/png’ || contenttype==’image/gif’ || contenttype==’image/jpg’ ){ … }
If isRichText = True, parse the body to check for email ids.
