0
  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

Tusharg
  • 1
  • 1
  • Can you actually login with telnet? They might be blocking plaintext logins. – Max Nov 12 '19 at 22:16
  • I am not sure they are blocking it because i am able to do a telnet – Tusharg Nov 13 '19 at 07:44
  • i will add some more inormation, in case it helps . conn=poplib.POP3_SSL(...) creates the connection object conn.getwelcome() ....this returns that POP3 exchange server is ready conn.user('username') works fine conn.pass_('password')...it fails here after this i checked the poplib.py file and looked for this method and found out that the calling of the code is something like -: conn.pass_() > conn._shortcmd() > conn._getresp() >conn._getline() >conn.file.readline() – Tusharg Nov 13 '19 at 09:24
  • this seems to be returning the response from the server....this is the actual step where i am getting '' instead of some valid response which is failing and raising the _proto error. This is based on my debugging. – Tusharg Nov 13 '19 at 09:24

0 Answers0