Small formatting and doc tweaks
This commit is contained in:
parent
cd47b2ef66
commit
dbd0c1285d
13
FAQ.md
13
FAQ.md
|
@ -62,9 +62,10 @@ This module, however, directly talks to the *recipient's* server for
|
||||||
*incoming* emails, so neither your credentials nor the switch to port
|
*incoming* emails, so neither your credentials nor the switch to port
|
||||||
465 or 587 is of any use here.
|
465 or 587 is of any use here.
|
||||||
|
|
||||||
If your internet connection is within a dynamic range (often the case
|
If your internet connection is within an IP pool (often the case for
|
||||||
for private use) or it doesn't have a proper reverse DNS entry, the
|
private use) or it doesn't have a proper reverse DNS entry, the servers
|
||||||
servers for many email domains will reject connections from you. This
|
for many email domains (depending on their configuration) will reject
|
||||||
can *not* be solved by using your provider's mail server. Instead, you
|
connections from you. This can *not* be solved by using your provider's
|
||||||
have to use the library on a machine with an internet connection with
|
mail server. Instead, you have to use the library on a machine with an
|
||||||
static IP address and a proper reverse DNS entry.
|
internet connection with static IP address and a proper reverse DNS
|
||||||
|
entry.
|
||||||
|
|
|
@ -175,10 +175,10 @@ class _SMTPChecker(SMTP):
|
||||||
|
|
||||||
|
|
||||||
def smtp_check(
|
def smtp_check(
|
||||||
email_address: EmailAddress, mx_records: List[str],
|
email_address: EmailAddress, mx_records: List[str], timeout: float = 10,
|
||||||
timeout: float = 10, helo_host: Optional[str] = None,
|
helo_host: Optional[str] = None,
|
||||||
from_address: Optional[EmailAddress] = None, debug: bool = False
|
from_address: Optional[EmailAddress] = None, debug: bool = False
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""
|
"""
|
||||||
Returns `True` as soon as the any of the given server accepts the
|
Returns `True` as soon as the any of the given server accepts the
|
||||||
recipient address.
|
recipient address.
|
||||||
|
|
|
@ -27,12 +27,12 @@ simply accept everything and send a bounce notification later. Hence, a
|
||||||
|
|
||||||
|
|
||||||
def validate_email_or_fail(
|
def validate_email_or_fail(
|
||||||
email_address: str, *, check_format: bool = True,
|
email_address: str, *, check_format: bool = True,
|
||||||
check_blacklist: bool = True, check_dns: bool = True,
|
check_blacklist: bool = True, check_dns: bool = True,
|
||||||
dns_timeout: float = 10, check_smtp: bool = True,
|
dns_timeout: float = 10, check_smtp: bool = True,
|
||||||
smtp_timeout: float = 10, smtp_helo_host: Optional[str] = None,
|
smtp_timeout: float = 10, smtp_helo_host: Optional[str] = None,
|
||||||
smtp_from_address: Optional[str] = None, smtp_debug: bool = False
|
smtp_from_address: Optional[str] = None, smtp_debug: bool = False
|
||||||
) -> Optional[bool]:
|
) -> Optional[bool]:
|
||||||
"""
|
"""
|
||||||
Return `True` if the email address validation is successful, `None`
|
Return `True` if the email address validation is successful, `None`
|
||||||
if the validation result is ambigious, and raise an exception if the
|
if the validation result is ambigious, and raise an exception if the
|
||||||
|
@ -43,7 +43,7 @@ def validate_email_or_fail(
|
||||||
regex_check(email_address=email_address)
|
regex_check(email_address=email_address)
|
||||||
if check_blacklist:
|
if check_blacklist:
|
||||||
domainlist_check(email_address=email_address)
|
domainlist_check(email_address=email_address)
|
||||||
if not (check_dns or check_smtp): # check_smtp implies check_dns.
|
if not check_dns and not check_smtp: # check_smtp implies check_dns.
|
||||||
return True
|
return True
|
||||||
mx_records = dns_check(email_address=email_address, timeout=dns_timeout)
|
mx_records = dns_check(email_address=email_address, timeout=dns_timeout)
|
||||||
if not check_smtp:
|
if not check_smtp:
|
||||||
|
|
Loading…
Reference in New Issue