extract_msg.msg_classes.journal Module

Module contents

class extract_msg.msg_classes.journal.Journal(path, **kwargs)[source]

Bases: MessageBase

Class for parsing Journal messages.

Supports all of the options from MSGFile.__init__() with some additional ones.

Parameters:
  • recipientSeparator – Optional, separator string to use between recipients.

  • deencapsulationFunc – Optional, if specified must be a callable that will override the way that HTML/text is deencapsulated from the RTF body. This function must take exactly 2 arguments, the first being the RTF body from the message and the second being an instance of the enum DeencapType that will tell the function what type of body is desired. The function should return a string for plain text and bytes for HTML. If any problems occur, the function must either return None or raise one of the appropriate exceptions from extract_msg.exceptions. All other exceptions must be handled internally or they will not be caught. The original deencapsulation method will not run if this is set.

getJson() str[source]

Returns the JSON representation of the Message.

property companies: List[str] | None

Contains a list of company names, each of which is accociated with a contact this is precified in the contacts property.

property logDocumentPosted: bool

Indicates whether the document was sent by email of posted to a server folder during journaling.

property logDocumentPrinted: bool

Indicates whether the document was printed during journaling.

property logDocumentRouted: bool

Indicates whether the document was sent to a routing recipient during journaling.

property logDocumentSaved: bool

Indicates whether the document was saved during journaling.

property logDuration: int

The duration, in minutes, of the activity.

property logEnd: datetime | None

The name of the activity that is being recorded.

property logFlags: LogFlags

The name of the activity that is being recorded.

property logStart: datetime | None

The name of the activity that is being recorded.

property logType: str | None

The name of the activity that is being recorded.

property logTypeDesc: str | None

The description of the activity that is being recorded.

property headerFormatProperties: Dict[str, str | Tuple[str | None, bool] | None | Dict[str, str | Tuple[str | None, bool] | None]] | None

Returns a dictionary of properties, in order, to be formatted into the header.

Keys are the names to use in the header while the values are one of the following:

  • None: Signifies no data was found for the property and it should be omitted from the header.

  • str: A string to be formatted into the header using the string encoding.

  • Tuple[Union[str, None], bool]: A string should be formatted into the header. If the bool is True, then place an empty string if the first value is None, otherwise follow the same behavior as regular None.

Additional note: If the value is an empty string, it will be dropped as well by default.

Additionally you can group members of a header together by placing them in an embedded dictionary. Groups will be spaced out using a second instance of the join string. If any member of a group is being printed, it will be spaced apart from the next group/item.

If you class should not do any header injection, return None from this property.

filename: str | None