awangga / outlook

Python library to read email from live, hotmail, outlook, office365 or any microsoft email service
347 stars 135 forks source link

sign in issue #14

Open lokesh1233 opened 7 years ago

lokesh1233 commented 7 years ago

it is showing only sign in multiple times in console

Sign In ... Sign In ...

gabemarshall commented 7 years ago

Same here.. were you ever able to figure out the issue?

fhamidkhan commented 7 years ago

Same here, it loops and only shows sign in.

rtruxal commented 7 years ago

K so I just found this, experienced the same thing, but do not have time to dig into imaplib library. Hopfully putting a finger on the issue will help someone else fix it. See the below description + inline comments.

What everyone here is experiencing happens b/w lines 17-30. An exception is getting thrown...:

def login(self, username, password):
        self.username = username
        self.password = password
        while True:
            try:
                #########################
                #  RIGHT IN HERE SOMEWHERE.
                self.imap = imaplib.IMAP4_SSL(config.imap_server,config.imap_port)
                r, d = self.imap.login(username, password)
                assert r == 'OK', 'login failed'
                print(" > Sign as ", d)
                #########################
            except: # <=======CAUSING THIS TO CATCH,
                print(" > Sign In ...")
                continue # <====FOREVER
            # self.imap.logout()
            break
ghandic commented 6 years ago

Try adding a shbang to the config file eg:

!/usr/bin/env python

imap_server = "imap-mail.outlook.com" imap_port = 993 smtp_server = "smtp-mail.outlook.com" smtp_port = 587

dwightyy commented 6 years ago

I'm with the same problem.. I'am trying to use via cloud9 in my workplace and it gave me this loop, but when i tried at home in Ubuntu 16 it worked normally.

princeatul commented 6 years ago

It is also giving me the "Sign in" loop. I also tried it on a different network and still getting the same issue. I am trying it on a windows system.

mcast123 commented 6 years ago

I just copied the config data to the main file and changed the references. It's working fine now!

rtruxal commented 6 years ago

Comments from @mcast123 and @ghandic fixed my problem.

imap_server & imap_port were throwing NameErrors, meaning the env-variables shown in @ghandic's post weren't accessible to the program.