def email_associated(env, email):
    """Returns whether an authenticated user account with that email address
    exists.
    """
    with env.db_query as db:
        cursor = db.cursor()
        cursor.execute("""
            SELECT value
              FROM session_attribute
             WHERE authenticated=1 AND name='email' AND value=%s
            """, (email,))
        for row in cursor:
            return True
    return False