-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEwsId_format.txt
93 lines (76 loc) · 3.1 KB
/
EwsId_format.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
IdStorageType (byte):
MailboxItemSmtpAddressBased = 0, // Exchange 2007 (EwsLegacyId)
PublicFolder = 1,
PublicFolderItem = 2,
MailboxItemMailboxGuidBased = 3,
ConversationIdMailboxGuidBased = 4,
ActiveDirectoryObject = 5, // Exchange 2013
MailboxItemMailboxGuidBasedWithFallback = 6 // Exchange 2016
CompressionId (byte):
NoCompression = 0,
RleCompression = 1
IdProcessingInstruction (byte):
Normal = 0,
Recurrence = 1,
Series = 2,
Multiple = 3
RLE compression:
If two bytes following each other are distinct then the first byte is verbatim
If they are equal then the byte following contains count - 2,
i.e. if buf[i] == buf[i+1] then output buf[i] c+2 times where c = buf[i+2].
(or output buf[i] and buf[i+1] are printed verbatim, then buf[i] is printed
buf[i+2] more times and buf[i+2] is then skipped)
Base64 encoded EwsId:
0 CompressionId compression id
1-... <payload (max length 1024)>
Decompressed payload:
0 IdStorageType storage type
1-... <storage specific content>
CountedContent:
0 Int16 len
1-len <content>
DateTime: .NET datetime, 2 bits Kind, 62 bits 100-nanosecond ticks since 01-01-01 0:00:00 UTC
Moniker: CountedContent
Email moniker: Moniker with UTF8 encoded string, max length 1000
Guid moniker: Moniker with Guid as "D" format ascii string, max length 50
InternetMessageId: CountedContent with UTF-8 string
StoreId: CountedContent, dependent on IdProcessingInstruction
case Multiple:
CountedContent+
(Conversion to StoreObjectId uses first content as ENTRYID)
case Normal, Series:
ENTRYID
default: (Recurrence or unknown)
if last byte == 16:
OccurenceStoreObjectId
else:
ENTRYID
OccurenceStoreObjectId:
0 byte value: 8
1-8 DateTime big endian OccurenceDate
9 ENTRYID
MailboxItemSmtpAddressBased storage content:
Email moniker MailboxId
IdProcessingInstruction IdProcessingInstruction
StoreId StoreId
MailboxItemMailboxGuidBased, ConversationIdMailboxGuidBased storage content:
Guid moniker MailboxId
IdProcessingInstruction IdProcessingInstruction
StoreId StoreId
MailboxItemMailboxGuidBasedWithFallback storage content:
Guid moniker MailboxId
IdProcessingInstruction IdProcessingInstruction
StoreId StoreId
InternetMessageId InternetMessageId
PublicFolder storage content:
StoreId StoreId
ActiveDirectoryObject:
CountedContent<Guid> ADObjectId
PublicFolderItem storage content:
IdProcessingInstruction IdProcessingInstruction
StoreId StoreId
StoreId FolderId
Id types:
EntryId.length == 46: FolderId
EntryId.length == 70: MessageId
(EWS validates that the EntryId has one of these length)