Flask-security: email sender

Created on 26 Jul 2017  路  4Comments  路  Source: mattupstate/flask-security

if set MAIL_DEFAULT_SENDER not set SECURITY_EMAIL_SENDER, email can't be sent.
In utils.py send_mail function:

msg = Message(subject,
              sender=_security.email_sender, 
              recipients=[recipient])`,

sender is a LocalProxy instance. So, mail.send(msg) will happen ValueError: too many values to unpack. Because in flask-mail sanitize_address function:

def sanitize_address(addr, encoding='utf-8'):
    if isinstance(addr, string_types):
        addr = parseaddr(force_text(addr))
    nm, addr = addr

addr is a LocalProxy instance. isinstance(addr, string_types) is False. So, nm, addr = addr goes wrong, ValueError: too many values to unpack.

Most helpful comment

Any roadmap for when master with fix to this problem will be release on pip?
Currently I have to manually install flask security with pip install git+https://github.com/mattupstate/flask-security, which doesn't get traced in Conda's environment definition.

All 4 comments

I'm in the same place you were when you wrote this. Any ideas on a fix?

A quick and short fix is ready to merge in this pull request:
https://github.com/mattupstate/flask-security/pull/695

Having the same problem. Would be nice to get this merged.

Any roadmap for when master with fix to this problem will be release on pip?
Currently I have to manually install flask security with pip install git+https://github.com/mattupstate/flask-security, which doesn't get traced in Conda's environment definition.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mafrosis picture mafrosis  路  7Comments

asmodehn picture asmodehn  路  4Comments

adamlwgriffiths picture adamlwgriffiths  路  5Comments

gbrindisi picture gbrindisi  路  5Comments

lormayna picture lormayna  路  5Comments