import struct, datetime

def parse_thread_index(index):
    s = index.decode('base64')
guid = struct.unpack('>IHHQ', s[6:22])
guid = '{%08X-%04X-%04X-%04X-%12X}' % (guid[0], guid[1], guid[2], guid[3] >>
    48 & 65535, guid[3] & 281474976710655)
f = struct.unpack('>Q', s[:6] + '\x00\x00')[0]
ts = [datetime.datetime(1601, 1, 1) + datetime.timedelta(microseconds=f // 10)]
for n in range(22, len(s), 5):
    f = struct.unpack('>I', s[n:n + 4])[0]
ts.append(ts[-1] + datetime.timedelta(microseconds=(f << 18) // 10))
return guid, ts
Разбор заголовка почты Thread-Index с помощью Python