mirror of
https://github.com/simple-login/app.git
synced 2024-09-28 20:51:29 +02:00
make sure alias that starts with bounce prefix can't be automatically created
This commit is contained in:
parent
de23828df1
commit
6cb55e27f3
@ -4,7 +4,7 @@ from typing import Optional
|
||||
from email_validator import validate_email, EmailNotValidError
|
||||
from sqlalchemy.exc import IntegrityError, DataError
|
||||
|
||||
from app.config import BOUNCE_PREFIX_FOR_REPLY_PHASE
|
||||
from app.config import BOUNCE_PREFIX_FOR_REPLY_PHASE, BOUNCE_PREFIX
|
||||
from app.db import Session
|
||||
from app.email_utils import (
|
||||
get_email_domain_part,
|
||||
@ -37,6 +37,10 @@ def try_auto_create(address: str) -> Optional[Alias]:
|
||||
LOG.e("alias %s can't start with %s", address, BOUNCE_PREFIX_FOR_REPLY_PHASE)
|
||||
return None
|
||||
|
||||
if address.startswith(BOUNCE_PREFIX):
|
||||
LOG.e("alias %s can't start with %s", address, BOUNCE_PREFIX)
|
||||
return None
|
||||
|
||||
try:
|
||||
# NOT allow unicode for now
|
||||
validate_email(address, check_deliverability=False, allow_smtputf8=False)
|
||||
|
Loading…
Reference in New Issue
Block a user