def popauth(popHost, user, passwd): 
    """ 
    Log in and log out, only to verify user identity. 
    Raise exception in case of failure. 
    """ 
    import poplib 
    try: 
        pop = poplib.POP3(popHost) 
    except: 
        raise StandardError, "Could not establish connection "+\ 
                             "to %s for password check" % popHost
 
    Log in and log out, only to verify user identity. 
    Raise exception in case of failure. 
    
recipes/Python/203610_Authenticate_users_through_third_party/recipe-203610.py