private static bool IsSignatureRtf(Attachment attachment)
 {
     dynamic field = attachment.get_Fields(PR_ATTACH_METHOD);
     if ((field != null) && ((int) field == ATTACH_OLE))
     {
         try
         {
             // Only allow file types we DON'T clean to be signatures.
             if (FileTypeBridge.GetSupportedFileType(attachment.FileName) == FileType.Unknown)
             {
                 Logger.LogInfo(string.Format("Signature {0} on Rtf formatted message", attachment.FileName));
                 return true;
             }
         }
         catch (Exception)
         {
             // When the mail format is rtf you are unable access the filename property of embedded images.
             return true;
         }
     }
     return false;
 }
        private static bool IsSignatureHtml(Attachment attachment)
        {
            dynamic id = attachment.get_Fields(PR_ATTACH_CONTENT_ID);
            dynamic idw = attachment.get_Fields(PR_ATTACH_CONTENT_ID_W);

            string contentId = string.Empty;
            if (id != null)
            {
                contentId = id.ToString();
            }
            string contentIdw = string.Empty;
            if (idw != null)
            {
                contentIdw = idw.ToString();
            }
            if (!string.IsNullOrEmpty(contentId) || !string.IsNullOrEmpty(contentIdw))
            {
                // Only allow file types we DON'T clean to be signatures.
                if (FileTypeBridge.GetSupportedFileType(attachment.FileName) == FileType.Unknown)
                {
                    Logger.LogInfo(string.Format("Signature {0} on Html formatted message", attachment.FileName));
                    return true;
                }
            }
            return false;
        }