def server_login(host, port, ssl, user): """Login to the server """ # Get the password passwd = getpass.getpass('Password: ') # Login to the server: M = ImapServer(host, port, ssl) M.login(user, passwd) return M
def serverLogin(request): """Login to the server """ # Login to the server: M = ImapServer(host=request.session['host'], port=request.session['port'], ssl=request.session['ssl']) try: M.login(request.session['username'], request.session['password']) return M except: # TODO: The server can for some reason fail to login the user during a # normal session. # An exception should be raised here descriptive enough of what's # going on. Gmail's imap can for instance answer all requests with: # NO [ALERT] Too many simultaneous connections. (Failure) raise Http404
def serverLogin( request ): """Login to the server """ # Login to the server: M = ImapServer(host=request.session['host'],port=request.session['port'], ssl= request.session['ssl']) try: M.login(request.session['username'], request.session['password']) return M except: # TODO: The server can for some reason fail to login the user during a # normal session. # An exception should be raised here descriptive enough of what's # going on. Gmail's imap can for instance answer all requests with: # NO [ALERT] Too many simultaneous connections. (Failure) raise Http404