awangga/outlook

sign in issue

lokesh1233 opened this issue · 8 comments

it is showing only sign in multiple times in console

Sign In ...
Sign In ...

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

Same here, it loops and only shows sign in.

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

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

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.

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.

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

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.