Work around a bug in flask-mail