MAPIPropertyValue.cs
author nikolaj
Tue, 13 Feb 2018 10:47:08 +0100
branchOUT-366. S/MIME
changeset 2001 79b037aa8337
parent 1360 697801c205db
permissions -rw-r--r--
OUT-366: Added EnumPidTagSecurityFlags to MapiPropertyValue class
     1 ´╗┐using System;
     2 
     3 namespace pEp
     4 {
     5     /// <summary>
     6     /// MAPI helper class containing all defined property values.
     7     /// </summary>
     8     internal class MapiPropertyValue
     9     {
    10         /// <summary>
    11         /// Enumeration of flags for PidTagMessageFlags which specifies the status of the Message object.
    12         /// After the first successful call to the RopSaveChangesMessage ROP ([MS-OXCROPS] section 2.2.6.3), 
    13         /// as described in section 2.2.3.3, these flags are read-only for the client.
    14         /// </summary>
    15         [Flags]
    16         public enum EnumPidTagMessageFlags : int
    17         {
    18             /// <summary>
    19             /// The message is marked as having been read.
    20             /// </summary>
    21             mfRead = 0x00000001,
    22 
    23             /// <summary>
    24             /// The message has not been modified since it was first saved (if unsent) or it was delivered (if sent).
    25             /// This flag is always read-only for the client.
    26             /// </summary>
    27             mfUnmodified = 0x00000002,
    28 
    29             /// <summary>
    30             /// The message is marked for sending as a result of a call to the RopSubmitMessage ROP.
    31             /// This flag is always read-only for the client.
    32             /// </summary>
    33             mfSubmitted = 0x00000004,
    34 
    35             /// <summary>
    36             /// The message is still being composed and is treated as a Draft Message object. 
    37             /// This bit is cleared by the server when responding to the RopSubmitMessage ROP ([MS-OXCROPS] section 2.2.7.1) with a success code.
    38             /// </summary>
    39             mfUnsent = 0x00000008,
    40 
    41             /// <summary>
    42             /// The message has at least one attachment. This flag corresponds to the message's PidTagHasAttachments property (section 2.2.1.2).
    43             /// This flag is always read-only for the client.
    44             /// </summary>
    45             mfHasAttach = 0x00000010,
    46 
    47             /// <summary>
    48             /// The user receiving the message was also the user who sent the message.
    49             /// This flag is always read-only for the client.
    50             /// </summary>
    51             mfFromMe = 0x00000020,
    52 
    53             /// <summary>
    54             /// The message is an FAI (folder associated information) message.
    55             /// This flag is always read-only for the client.
    56             /// </summary>
    57             mfFAI = 0x00000040,
    58 
    59             /// <summary>
    60             /// The message includes a request for a resend operation with a non-delivery report.
    61             /// For more details, see [MS-OXOMSG] section 3.2.4.5.
    62             /// </summary>
    63             mfResend = 0x00000080,
    64 
    65             /// <summary>
    66             /// The user who sent the message has requested notification when a recipient (1) first reads it.
    67             /// This flag is always read-only for the client.
    68             /// </summary>
    69             mfNotifyRead = 0x00000100,
    70 
    71             /// <summary>
    72             /// The user who sent the message has requested notification when a recipient (1) deletes it before reading or the Message object expires.
    73             /// This flag is always read-only for the client.
    74             /// </summary>
    75             mfNotifyUnread = 0x00000200,
    76 
    77             /// <summary>
    78             /// The message has been read at least once. This flag is set or cleared by the server whenever the mfRead flag is set or cleared. Clients SHOULD ignore this flag.
    79             /// This flag is always read-only for the client.
    80             /// </summary>
    81             mfEverRead = 0x00000400,
    82 
    83             /// <summary>
    84             /// The incoming message arrived over the Internet and originated either outside the organization or from a source the gateway does not consider trusted.
    85             /// This flag is always read-only for the client.
    86             /// </summary>
    87             mfInternet = 0x00002000,
    88 
    89             /// <summary>
    90             /// The incoming message arrived over an external link other than X.400 or the Internet. 
    91             /// It originated either outside the organization or from a source the gateway does not consider trusted.
    92             /// This flag is always read-only for the client.
    93             /// </summary>
    94             mfUntrusted = 0x00008000
    95         }
    96 
    97 
    98 
    99         /// <summary>
   100         /// Enumeration of PrSecurityFlags that shows mail S/Mime encryption setting
   101         /// https://support.microsoft.com/en-us/help/2636465/how-to-sign-or-encrypt-mail-messages-programmatically?wa=wsignin1.0
   102         /// </summary>
   103         [Flags]
   104         public enum EnumPidTagSecurityFlags
   105         {
   106             /// <summary>
   107             /// 0 - not encrypted and not signed
   108             /// </summary>
   109             notEncryptedAndNotSigned = 0x00000000,
   110 
   111             /// <summary>
   112             /// 1 - only encrypted
   113             /// </summary>
   114             onlyEncrypted = 0x00000001,
   115 
   116             /// <summary>
   117             /// 2 - only signed. 
   118             /// </summary>
   119             onlySigned = 0x00000002,
   120 
   121 
   122             /// <summary>
   123             /// 3 - encrypted and signed 
   124             /// </summary>
   125             encryptedAndSigned = 0x00000003,
   126         }
   127 
   128 
   129 
   130         /// <summary>
   131         /// Value for PidTagAttachTag which specifies the attachment is TNEF.
   132         /// </summary>
   133         public static readonly byte[] PidTagAttachTagTNEF = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x14, 0x03, 0x0A, 0x01};
   134 
   135         /// <summary>
   136         /// Value for PidTagAttachTag which specifies the attachment is in an application-specific format.
   137         /// </summary>
   138         public static readonly byte[] PidTagAttachTagAfStorage = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x14, 0x03, 0x0A, 0x03, 0x02, 0x01};
   139 
   140         /// <summary>
   141         /// Value for PidTagAttachTag which specifies the attachment is MIME.
   142         /// </summary>
   143         public static readonly byte[] PidTagAttachTagMIME = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x14, 0x03, 0x0A, 0x04};
   144 
   145         /// <summary>
   146         /// Value for PidTagMessageClass indicating a normal e-mail message.
   147         /// See: https://msdn.microsoft.com/en-us/library/ee200767
   148         /// </summary>
   149         public const string PidTagMessageClassNormalMessage = "IPM.Note";
   150 
   151         /// <summary>
   152         /// Value for PidTagMessageClass indicating that the message is secure. This is a Microsoft standard
   153         /// and changes the message icon in the UI.
   154         /// See: https://msdn.microsoft.com/en-us/library/office/ff861573.aspx
   155         /// and: https://www.howto-outlook.com/howto/icons.htm
   156         /// </summary>
   157         public const string PidTagMessageClassSecure = "IPM.Note.Secure";
   158 
   159         /// <summary>
   160         /// Value for PidTagMessageClass indicating that the message is secure and from pEp. This is a custom 
   161         /// defined value and needed for secure messages on untrusted servers in order to load correctly the
   162         /// form region overlay in the message preview.
   163         /// </summary>
   164         public const string PidTagMessageClassSecurePEP = "IPM.Note.Secure.pEp";
   165 
   166         /// <summary>
   167         /// Value for PidTagMessageClass indicating the message is secure (S/MIME) and can also be signed.
   168         /// See: https://msdn.microsoft.com/en-us/library/ee200767
   169         /// </summary>
   170         public const string PidTagMessageClassSMIME = "IPM.Note.SMIME";
   171 
   172         /// <summary>
   173         /// Value for PidTagMessageClass indicating the message is secure (S/MIME) and clear signed.
   174         /// See: https://msdn.microsoft.com/en-us/library/ee200767
   175         /// </summary>
   176         public const string PidTagMessageClassSMIMEMultipartSigned = "IPM.Note.SMIME.MultipartSigned";
   177 
   178         /// <summary>
   179         /// Value for PidTagMessageClass indicating the message is a secure read receipt
   180         /// See: https://msdn.microsoft.com/en-us/library/ee200767
   181         /// </summary>
   182         public const string PidTagMessageClassSMIMEReceipt = "IPM.Note.Receipt.SMIME";
   183     }
   184 }