Small formatting and doc tweaks

This commit is contained in:
Reinhard Müller 2021-03-14 13:24:24 +01:00
parent cd47b2ef66
commit dbd0c1285d
3 changed files with 18 additions and 17 deletions

13
FAQ.md
View File

@ -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
465 or 587 is of any use here.
If your internet connection is within a dynamic range (often the case
for private use) or it doesn't have a proper reverse DNS entry, the
servers for many email domains will reject connections from you. This
can *not* be solved by using your provider's mail server. Instead, you
have to use the library on a machine with an internet connection with
static IP address and a proper reverse DNS entry.
If your internet connection is within an IP pool (often the case for
private use) or it doesn't have a proper reverse DNS entry, the servers
for many email domains (depending on their configuration) will reject
connections from you. This can *not* be solved by using your provider's
mail server. Instead, you have to use the library on a machine with an
internet connection with static IP address and a proper reverse DNS
entry.

View File

@ -175,10 +175,10 @@ class _SMTPChecker(SMTP):
def smtp_check(
email_address: EmailAddress, mx_records: List[str],
timeout: float = 10, helo_host: Optional[str] = None,
from_address: Optional[EmailAddress] = None, debug: bool = False
) -> bool:
email_address: EmailAddress, mx_records: List[str], timeout: float = 10,
helo_host: Optional[str] = None,
from_address: Optional[EmailAddress] = None, debug: bool = False
) -> bool:
"""
Returns `True` as soon as the any of the given server accepts the
recipient address.

View File

@ -27,12 +27,12 @@ simply accept everything and send a bounce notification later. Hence, a
def validate_email_or_fail(
email_address: str, *, check_format: bool = True,
check_blacklist: bool = True, check_dns: bool = True,
dns_timeout: float = 10, check_smtp: bool = True,
smtp_timeout: float = 10, smtp_helo_host: Optional[str] = None,
smtp_from_address: Optional[str] = None, smtp_debug: bool = False
) -> Optional[bool]:
email_address: str, *, check_format: bool = True,
check_blacklist: bool = True, check_dns: bool = True,
dns_timeout: float = 10, check_smtp: bool = True,
smtp_timeout: float = 10, smtp_helo_host: Optional[str] = None,
smtp_from_address: Optional[str] = None, smtp_debug: bool = False
) -> Optional[bool]:
"""
Return `True` if the email address validation is successful, `None`
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)
if check_blacklist:
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
mx_records = dns_check(email_address=email_address, timeout=dns_timeout)
if not check_smtp: