LazyMAPI

"Light" RAW Extended MAPI Glossary

Term Explanation
   
MAPI Property A property is an attribute of a MAPI object. Properties describe something about the object, such as the subject line of a message or the address type of a messaging user. Property tags are used to identify MAPI properties and every property must have one.
PropTag Property tag for the property. Property tags are codes expressed as 32-bit unsigned integers, that contain the property's unique identifier (PropID) in the high-order 16 bits, and the property's type (PropType) in the low-order 16 bits.
For example, consider the "Importance" message envelope property. Its Property ID (PropID) is $0017, and its Data Type (PropType) is PT_LONG (which maps to a hexadecimal value of $0003). Its Property Tag (PropTag) is a combination of these two: $00170003. This hexadecimal value is defined as the constant PR_IMPORTANCE.
PropID A property identifier (PropID) is a number that is used to indicate what a property is used for and who is responsible for it. The range of property identifiers runs from $0001 through $FFFF. Property identifiers $0001 and $FFFF are reserved. PropID is high 16 bits from PropTag.

The following table shows the Property ID ranges in which properties in similar categories are grouped.

From To Category

$0000

$0000

Reserved by MAPI for the special value PR_NULL.

$0001

$0BFF

Message envelope properties defined by MAPI.

$0C00

$0DFF

Recipient properties defined by MAPI.

$0E00

$0FFF

Non-transmittable message properties defined by MAPI.

$1000

$2FFF

Message content properties defined by MAPI.

$3000

$3FFF

Properties for objects other than messages and recipients defined by MAPI. See the table below for more details.

$4000

$57FF

Message envelope properties defined by Transport Providers.

$5800

$5FFF

Recipient properties defined by Transport and Address Book Providers.

$6000

$65FF

Non-transmittable message properties defined by Clients.

$6600

$67FF

Non-transmittable properties defined by a Service Provider. These properties can be visible or invisible to users.

$6800

$7BFF

Message content properties for custom message classes defined by creators of those classes.

$7C00

$7FFF

Non-transmittable properties for custom message classes defined by creators of those classes.

$8000

$FFFE

Properties defined by clients, and occasionally service providers that are identified by name through the IMAPIProp.GetIDsFromNames method.

The following table shows how this particular range is further subdivided into smaller ranges, to make assigning new Property IDs easier.

From To Category

$3000

$32FF

Common properties that appear on multiple objects, such as PR_DISPLAY_NAME and PR_ENTRYID.

$3200

$33FF

Form properties.

$3400

$35FF

Message Store properties.

$3600

$36FF

Folder and Address Book Container properties.

$3700

$38FF

Attachment properties.

$3900

$39FF

Address Book properties.

$3A00

$3BFF

Messaging User properties.

$3C00

$3CFF

Distribution List properties.

$3D00

$3DFF

Profile properties.

$3E00

$3FFF

Status object properties.


The MAPI uses the _A and _W additives to signify if the property is an ASCII (single byte character, AnsiString) or a Wide (multiple byte character, WideString) string. This document does not bother with this distinction. The additive _O is used for some types, it refers to the direct use of embedded object instead of data types.
PropType Property types (PropType) are constants defined by MAPI that indicate the underlying data type of a property value. All properties, whether they are defined by MAPI, by client applications, or by service providers, use one of these types. PropType is low 16 bits from PropTag.

All defined from MAPI property types are listed here.

PropNamed Property identifiers are a set of hexadecimal values that range from $0001 to $FFFF. This allows for 65,534 properties. These properties are divided into the following groups, known as ranges:
  • Transmittable properties - This range is made up of properties that Exchange Server can send with a message.
  • Internal properties - This range is made up of properties that may be set only by Exchange Server.
  • Non-transmittable properties - This range represents properties that are not delivered outside the organization when Exchange delivers a message.
In addition to these ranges, there is one other range. This range is the largest and represents all properties that are at $8000 and above. The properties in this range are known as named properties. Named properties provide a way for vendors to extend the standard MAPI property set by adding their own properties. Named properties are made up of the following two main types:
  • Properties that have numbers for names. These are properties that programs such as Microsoft Outlook use. These property names are generally defined in a source file.
  • Properties that have string values for names. These properties are known as "String Named Properties".
In addition to a name, each of these properties has an associated GUID. This allows developers to divide named properties into property sets.
Commonly Used Named Property Sets are listed here.

Because the named properties do not have specific IDs assigned, MAPI provides a facility to dynamically create unique IDs for named properties and to maintain a persistent mapping between a named property and its unique ID. However, the dynamic creation of these IDs means that the property IDs for named properties can vary from computer to computer.

To support named properties, MAPI implements two methods thru IMAPIProp interface — IMAPIProp::GetIDsFromNames and IMAPIProp::GetNamesFromIDs — to translate between names and identifiers and to allow its IMAPIProp::GetProps and IMAPIProp::SetProps methods to retrieve and modify properties with identifiers in the named property range. The range for named property identifiers (PropID) is between $8000 and $FFFE.

To define a named property, a client or service provider makes up a name and stores it in a MAPINAMEID structure.
MAPINAMEID To define a named property, a client or service provider makes up a name and stores it in a MAPINAMEID structure.

type

  PMAPINAMEID = ^TMAPINAMEID;

 _MAPINAMEID = record
     lpguid: PGUID; // Pointer to a GUID structure defining a particular property set; this member cannot be NULL.
     ulKind: ULONG; // Value describing the type of value in the Kind member. Valid values are: MNID_ID or MNID_STRING.
     Kind: record
       case Integer of
        1: (lID: Longint; );  // The name is an integer value, stored in lID. ulKind = MNID_ID
        2: (lpwstrName: LPWSTR; ); // The name is an Unicode string (PWideChar), stored in lpwstrName. ulKind = MNID_STRING
      end;
 end;

TMAPINAMEID = _MAPINAMEID;


MSDN:
  MAPINAMEID

SPropValue Describes a RAW MAPI property.

=======================
type
 PSPropValue = ^TSPropValue;

  _SPropValue = record

     ulPropTag: ULONG;   // Property tag (PropTag) for the property.
     dwAlignPad: ULONG; // Reserved for MAPI. Used as padding to make sure proper alignment on computers that require 8-byte alignment for 8-byte values.
     Value: _PV;            // Union of data values, the specific value dictated by the property type (PropType).
  end;

TSPropValue = _SPropValue;
=======================

Value member:
Property type Value field Data type of Value

PT_I2 or PT_SHORT

i

short

PT_I4 or PT_LONG (signed)

l

Longint

PT_I4 or PT_LONG (unsigned)

ul

ULONG

PT_R4 or PT_FLOAT

flt

single

PT_R8 or PT_DOUBLE

dbl

double

PT_BOOLEAN

b

WordBool

PT_CURRENCY

cur

Currency

PT_APPTIME

at

double

PT_SYSTIME

ft

TFILETIME

PT_STRING8

lpszA

LPSTR (PAnsiChar)

PT_BINARY

bin

Pointer to BYTE array

PT_UNICODE

lpszW

LPWSTR (PWideChar)

PT_CLSID

lpguid

PGUID

PT_I8 or PT_LONGLONG

li

TLargeInteger (int64)

PT_MV_I2

MVi

array of short values

PT_MV_LONG

MVI

array of Longint values

PT_MV_R4

MVflt

array of single values

PT_MV_DOUBLE

MVdbl

array of double values

PT_MV_CURRENCY

MVcur

array of Currency values

PT_MV_APPTIME

MVat

array of double values

PT_MV_SYSTIME

MVft

array of TFILETIME values

PT_MV_BINARY

MVbin

array of BYTE array values

PT_MV_STRING8

MVszA

array of PAnsiChar values

PT_MV_UNICODE

MVszW

array of PWideChar values

PT_MV_CLSID

MVguid

array of GUID values

PT_MV_I8

MVli

array of TLargeInteger  (int64) values

PT_ERROR

err

SCODE (Integer)

PT_NULL or PT_OBJECT

x

LONG  (Integer)


 PT_MV_XXXXX means MultiValued property. MultiValued member is constructed as record of:

 _XXXXXXXArray = record
     cValues: ULONG;  // Count of values in the array pointed to by the lpXXX member.
     lpXXX: YYYY;     // Pointer to an array of YYYY type
  end;

Example: for PT_MV_DOUBLE, value member MVdbl is defined as TSDoubleArray

type
  _SDoubleArray = record
     cValues: ULONG;  // Count of values in the array pointed to by the lpdbl member.
     lpdbl: PDouble;   // Pointer to an array of Double type
  end;

  SDoubleArray = _SDoubleArray;
  TSDoubleArray = SDoubleArray;

Demo code:

  CountOfValues:=MyMVDouble.MVdbl.cValues; // MyMVDouble is TSPropValue of property type PT_MV_DOUBLE
  Index:=1;

  SecondDoubleValueInArray:=_PDoubleArray(MyMVDouble.MVdbl.lpdbl)[Index];

Demo code:

 MessageSubject := StrPas(MyAnsiStringValue.lpszA);  // MyAnsiValue is TSPropValue of property type PT_STRING8


MSDN:
  SPropValue

SRowSet Contains an array of SRow structures. Each SRow structure describes a row from a table.

type
   PSRowSet = ^TSRowSet;

   _SRowSet = record
       cRows: ULONG;
{ Count of rows }
       aRow: array [0 .. 0] of TSRow;
{ Array of rows }
    end;

   TSRowSet = _SRowSet;

MSDN:
  SRowSet

SRow Describes a row from a table that contains selected properties for a specific object.

type
   PSRow = ^TSRow;

   _SRow = record
      ulAdrEntryPad: ULONG;
{ Pad so SRow's can map to ADRENTRY's }
      cValues: ULONG;
{ Count of property values }
      lpProps: PSPropValue;
{ Property value array }
   end;

   TSRow = _SRow;

MSDN:
  SRow

MAPIUID A byte-order independent version of a GUID structure that is used to uniquely identify a service provider.

type
  PMAPIUID = ^TMAPIUID;

  _MAPIUID = record
     ab: array [0 .. 15] of byte;
  end;

  TMAPIUID = _MAPIUID;

MSDN:
  MAPIUID

One-Off Addresses One-off addresses are used to send messages to one-off recipients, recipients that do not have a corresponding entry in any of the session's address book containers.
The one-off address format is defined by MAPI as follows:

Display name[Address type:E-mail address]

Component Usage Description

Display name

Optional

If not present, uses the visible part of the e-mail address as the display name. May include blanks.

[

Required

Delineates the start of the type and address information.

]

Required

Delineates the end of the type and address information. If anything other than white space follows this character, the entry is not treated as a custom recipient.

Address type

Required

Type of address; maps to a specific address format.

:

Required

Separates the address type from the e-mail address.

E-mail address

Required

Address of the recipient. May include blanks.

TSRestriction Describes a filter for limiting the view of a table to particular rows.

type

  PSRestriction = ^TSRestriction;

 _SRestriction = record
    rt: ULONG;
{ Restriction type }
    RES: record
       case Integer of
          1: (resCompareProps: TSComparePropsRestriction; );
// RES_COMPAREPROPS
          2: (resAnd: TSAndRestriction; );
// RES_AND
          3: (resOr: TSOrRestriction; );
// RES_OR
          4: (resNot: TSNotRestriction; );
// RES_NOT
          5: (resContent: TSContentRestriction; );
// RES_CONTENT
          6: (resProperty: TSPropertyRestriction; );
// RES_PROPERTY
          7: (resBitMask: TSBitMaskRestriction; );
// RES_BITMASK
          8: (resSize: TSSizeRestriction; );
// RES_SIZE
          9: (resExist: TSExistRestriction; );
// RES_EXIST
          10: (resSub: TSSubRestriction; );
// RES_SUBRESTRICTION
          11: (resComment: TSCommentRestriction; );
// RES_COMMENT
          12: (resAnnotation: TSAnnotationRestriction; );
// RES_ANNOTATION
          13: (resCount: TSCountRestriction; );
// RES_COUNT
       end;
  end;

TSRestriction = _SRestriction;

Members:
  rt: The restriction type. Possible values are as follows:
 
