0 votes

We have a user who is getting the following exception:

Error connecting to Imap server (Server closed the connection.).
---> Limilabs.Client.ServerException: Server closed the connection.
at Limilabs.Client.IMAP.ImapResponse.(TextReader )
at Limilabs.Client.IMAP.Imap.GetServerGreeting()

On this line in our code:

List<MessageInfo> infos = imap.GetMessageInfoByUID(uids);

When connecting to a Company Gmail Inbox.

He is able to list the folders OK so I believe his credentials, server, SSL etc. are working.

Is this something you could advise on?

by

1 Answer

0 votes

The first thing you should do is turn on logging:
https://www.limilabs.com/blog/logging-in-mail-dll

He is able to list the folders

This makes no sense.

The stack trace shows the exception is thrown from GetServerGreeting method.
This is the first method, that is invoked by an Mail.dll IMAP client after the connection is established.

It is impossible for them to list folders and then get this exact exception.

The only thing that comes to my mind is, that they can connect and everything is working most times, but this exception happens sometimes.

There may be many reasons for such IMAP server behavior.

The most probable is, that the server doesn't like them connecting so frequently and it simply disconnects, as soon as the connection is established (it recognizes the client by IP).

by (297k points)
...