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
Branches
No related tags found
1 merge request!130Přísnější kontroly mailových adres
This commit is part of merge request !130. Comments created here will be created in the context of that merge request.
......@@ -12,6 +12,7 @@ import urllib.parse
import mo.db as db
import mo.config as config
import mo.users
from mo.util import logger, ExceptionInfo
......@@ -45,6 +46,10 @@ def send_email(send_to: str, full_name: str, subject: str, body: str) -> bool:
if mail_instead is not None:
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(
[
'/usr/sbin/sendmail',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment