Skip to content
Snippets Groups Projects
Commit da88732c authored by Martin Mareš's avatar Martin Mareš
Browse files

Mail: Na falešné adresy neposíláme poštu

MAIL_INSTEAD nicméně má před tímto testem přednost.
parent a804ee0f
No related branches found
No related tags found
1 merge request!130Přísnější kontroly mailových adres
...@@ -12,6 +12,7 @@ import urllib.parse ...@@ -12,6 +12,7 @@ import urllib.parse
import mo.db as db import mo.db as db
import mo.config as config import mo.config as config
import mo.users
from mo.util import logger, ExceptionInfo from mo.util import logger, ExceptionInfo
...@@ -45,6 +46,10 @@ def send_email(send_to: str, full_name: str, subject: str, body: str) -> bool: ...@@ -45,6 +46,10 @@ def send_email(send_to: str, full_name: str, subject: str, body: str) -> bool:
if mail_instead is not None: if mail_instead is not None:
send_to = mail_instead send_to = mail_instead
if mo.users.email_is_fake(send_to):
logger.info('Mail: Neposíláme, adresa je falešná')
return True
sm = subprocess.Popen( sm = subprocess.Popen(
[ [
'/usr/sbin/sendmail', '/usr/sbin/sendmail',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment