mirror of
https://github.com/fastogt/pyfastogt
synced 2025-03-09 23:38:55 +00:00
Validate email mx
This commit is contained in:
parent
938821bc92
commit
1405506db2
1 changed files with 2 additions and 4 deletions
|
@ -7,6 +7,7 @@ import re
|
|||
import shutil
|
||||
import subprocess
|
||||
import tarfile
|
||||
from validate_email import validate_email
|
||||
from urllib.request import urlopen
|
||||
|
||||
|
||||
|
@ -34,10 +35,7 @@ class CompileInfo(object):
|
|||
|
||||
|
||||
def is_valid_email(email: str) -> bool:
|
||||
if not re.match('[^@]+@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', email):
|
||||
return False
|
||||
|
||||
return True
|
||||
return validate_email(email, check_mx=True)
|
||||
|
||||
|
||||
def is_role_based_email(email: str) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue