do not disable mailbox in sanity_check

This commit is contained in:
Son NK 2020-06-11 23:35:44 +02:00
parent 4ee38823b8
commit df47ea1983
1 changed files with 0 additions and 26 deletions

26
cron.py
View File

@ -285,32 +285,6 @@ def sanity_check():
LOG.d("Disable mailbox and all its aliases")
mailbox.verified = False
for alias in mailbox.aliases:
alias.enabled = False
db.session.commit()
email_msg = f"""Hi,
Your mailbox {mailbox.email} cannot receive emails.
To avoid forwarding emails to an invalid mailbox, we have disabled this mailbox along with all of its aliases.
If this is a mistake, please reply to this email.
Thanks,
SimpleLogin team.
"""
try:
send_email(
mailbox.user.email,
f"{mailbox.email} is disabled",
email_msg,
email_msg.replace("\n", "<br>"),
)
except Exception:
LOG.error("Cannot send disable mailbox email to %s", mailbox.user)
LOG.d("Finish sanity check")