I have the following line of code using imaplib
M = imaplib.IMAP4('smtp.gmail.com', 587)
I get the following error from imaplib: abort: unexpected response: '220 mx.google.com ESMTP o13sm12303588vde.21'
However from reading elsewhere, it seems that that response is the correct response demonstrating that the connection was made to the server successfully at that port.
Why is imaplib giving this error?