Result Class

class email_normalize.Result(address, normalized_address, mx_records, mailbox_provider=None)[source]

Instances of the Result class contain data from the email normalization process.

Parameters
  • address (str) – The address that was normalized

  • normalized_address (str) – The normalized version of the address

  • mx_records (MXRecords) – A list of tuples representing the priority and host of the MX records found for the email address. If empty, indicates a failure to lookup the domain part of the email address.

  • mailbox_provider (str) – String that represents the mailbox provider name - is None if the mailbox provider could not be detected or was unsupported.

Note

If during the normalization process the MX records could not be resolved, the mx_records attribute will be an empty list and the mailbox_provider attribute will be None.

Example

@dataclasses.dataclass(frozen=True)
class Result:
    address = 'Gavin.M.Roy+ignore-spam@gmail.com'
    normalized_address = 'gavinmroy@gmail.com'
    mx_records =     [
        (5, 'gmail-smtp-in.l.google.com'),
        (10, 'alt1.gmail-smtp-in.l.google.com'),
        (20, 'alt2.gmail-smtp-in.l.google.com'),
        (30, 'alt3.gmail-smtp-in.l.google.com'),
        (40, 'alt4.gmail-smtp-in.l.google.com')
    ]
    mailbox_provider = 'Gmail'