extract_msg.msg_classes.contact Module

Module contents

class extract_msg.msg_classes.contact.Contact(path, **kwargs)[source]

Bases: MessageBase

Class used for parsing contacts.

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 account: str | None

The account name of the contact.

property addressBookProviderArrayType: ElectronicAddressProperties | None

A union of which Electronic Address properties are set on the contact.

Property is stored in the MSG file as a sinlge int. The result should be a union of the flags specified by addressBookProviderEmailList.

property addressBookProviderEmailList: Set[ElectronicAddressProperties] | None

A set of which Electronic Address properties are set on the contact.

property assistant: str | None

The name of the contact’s assistant.

property assistantTelephoneNumber: str | None

Contains the telephone number of the contact’s administrative assistant.

property autoLog: bool

Whether the client should create a Journal object for each action associated with the Contact object.

property billing: str | None

Billing information for the contact.

property birthday: datetime | None

The birthday of the contact at 11:59 UTC.

property birthdayEventEntryID: EntryID | None

The EntryID of an optional Appointement object that represents the contact’s birtday.

property birthdayLocal: datetime | None

The birthday of the contact at 0:00 in the client’s local time zone.

property businessCard: bytes
property businessCardCardPicture: bytes | None

The image to be used on a business card.

Must be either a PNG file or a JPEG file.

property businessCardDisplayDefinition: BusinessCardDisplayDefinition | None

Specifies the customization details for displaying a contact as a business card.

property businessFax: Dict[str, str | EntryID | None] | None

Returns a dict of the data for the business fax.

Returns None if no fields are set.

Keys are “address_type”, “email_address”, “number”, “original_display_name”, and “original_entry_id”.

property businessFaxAddressType: str | None

The type of address for the fax.

MUST be set to “FAX” if present.

property businessFaxEmailAddress: str | None

Contains a user-readable display name, followed by the “@” character, followed by a fax number.

property businessFaxNumber: str | None

Contains the number of the contact’s business fax.

property businessFaxOriginalDisplayName: str | None

The normalized subject for the contact.

property businessFaxOriginalEntryId: EntryID | None

The one-off EntryID corresponding to this fax address.

property businessTelephoneNumber: str | None

Contains the number of the contact’s business telephone.

property businessTelephone2Number: str | List[str] | None

Contains the second number or numbers of the contact’s business.

property businessHomePage: str | None

Contains the url of the homepage of the contact’s business.

property callbackTelephoneNumber: str | None

Contains the contact’s callback telephone number.

property carTelephoneNumber: str | None

Contains the number of the contact’s car telephone.

property childrensNames: List[str] | None

A list of the named of the contact’s children.

property companyMainTelephoneNumber: str | None

Contains the number of the main telephone of the contact’s company.

property companyName: str | None

The name of the company the contact works at.

property computerNetworkName: str | None

The name of the network to wwhich the contact’s computer is connected.

property contactCharacterSet: int | None

The character set that is used for this Contact object.

property contactItemData: List[int] | None

Used to help display the contact information.

property contactLinkedGlobalAddressListEntryID: EntryID | None

The EntryID of the GAL object to which the duplicate contact is linked.

property contactLinkGlobalAddressListLinkID: str | None

The GUID of the GAL contact to which the duplicate contact is linked.

property contactLinkGlobalAddressListLinkState: ContactLinkState | None

The state of linking between the GAL contact and the duplicate contact.

property contactLinkLinkRejectHistory: List[bytes] | None

A list of any contacts that were previously rejected for linking with the duplicate contact.

property contactLinkSMTPAddressCache: List[str] | None

A list of the SMTP addresses that are used by the GAL contact that are linked to the duplicate contact.

property contactPhoto: bytes | None

The contact photo, if it exists.

property contactUserField1: str | None

Used to store custom text for a business card.

property contactUserField2: str | None

Used to store custom text for a business card.

property contactUserField3: str | None

Used to store custom text for a business card.

property contactUserField4: str | None

Used to store custom text for a business card.

property customerID: str | None

The contact’s customer ID number.

property departmentName: str | None

The name of the department the contact works in.

property displayName: str | None

The full name of the contact.

property displayNamePrefix: str | None

The contact’s honorific title.

property email1: Dict[str, str | EntryID | None] | None

Returns a dict of the data for email 1.

Returns None if no fields are set.

Keys are “address_type”, “display_name”, “email_address”, “original_display_name”, and “original_entry_id”.

property email1AddressType: str | None

The address type of the first email address.

property email1DisplayName: str | None

The user-readable display name of the first email address.

property email1EmailAddress: str | None

The first email address.

property email1OriginalDisplayName: str | None

