Connection to the exchange server fails with some invalid error while fetching the password

321 Views Asked by At
  1. I have got the POP server and the IMAP server details for my exchange
    server. And i am able to connect to both using poplib.POP3_SSL(host,port) or imaplib.IMAP4_SSL(host,port).

  2. After that in case of imaplib when i use login method it throws an error -:

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib64/python2.7/imaplib.py", line 520, in login
    raise self.error(dat[-1])
    imaplib.error: LOGIN failed.

In case of poplib, it picks my email properly,

        import poplib
        m=poplib.POP3_SSL(host,port) ----works fine
        m.user('email_id') ----works fine gives me +OK
        m.pass_('password') ---it fails here and i know my password.
        Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/usr/lib64/python2.7/poplib.py", line 197, in pass_
        return self._shortcmd('PASS %s' % pswd)
        File "/usr/lib64/python2.7/poplib.py", line 160, in _shortcmd
        return self._getresp()
        File "/usr/lib64/python2.7/poplib.py", line 136, in _getresp
        raise error_proto(resp)
        poplib.error_proto: -ERR Logon failure: unknown user name or bad 
        password.

Is there any other reason it is failing ?

i just want a connection to be established.

I have seen the sync email settings and i can see they have both pop and imap enabled, i am able to do telnet as well. I have tried the maximum links shared so far on the similar questions in stack overflow.

I just want a connection to be established with the exchange server. so that i can login to my email server

0

There are 0 best solutions below