mirror of
https://github.com/fastogt/pyfastogt
synced 2025-03-09 23:38:55 +00:00
Role emails
This commit is contained in:
parent
89655373d4
commit
39ab70f9ad
1 changed files with 14 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue