From da88732cd6e8310d803ebfe5c458c10a6ba10543 Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Fri, 13 Jan 2023 20:57:22 +0100
Subject: [PATCH] =?UTF-8?q?Mail:=20Na=20fale=C5=A1n=C3=A9=20adresy=20nepos?=
 =?UTF-8?q?=C3=ADl=C3=A1me=20po=C5=A1tu?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

MAIL_INSTEAD nicméně má před tímto testem přednost.
---
 mo/email.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mo/email.py b/mo/email.py
index d2fa1572..1ce77aad 100644
--- a/mo/email.py
+++ b/mo/email.py
@@ -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',
-- 
GitLab