email_validator - Man Page

email_validator – Validate email addresses

Synopsis

email_validator test@example.org

email_validator < LIST_OF_ADDRESSES.TXT

Description

Provide email addresses to validate either as a command-line argument or in STDIN separated by newlines. Validation errors will be printed for invalid email addresses. When passing an email address on the command line, if the email address is valid, information about it will be printed. When using STDIN, no output will be given for valid email addresses.

Keyword arguments to the Python email_validator.validate_email function can be set in environment variables of the same name but uppercase (see Environment).

Environment

Boolean

For these environment variables, any non-empty string value is interpreted as True, the empty string is interpreted as False, and a default value is used if the variable is unset.

ALLOW_SMPTUTF8

Set to false to prohibit internationalized addresses that would require the SMTPUTF8 extension.

default: true

ALLOW_QUOTED_LOCAL

Set to true to allow obscure and potentially problematic email addresses in which the part of the address before the @-sign contains spaces, @-signs, or other surprising characters when the local part is surrounded in quotes (so-called quoted-string local parts). In the object returned on successful validation, the normalized local part removes any unnecessary backslash-escaping and even removes the surrounding quotes if the address would be valid without them.

default: false

ALLOW_DOMAIN_LITERAL

Set to true to allow bracketed IPv4 and "IPv6:"-prefixed IPv6 addresses in the domain part of the email address. No deliverability checks are performed for these addresses. In the object returned on successful validation, the normalized domain will use the condensed IPv6 format, if applicable. The object’s domain_address attribute will hold the parsed ipaddress.IPv4Address or ipaddress.IPv6Address object if applicable.

default: false

GLOBALLY_DELIVERABLE

default: true

CHECK_DELIVERABILITY

If true, DNS queries are made to check that the domain name in the email address (the part after the @-sign) can receive mail—basically, that the domain name in the email address has a (non-Null) DNS MX record indicating that it can receive email. If false, skip this DNS-based check. It is recommended to set this to false when performing validation for login pages (but not account creation pages) since re-validation of a previously validated domain in your database by querying DNS at every login is probably undesirable.

default: true

TEST_ENVIRONMENT

If true, DNS-based deliverability checks are disabled and test and **.test domain names are permitted.

default: false

Floating-Point

For these environment variables, any non-empty string is parsed as a floating-point value, and a default value is used if the variable is unset.

DEFAULT_TIMEOUT

default: 15

Info

June 2024