check if user and mailbox email address are lowercase in sanity_check

This commit is contained in:
Son NK 2020-06-11 23:36:06 +02:00
parent df47ea1983
commit 987b413e3d
1 changed files with 6 additions and 1 deletions

View File

@ -283,8 +283,13 @@ def sanity_check():
mailbox.nb_email_log(),
)
LOG.d("Disable mailbox and all its aliases")
for user in User.filter_by(activated=True).all():
if user.email.lower() != user.email:
LOG.error("%s does not have lowercase email", user)
for mailbox in Mailbox.filter_by(verified=True).all():
if mailbox.email.lower() != mailbox.email:
LOG.error("%s does not have lowercase email", mailbox)
LOG.d("Finish sanity check")