Value Meaning Delphi implementation (class)
RES_AND An AND restriction, which applies a bitwise AND operation to a restriction. TRestrictionAnd
RES_BITMASK A bitmask restriction, which applies a bitmask to a property value. TRestrictionBitMask
RES_COMMENT A comment restriction, which associates a comment with a restriction. N/A
RES_COMPAREPROPS A property comparison restriction, which compares two property values. TRestrictionCompare
RES_CONTENT A content restriction, which searches a property value for specific content. TRestrictionContent
RES_EXIST An exist restriction, which determines whether a property is supported. TRestrictionExist
RES_NOT A NOT restriction, which applies a logical NOT operation to a restriction. TRestrictionNot
RES_OR An OR restriction, which applies a logical OR operation to a restriction. TRestrictionOr
RES_PROPERTY A property restriction, which determines whether a property value matches a particular value. TRestrictionProperty
RES_SIZE A size restriction, which determines whether a property value is a particular size. TRestrictionSize
RES_SUBRESTRICTION A sub-object restriction, which applies a restriction to a message's attachments or recipients. TRestrictionSub

RES: Union of restriction structures describing the filter to be applied. The specific structure included in the res member depends on the value of the rt member. See above table.

MSDN:
  SRestriction

TSPropTagArray Contains an array of property tags.
 
type
 
   PSPropTagArray = ^TSPropTagArray;

    _SPropTagArray = record
        cValues: ULONG; // Count of property tags in the array indicated by the aulPropTag member
        aulPropTag: array [0 .. MAPI_DIM - 1] of ULONG; // Array of property tags.
    end;

TSPropTagArray = _SPropTagArray;

MSDN:
  SPropTagArray

TSBinary Describes a property of type PT_BINARY.

PSBinary = ^TSBinary;
 
  _SBinary = record
    cb: ULONG; // Count of bytes in the lpb member.
    lpb: PBYTE;  // Pointer to the PT_BINARY property value.
  end;
 
  SBinary = _SBinary;
  TSBinary = SBinary;
 
MSDN:
  SBinary

TDTCTL Describes a control that will be used in a dialog box built from a display table.

DTCTL = record
    ulCtlType: ULONG;
    ulCtlFlags: ULONG;
    lpbNotif: PBYTE;
    cbNotif: ULONG;
    lpszFilter: LPTSTR;
    ulItemID: ULONG;
    case Integer of
      0:
        (lpv: pointer);
      1:
        (lplabel: PDTBLLABEL);
      2:
        (lpedit: PDTBLEDIT);
      3:
        (lplbx: PDTBLLBX);
      4:
        (lpcombobox: PDTBLCOMBOBOX);
      5:
        (lpddlbx: PDTBLDDLBX);
      6:
        (lpcheckbox: PDTBLCHECKBOX);
      7:
        (lpgroupbox: PDTBLGROUPBOX);
      8:
        (lpbutton: PDTBLBUTTON);
      9:
        (lpradiobutton: PDTBLRADIOBUTTON);
      10:
        (lpmvlbx: PDTBLMVLISTBOX);
      11:
        (lpmvddlbx: PDTBLMVDDLBX);
      12:
        (lppage: PDTBLPAGE);
  end;
 
  TDTCTL = DTCTL;
  PDTCTL = ^TDTCTL;

MSDN:
  DTCTL

TOPTIONDATA Describes properties supported by a transport provider.

type
  _OPTIONDATA = record
    ulFlags: ULONG; {MAPI_RECIPIENT, MAPI_MESSAGE}
    lpRecipGUID: PGUID; {Same as returned by AddressTypes()}
    lpszAdrType: PChar; {Same as returned by AddressTypes()}
    lpszDLLName: PChar; {Options DLL}
    ulOrdinal: ULONG; {Ordinal in that DLL}
    cbOptionsData: ULONG; {Count of bytes in lpbOptionsData}
    lpbOptionsData: PBYTE; {Providers per [recip|message] option data}
    cOptionsProps: ULONG; {Count of Options default prop values}
    lpOptionsProps: PSPropValue; {Default Options property values}
  end;
 
  TOPTIONDATA = _OPTIONDATA;
  POPTIONDATA = ^TOPTIONDATA;

MSDN:
  OPTIONDATA

TSSortOrder Defines how to sort the rows of a table, what column to use as the sort key, and the direction of the sort.

type
  PSSortOrder = ^TSSortOrder;
 
  //  Defines how to sort the rows of a table, what column to use as the sort key, and the direction of the sort.
  _SSortOrder = record
    ulPropTag: ULONG; {Column to sort on}
    ulOrder: ULONG; {Ascending, descending, combine to left}
  end;
 
