EWS java check if email is encrypted

By : Lucky
Source: Stackoverflow.com
Question!

I'm trying to figure out if there is a way to check if the email or part of email is encrypted so that I can return the email. According to this link.

https://technet.microsoft.com/en-us/library/dn569286.aspx

The different types of email encryption options in Office 365 including Office Message Encryption (OME), S/MIME, Information Rights Management (IRM).

I sent one email from my outlook making it confidential, I can see the email body saying This message has been marked as Confidential. You've received an encrypted message from [email protected]

To view your message

Save and open the attachment (message.html), and follow the instructions.

Sign in using the following email address: [email protected] Message encryption by Microsoft Office 365

When I loaded the content of the email message, in the content I found this

X-MS-Exchange-OMEMessageEncrypted: true

emailMessage.load(new PropertySet(EmailMessageSchema.MimeContent));

is there a way to get to this property of the email message. because the property getItemClass is just returning this.stack overflow question saying we can check this property

emailMessage.getItemClass() -IPM.Note
By : Lucky


Answers

For RMS/IRM messages you can check the PidNameContentClass property https://msdn.microsoft.com/en-us/library/office/cc839681.aspx which on RMS messages gets set to rpmsg.message. You can access this as an Extended property eg

ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders,"content-class",MapiPropertyType.String);



There is a way to make CMake only include one -fopenmp. CMAKE_CXX_FLAGS is a string that you can search for substrings. You can conditionally add -fopenmp based upon whether you find it already in CMAKE_CXX_FLAGS. Assuming that you were careful not to already add it twice, then you can use the following check to see if you need to add it.

# find "-fopenmp"
string(FIND ${CMAKE_CXX_FLAGS} "-fopenmp" FLAG_INDEX)
# check if we found it
if (FLAG_INDEX GREATER 0)
   message(STATUS "WE'VE GOT AT LEAST ONE!")
else()
   message(STATUS "WE'VE GOT NONE; ADD IT!")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
endif()

Just to be safe you could remove all instances of -fopenmp and then add it back in.

# remove all occurrences of "-fopenmp"
string(REPLACE "-fopenmp" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})


You need a logical condition in the while. Perhaps

program.toUpperCase().equals("Y")
By : nicomp


This video can help you solving your question :)
By: admin