""" The constants used in extract_msg. If you modify any of these without explicit instruction to do so from one of the contributers, please do not complain about bugs. """ import struct # DEFINE CONSTANTS # WARNING DO NOT CHANGE ANY OF THESE VALUES UNLESS YOU KNOW # WHAT YOU ARE DOING! FAILURE TO FOLLOW THIS INSTRUCTION # CAN AND WILL BREAK THIS SCRIPT! FIXED_LENGTH_PROPS = ( 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x000A, 0x000B, 0x0014, 0x0040, 0x0048, ) VARIABLE_LENGTH_PROPS = ( 0x000D, 0x001E, 0x001F, 0x00FB, 0x00FD, 0x00FE, 0X0102, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, 0x1014, 0x101E, 0x101F, 0x1040, 0x1048, 0x1102, ) INTELLIGENCE_DUMB = 0 INTELLIGENCE_SMART = 1 INTELLIGENCE_DICT = { INTELLIGENCE_DUMB: 'INTELLIGENCE_DUMB', INTELLIGENCE_SMART: 'INTELLIGENCE_SMART', } TYPE_MESSAGE = 0 TYPE_MESSAGE_EMBED = 1 TYPE_ATTACHMENT = 2 TYPE_RECIPIENT = 3 TYPE_DICT = { TYPE_MESSAGE: 'TYPE_MESSAGE', TYPE_MESSAGE_EMBED: 'TYPE_MESSAGE_EMBED', TYPE_ATTACHMENT: 'TYPE_ATTACHMENT', TYPE_RECIPIENT: 'TYPE_RECIPIENT', } RECIPIENT_SENDER = 0 RECIPIENT_TO = 1 RECIPIENT_CC = 2 RECIPIENT_BCC = 3 RECIPIENT_DICT = { RECIPIENT_SENDER: 'RECIPIENT_SENDER', RECIPIENT_TO: 'RECIPIENT_TO', RECIPIENT_CC: 'RECIPIENT_CC', RECIPIENT_BCC: 'RECIPIENT_BCC', } # Constants used for argparse stuff KNOWN_FILE_FLAGS = [ '--out-name', ] NEEDS_ARG = [ '--out-name', ] MAINDOC = "extract_msg:\n\tExtracts emails and attachments saved in Microsoft Outlook's .msg files.\n\n" \ "https://github.com/mattgwwalker/msg-extractor" # Define pre-compiled structs to make unpacking slightly faster # General structs ST1 = struct.Struct('<8x4I') ST2 = struct.Struct('