{ Possible values for ulOrder member are as follow:
TABLE_SORT_ASCEND - The table should be sorted in ascending order.
TABLE_SORT_COMBINE - The sort operation should create a category that combines the property identified as the sort key column in the ulPropTag member with the sort key column specified in the previous SSortOrder structure.
  Rem: TABLE_SORT_COMBINE can only be used when the SSortOrder structure is being used as an entry in an SSortOrderSet structure to specify multiple sort orders for a categorized sort. TABLE_SORT_COMBINE cannot be used in the first SSortOrder structure in an SSortOrderSet structure.
TABLE_SORT_DESCEND - The table should be sorted in descending order.
TABLE_SORT_CATEG_MAX - The table should be sorted on the maximum value of the ulPropTag member for the data rows in the categories specified by the previous sort order in the SSortOrderSet structure.
TABLE_SORT_CATEG_MIN - The table should be sorted on the minimum value of the ulPropTag member for the data rows in the categories specified by the previous sort order in the in SSortOrderSet structure.
}
 
 
MSDN:
  SSortOrder

TSSortOrderSet Defines a collection of sort keys for a table that is used for standard or categorized sorting.

 _SSortOrderSet = record
    cSorts: ULONG; {Number of sort columns in aSort below}
    cCategories: ULONG; {0 for non-categorized, up to cSorts}
    cExpanded: ULONG; {0 if no categories start expanded,}
    {up to cExpanded}
    aSort: array [0 .. MAPI_DIM - 1] of TSSortOrder; {The sort orders}
  end;
 
  TSSortOrderSet = _SSortOrderSet;
  PSSortOrderSet = ^TSSortOrderSet;

MSDN:
  SSortOrderSet

TADRENTRY Describes zero or more properties that belong to a recipient.

PADRENTRY = ^TADRENTRY;
 
  _ADRENTRY = record
    ulReserved1: ULONG; {Never used; Reserved; must be zero}
    cValues: ULONG; {Count of properties in the property value array pointed to by the rgPropVals member. The cValues member can be zero. }
    rgPropVals: PSPropValue; {Pointer to a property value array describing the properties for the recipient. The rgPropVals member can be NIL.}
  end;
  TADRENTRY = _ADRENTRY;
 
MSDN:
   ADRENTRY

TADRLIST Describes zero or more properties that belong to one or more recipients.

PADRLIST = ^TADRLIST;
 
  _ADRLIST = record
    cEntries: ULONG; {Count of entries in the array specified by the aEntries member.}
    aEntries: array [0 .. MAPI_DIM - 1] of TADRENTRY; {Array of ADRENTRY structures, one structure for each recipient.}
  end;
 
  TADRLIST = _ADRLIST;
 
MSDN:
   ADRLIST

TNOTIFICATION Contains information about an event that has occurred and the data that has been affected by the event.

_NOTIFICATION = record
    ulEventType: ULONG; {Type of notification event that occurred, i.e. fnevSomething}
    ulAlignPad: ULONG; {Force to 8-byte boundary}
    info: record   {Union of notification structures describing the affected data for a particular type of event. The structure included in the info member depends on the value of the ulEventType member.}
       case Integer of
       1: (err: TERROR_NOTIFICATION;);
       2: (newmail: TNEWMAIL_NOTIFICATION;);
       3: (obj: TOBJECT_NOTIFICATION;);
       4: (tab: TTABLE_NOTIFICATION;);
       5: (ext: TEXTENDED_NOTIFICATION;);
       6: (statobj: TSTATUS_OBJECT_NOTIFICATION;);
      end;
    end;
 
TNOTIFICATION = _NOTIFICATION;
PNOTIFICATION = ^TNOTIFICATION;

MSDN:
  NOTIFICATION
TENTRYID Contains an entry identifier for a MAPI object.
 
  TENTRYID = record
    abFlags: array [0 .. 3] of byte;
    ab: array [0 .. MAPI_DIM - 1] of byte;
  end;
 
  PENTRYID = ^TENTRYID;


MSDN:
  ENTRYID

IMAPISession Manages objects associated with a MAPI logon session.
Interface identifier: IID_IMAPISession: TGUID = '{00020300-0000-0000-C000-000000000046}'

MSDN - IMAPISession : IUnknown
IMAPIProp Enables MAPI to work with properties. All objects that support properties implement this interface.
Interface identifier: IID_IMAPIProp: TGUID = '{00020303-0000-0000-C000-000000000046}'

MSDN - IMAPIProp : IUnknown
IMAPIContainer Manages high-level operations on container objects such as address books, distribution lists, and folders. Inherited from IMAPIProp.
Interface identifier: IID_IMAPIContainer: TGUID = '{0002030B-0000-0000-C000-000000000046}'

MSDN - IMAPIContainer : IMAPIProp
IMsgStore Provides access to message store information and to messages and folders. Inherited from IMAPIProp.
Interface identifier: IID_IMsgStore: TGUID = '{00020306-0000-0000-C000-000000000046}'

MSDN - IMsgStore : IMAPIProp
IMessage Manages messages, attachments, and recipients. Inherited from IMAPIProp.
Interface identifier: IID_IMessage: TGUID = '{00020307-0000-0000-C000-000000000046}'

MSDN - IMessage : IMAPIProp
IMAPIFolder Performs operations on the messages and subfolders in a folder. Inherits IMAPIProp, IMAPIContainer.
Interface identifier: IID_IMAPIFolder: TGUID = '{0002030C-0000-0000-C000-000000000046}'

MSDN - IMAPIFolder : IMAPIContainer
IMAPITable Provides a read-only view of a table.
Interface identifier: IID_IMAPITable: TGUID = '{00020301-0000-0000-C000-000000000046}'

MSDN - IMAPITable : IUnknown
IAttach Maintains and provides access to the properties of attachments in messages.
Interface identifier: IID_IAttachment: TGUID = '{00020308-0000-0000-C000-000000000046}'
MSDN - IAttach : IMAPIProp
IAddrBook Supports access to the MAPI address book and includes operations such as displaying common dialog boxes; opening containers, messaging users, and distribution lists; and performing name resolution. Inherited from IMAPIProp.
Interface identifier: IID_IAddrBook: TGUID = '{00020309-0000-0000-C000-000000000046}'

MSDN - IAddrBook : IMAPIProp
IMAPIProgress Implements a progress object that provides client applications with a progress indicator.
Interface identifier: IID_IMAPIProgress: TGUID = '{0002031F-0000-0000-C000-000000000046}'

MSDN - IMAPIProgress : IUnknown
IMsgServiceAdmin Makes changes to a message service in a profile.
Interface identifier: IID_IMsgServiceAdmin: TGUID = '{0002031D-0000-0000-C000-000000000046}'

MSDN - IMsgServiceAdmin : IUnknown
IProfSect Works with the properties of profile section objects.
Interface identifier: IID_IProfSect: TGUID = '{00020304-0000-0000-C000-000000000046}'

MSDN - IProfSect : IMAPIProp
IProviderAdmin Works with service providers in a message service.
Interface identifier: IID_IProviderAdmin: TGUID = '{00020325-0000-0000-C000-000000000046}'

MSDN - IProviderAdmin : IUnknown
IABContainer Provides access to address book containers. MAPI and client applications call the methods of IABContainer to perform name resolution and to create, copy, and delete recipients.
Interface identifier: IID_IABContainer: TGUID = '{0002030D-0000-0000-C000-000000000046}'

MSDN - IABContainer : IMAPIContainer
IMAPIStatus Provides status information about the MAPI subsystem, the integrated address book, and the MAPI spooler. A service provider implements IMAPIStatus to supply information about its own status.
Interface identifier: IID_IMAPIStatus: TGUID = '{00020305-0000-0000-C000-000000000046}'

MSDN - IMAPIStatus : IMAPIProp
IMAPIAdviseSink Implements an advise sink object for handling notification. A pointer to an advise sink object is passed in a call to a service provider's Advise method, the mechanism used to register for notification.
Interface identifier: IID_IMAPIAdviseSink: TGUID = '{00020302-0000-0000-C000-000000000046}'

MSDN - IMAPIAdviseSink : IUnknown

Top


Copyright © 2021 IMIBO
Privacy Statement