Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pop3Client.IsOkResponse throws exception on successful authentication #77

Open
ethan-voon opened this issue Jan 7, 2019 · 2 comments
Open

Comments

@ethan-voon
Copy link

Hi all,

I use a Pop3Client during some of my tests and every once in awhile authentication of the client fails with this exception:

System.InvalidOperationException : Error setting up tests
  ----> OpenPop.Pop3.Exceptions.InvalidLoginException : Server did not accept user credentials
  ----> OpenPop.Pop3.Exceptions.PopServerException : The server did not respond with a + response. The response was: "\u0017\u0003\u0003\u0000P+OK Logged in."

It looks like the client's only check is for the '+' and does not take into account the possibility of these control characters being read by the stream and ignore that the authentication was successful.

If it is preferred for StreamUtility.ReadLineAsBytes to include control characters, then an update to IsOkResponse would make sense.

Thoughts?

@MaiconLL
Copy link

same problem here.

"The server did not respond with a + response. The response was: "* OK inetserver.hos.com.br Zimbra IMAP4rev1 server ready""

my code

Using client As New OpenPop.Pop3.Pop3Client() client.Connect("mail.hos.com.br", 143, False) client.Authenticate(usuario, senha) Dim messageCount As Integer = client.GetMessageCount() Dim allMessages As New List(Of OpenPop.Mime.Message)(messageCount) For i As Integer = messageCount To 1 Step -1 allMessages.Add(client.GetMessage(i)) Next End Using

@jstedfast
Copy link

@MaiconLL Your problem is different from @123than's problem.

The problem you are having is that you are trying to connect to an IMAP server using a POP3 client.

If the server doesn't support POP3 on port 110 (instead of 143 for IMAP), I would recommend trying MailKit instead and using the ImapClient class.

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants