1
0
Fork 0
mirror of https://github.com/fastogt/pyfastogt synced 2025-03-09 23:38:55 +00:00

Role emails

This commit is contained in:
topilski 2018-02-04 10:34:58 +03:00
parent 89655373d4
commit 39ab70f9ad

View file

@ -40,6 +40,20 @@ def is_valid_email(email: str) -> bool:
return True
def is_role_based_email(email: str) -> bool:
r = re.compile('([^@]+)@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$')
match = r.match(email)
if not match:
return False
start = match.group(1)
for x in ['noreply', 'support', 'admin']:
if start == x:
return True
return False
def read_file_line_by_line_to_list(file) -> list:
if not os.path.exists(file):
raise BuildError('file path: {0} not exists'.format(file))