Hi,
How to identify an incoming IRM (encrypted) email in outlook. Is there any specific activity to identify?
TIA,
Ramya A
Hi,
How to identify an incoming IRM (encrypted) email in outlook. Is there any specific activity to identify?
TIA,
Ramya A
Can you pls check below link , might be helpful,
https://stackoverflow.com/questions/77500677/how-to-recognize-signed-encrypted-mails-in-outlooks
Happy Automation
Get Outlook Mail Messages: Retrieve the mail messages.MailMessage Properties:MailMessage object..Properties collection. For IRM, you’re looking for an internal property that indicates rights management. The most reliable is often a property related to permissions.MailMessage.PermissionTemplateID: This is a key property for IRM-protected emails. If it has a value (i.e., not null or empty), the email is likely IRM-protected.MailMessage.IsRestricted (Less common, but can exist): Some versions or scenarios might expose a boolean IsRestricted property.MailMessage.PropertyAccessor for MAPI Properties: For more advanced cases, you can use MailMessage.PropertyAccessor.GetProperty() with specific MAPI property tags that indicate IRM. This is more technical. A common MAPI property for IRM is http://schemas.microsoft.com/mapi/proptag/0x0078001E (PR_CURRENT_VERSION_NAME_IRMLOC).class Program
{
static void Main()
{
Application app = new Application();
NameSpace ns = app.GetNamespace(“MAPI”);
MAPIFolder inbox = ns.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
Items items = inbox.Items;
foreach (object item in items)
{
if (item is MailItem mail)
{
if (mail.IsIRMProtected)
{
Console.WriteLine("IRM Email Found: " + mail.Subject);
}
}
}
}
}