handle hotmail complain for transactional email

This commit is contained in:
Son 2021-11-17 14:32:30 +01:00
parent 2ce7f3d445
commit 2b8de82028
3 changed files with 84 additions and 0 deletions

View File

@ -1392,6 +1392,13 @@ def handle_hotmail_complaint(msg: Message) -> bool:
orig_msg = get_orig_message_from_hotmail_complaint(msg)
to_header = orig_msg[headers.TO]
from_header = orig_msg[headers.FROM]
user = User.get_by(email=to_header)
if user:
LOG.d("Handle transactional hotmail complaint for %s", user)
handle_hotmail_complain_for_transactional_email(user)
return True
alias = None
# try parsing the from header which might contain the reverse alias
@ -1445,6 +1452,22 @@ def handle_hotmail_complaint(msg: Message) -> bool:
return True
def handle_hotmail_complain_for_transactional_email(user):
"""Handle the case when a transactional email is set as Spam by user or by HotMail"""
send_email_with_rate_control(
user,
ALERT_HOTMAIL_COMPLAINT,
user.email,
f"Hotmail abuse report",
render("transactional/hotmail-transactional-complaint.txt.jinja2", user=user),
render("transactional/hotmail-transactional-complaint.html", user=user),
max_nb_alert=1,
nb_day=7,
)
return True
def handle_yahoo_complaint(msg: Message) -> bool:
"""
Handle yahoo complaint sent to postmaster

View File

@ -0,0 +1,39 @@
{% extends "base.html" %}
{% block content %}
{% call text() %}
This is SimpleLogin team. <br>
Hotmail has informed us about an email sent to <b>{{ user.email }}</b> that might have been considered as spam,
either by you or by Hotmail spam filter.
{% endcall %}
{% call text() %}
Please note that explicitly marking a SimpleLogin's forwarded email as Spam
affects SimpleLogin email delivery,
has a negative effect for all users and is a violation of our terms and condition.
{% endcall %}
{% call text() %}
If somehow Hotmail considers a forwarded email as Spam, it helps us if you can move the email
out of the Spam folder. You can also set up a filter to avoid this
from happening in the future using this guide at
https://simplelogin.io/docs/getting-started/troubleshooting/
{% endcall %}
{% call text() %}
Please don't put our emails into the Spam folder. This can end up in your account being disabled on SimpleLogin.
{% endcall %}
{% call text() %}
Looking to hear back from you.
{% endcall %}
{% call text() %}
Best, <br/>
SimpleLogin Team.
{% endcall %}
{% endblock %}

View File

@ -0,0 +1,22 @@
Hi,
This is SimpleLogin team.
Hotmail has informed us about an email sent to {{ user.email }} that might have been considered as spam,
either by you or by Hotmail.
Please note that explicitly marking a SimpleLogin's forwarded email as Spam
affects SimpleLogin email delivery,
has a negative effect for all users and is a violation of our terms and condition.
If somehow Hotmail considers a forwarded email as Spam, it helps us if you can move the email
out of the Spam folder. You can also set up a filter to avoid this
from happening in the future using this guide at
https://simplelogin.io/docs/getting-started/troubleshooting/
Please don't put our emails into the Spam folder. This can end up in your account being disabled on SimpleLogin.
Looking to hear back from you.
Best,
SimpleLogin Team.