Improved email spam-score

This commit is contained in:
Mawoka
2024-03-12 14:21:27 +01:00
parent 8c6608ecd6
commit 65f3400f14
3 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -1,13 +1,12 @@
# SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
#
# SPDX-License-Identifier: MPL-2.0
import os
import smtplib
import ssl
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formatdate
from jinja2 import Environment, PackageLoader, select_autoescape
@@ -28,6 +27,7 @@ def _sendMail(template: str, to: str, subject: str):
msg["Subject"] = subject
msg["From"] = settings.mail_address
msg["To"] = to
msg["Date"] = formatdate(localtime=True)
msg.attach(MIMEText(template, "html"))
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
server = smtplib.SMTP(host=settings.mail_server, port=settings.mail_port)
@@ -3,6 +3,7 @@ SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
SPDX-License-Identifier: MPL-2.0
-->
<html>
<div style='box-sizing: border-box;display: block;max-width: 600px;margin: 0 auto;padding: 10px'><span
style='color: transparent;height: 0;max-height: 0;max-width: 0;opacity: 0;overflow: hidden;mso-hide: all;visibility: hidden;width: 0'>Let's confirm your email address.</span>
<div style='box-sizing: border-box;width: 100%;margin-bottom: 30px;margin-top: 15px'>
@@ -76,3 +77,4 @@ SPDX-License-Identifier: MPL-2.0
{% include 'footer.jinja2' %}
</div>
</html>
+2 -1
View File
@@ -3,7 +3,7 @@ SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
SPDX-License-Identifier: MPL-2.0
-->
<html>
<div style='box-sizing: border-box;display: block;max-width: 600px;margin: 0 auto;padding: 10px'><span
style='color: transparent;height: 0;max-height: 0;max-width: 0;opacity: 0;overflow: hidden;mso-hide: all;visibility: hidden;width: 0'>Let's confirm your email address.</span>
<div style='box-sizing: border-box;width: 100%;margin-bottom: 30px;margin-top: 15px'>
@@ -77,3 +77,4 @@ SPDX-License-Identifier: MPL-2.0
{% include 'footer.jinja2' %}
</div>
</html>