The first SMTP email address that corresponds to the first email address for the contact.

property email1OriginalEntryId: EntryID | None

The EntryID of the object correspinding to this electronic address.

property email2: Dict[str, str | EntryID | None] | None

Returns a dict of the data for email 2.

Returns None if no fields are set.

property email2AddressType: str | None

The address type of the second email address.

property email2DisplayName: str | None

The user-readable display name of the second email address.

property email2EmailAddress: str | None

The second email address.

property email2OriginalDisplayName: str | None

The second SMTP email address that corresponds to the second email address for the contact.

property email2OriginalEntryId: EntryID | None

The EntryID of the object correspinding to this electronic address.

property email3: Dict[str, str | EntryID | None] | None

Returns a dict of the data for email 3.

Returns None if no fields are set.

property email3AddressType: str | None

The address type of the third email address.

property email3DisplayName: str | None

The user-readable display name of the third email address.

property email3EmailAddress: str | None

The third email address.

property email3OriginalDisplayName: str | None

The third SMTP email address that corresponds to the third email address for the contact.

property email3OriginalEntryId: EntryID | None

The EntryID of the object correspinding to this electronic address.

property emails: Tuple[Dict[str, str | EntryID | None] | None, Dict[str, str | EntryID | None] | None, Dict[str, str | EntryID | None] | None]

Returns a tuple of all the email dicts.

Value for an email will be None if no fields were set.

property faxNumbers: Dict[str, Dict[str, str | EntryID | None] | None]

Returns a dict of the fax numbers.

Entry will be None if no fields were set.

Keys are “business”, “home”, and “primary”.

property fileUnder: str | None

The name under which to file a contact when displaying a list of contacts.

property fileUnderID: int | None

The format to use for fileUnder. See PidLidFileUnderId in [MS-OXOCNTC] for details.

property freeBusyLocation: str | None

A URL path from which a client can retrieve free/busy status information for the contact as an iCalendat file.

property ftpSite: str | None

The contact’s File Transfer Protocol url.

property gender: Gender

The gender of the contact.

property generation: str | None

A generational abbreviation that follows the full name of the contact.

property givenName: str | None

The first name of the contact.

property governmentIDNumber: str | None

The contact’s government ID number.

property hasPicture: bool

Whether the contact has a contact photo.

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.

property hobbies: str | None

The hobies of the contact.

property homeAddress: str | None

The complete home address of the contact.

property homeAddressCountry: str | None

The country portion of the contact’s home address.

property homeAddressCountryCode: str | None

The country code portion of the contact’s home address.

property homeAddressLocality: str | None

The locality or city portion of the contact’s home address.

property homeAddressPostalCode: str | None

The postal code portion of the contact’s home address.

property homeAddressPostOfficeBox: str | None

The number or identifier of the contact’s home post office box.

property homeAddressStateOrProvince: str | None

The state or province portion of the contact’s home address.

property homeAddressStreet: str | None

The street portion of the contact’s home address.

property homeFax: Dict[str, str | EntryID | None] | None

Returns a dict of the data for the home fax.

Returns None if no fields are set.

Keys are “address_type”, “email_address”, “number”, “original_display_name”, and “original_entry_id”.

property homeFaxAddressType: str | None

The type of address for the fax. MUST be set to “FAX” if present.

property homeFaxEmailAddress: str | None

Contains a user-readable display name, followed by the “@” character, followed by a fax number.

property homeFaxNumber: str | None

Contains the number of the contact’s home fax.

property homeFaxOriginalDisplayName: str | None

The normalized subject for the contact.

property homeFaxOriginalEntryId: EntryID | None

The one-off EntryID corresponding to this fax address.

property homeTelephoneNumber: str | None

The number of the contact’s home telephone.

property homeTelephone2Number: str | List[str] | None

The number(s) of the contact’s second home telephone.

property initials: str | None

The initials of the contact.

property instantMessagingAddress: str | None

The instant messaging address of the contact.

property isContactLinked: bool

Whether the contact is linked to other contacts.

property isdnNumber: str | None

The Integrated Services Digital Network (ISDN) telephone number of the contact.

property jobTitle: str | None

The job title of the contact.

property language: str | None

The language that the contact uses.

property lastModifiedBy: str | None

The name of the last user to modify the contact file.

property location: str | None

The location of the contact.

For example, this could be the building or office number of the contact.

property mailAddress: str | None

The complete mail address of the contact.

property mailAddressCountry: str | None

The country portion of the contact’s mail address.

property mailAddressCountryCode: str | None

The country code portion of the contact’s mail address.

property mailAddressLocality: str | None

The locality or city portion of the contact’s mail address.

property mailAddressPostalCode: str | None

The postal code portion of the contact’s mail address.

property mailAddressPostOfficeBox: str | None

The number or identifier of the contact’s mail post office box.

property mailAddressStateOrProvince: str | None

The state or province portion of the contact’s mail address.

property mailAddressStreet: str | None

The street portion of the contact’s mail address.

property managerName: str | None

The name of the contact’s manager.

property middleName: str | None

The middle name(s) of the contact.

property mobileTelephoneNumber: str | None

The mobile telephone number of the contact.

property nickname: str | None

The nickname of the contanct.

property officeLocation: str | None

The location of the office that the contact works in.

property organizationalIDNumber: str | None

The organizational ID number for the contact, such as an employee ID number.

property oscSyncEnabled: bool

Whether contact synchronization with an external source (such as a social networking site) is handled by the server.

property otherAddress: str | None

The complete other address of the contact.

property otherAddressCountry: str | None

The country portion of the contact’s other address.

property otherAddressCountryCode: str | None

The country code portion of the contact’s other address.

property otherAddressLocality: str | None

The locality or city portion of the contact’s other address.

property otherAddressPostalCode: str | None

The postal code portion of the contact’s other address.

property otherAddressPostOfficeBox: str | None

The number or identifier of the contact’s other post office box.

property otherAddressStateOrProvince: str | None

The state or province portion of the contact’s other address.

property otherAddressStreet: str | None

The street portion of the contact’s other address.

property otherTelephoneNumber: str | None

Contains the number of the contact’s other telephone.

property pagerTelephoneNumber: str | None

The contact’s pager telephone number.

property personalHomePage: str | None

The contact’s personal web page UL.

property phoneticCompanyName: str | None

The phonetic pronunciation of the contact’s company name.

property phoneticGivenName: str | None

The phonetic pronunciation of the contact’s given name.

property phoneticSurname: str | None

The phonetic pronunciation of the given name of the contact.

property postalAddressID: PostalAddressID

Indicates which physical address is the Mailing Address for this contact.

property primaryFax: Dict[str, str | EntryID | None] | None

Returns a dict of the data for the primary fax.

Returns None if no fields are set.

Keys are “address_type”, “email_address”, “number”, “original_display_name”, and “original_entry_id”.

property primaryFaxAddressType: str | None

The type of address for the fax. MUST be set to “FAX” if present.

property primaryFaxEmailAddress: str | None

Contains a user-readable display name, followed by the “@” character, followed by a fax number.

property primaryFaxNumber: str | None

Contains the number of the contact’s primary fax.

property primaryFaxOriginalDisplayName: str | None

The normalized subject for the contact.

property primaryFaxOriginalEntryId: EntryID | None

The one-off EntryID corresponding to this fax address.

property primaryTelephoneNumber: str | None

Contains the number of the contact’s primary telephone.

property profession: str | None

The profession of the contact.

property radioTelephoneNumber: str | None

Contains the number of the contact’s radio telephone.

property referenceEntryID: EntryID | None

Contains a value that is equal to the value of the EntryID of the Contact object unless the Contact object is a copy of an earlier original.

property referredByName: str | None

The name of the person who referred this contact to the user.

property spouseName: str | None

The name of the contact’s spouse.

property surname: str | None

The surname of the contact.

property tddTelephoneNumber: str | None

The telephone number for the contact’s text telephone (TTY) or telecommunication device for the deaf (TDD).

property telexNumber: str | List[str] | None

The contact’s telex number(s).

property userX509Certificate: List[bytes] | None

A list of certificates for the contact.

property weddingAnniversary: datetime | None

The wedding anniversary of the contact at 11:59 UTC.

property weddingAnniversaryEventEntryID: EntryID | None

The EntryID of an optional Appointement object that represents the contact’s wedding anniversary.

property weddingAnniversaryLocal: datetime | None

The wedding anniversary of the contact at 0:00 in the client’s local time zone.

property webpageUrl: str | None

The contact’s business web page url. SHOULD be the same as businessUrl.

property workAddress: str | None

The complete work address of the contact.

property workAddressCountry: str | None

The country portion of the contact’s work address.

property workAddressCountryCode: str | None

The country code portion of the contact’s work address.

property workAddressLocality: str | None

The locality or city portion of the contact’s work address.

property workAddressPostalCode: str | None

The postal code portion of the contact’s work address.

property workAddressPostOfficeBox: str | None

The number or identifier of the contact’s work post office box.

property workAddressStateOrProvince: str | None

The state or province portion of the contact’s work address.

property workAddressStreet: str | None

The street portion of the contact’s work address.

filename: str | None