Frequently we are receiving disconnection from Imap Servers. The debug log shows these disconnections occur always after a TLS Alert. Any help to solve the question is welcome.
Follows the log:
2015-02-09 20:21:52.353 INFO MyImap(3)[27] Command: R00050 SELECT "INBOX/BOM DIA"
2015-02-09 20:21:52.353 DEBUG MyImap(3)[27] Info: State changed from 'Sending' to 'Reading'.
2015-02-09 20:21:52.534 INFO MyImap(3)[27] Response: * 159 EXISTS
2015-02-09 20:21:52.534 INFO MyImap(3)[27] Response: * 0 RECENT
2015-02-09 20:21:52.534 INFO MyImap(3)[27] Response: * OK [UNSEEN 7] mailbox contains unseen messages
2015-02-09 20:21:52.534 INFO MyImap(3)[27] Response: * OK [UIDVALIDITY 60516] UIDs are valid for this mailbox
2015-02-09 20:21:52.534 INFO MyImap(3)[27] Response: * OK [UIDNEXT 48336] next expected UID is 48336
2015-02-09 20:21:52.534 INFO MyImap(3)[27] Response: * FLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded $MDNSent Forwarded $Junk $NotJunk Junk JunkRecorded NonJunk NotJunk)
2015-02-09 20:21:52.534 INFO MyImap(3)[27] Response: * OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded $MDNSent Forwarded \*)] junk-related flags are not permanent
2015-02-09 20:21:52.534 INFO MyImap(3)[27] Response: * OK [HIGHESTMODSEQ 152320] modseq tracked on this mailbox
2015-02-09 20:21:52.534 INFO MyImap(3)[27] Response: R00050 OK [READ-WRITE] SELECT completed
2015-02-09 20:21:52.534 DEBUG MyImap(3)[27] Info: State changed from 'Reading' to 'Ready'.
2015-02-09 20:21:52.535 DEBUG MyImap(3)[27] Info: State changed from 'Ready' to 'Sending'.
2015-02-09 20:21:52.535 INFO MyImap(3)[27] Command: R00051 UID FETCH 32599 (UID BODY[])
2015-02-09 20:21:52.535 DEBUG MyImap(3)[27] Info: State changed from 'Sending' to 'Reading'.
2015-02-09 20:21:54.769 INFO MyImap(3)[27] Response: * 109 FETCH (UID 32599 BODY[] {720663}
2015-02-09 20:21:54.953 INFO MyImap(3)[27] TLS: Alert Alert:Alert was received.
2015-02-09 20:21:54.953 INFO MyImap(3)[27] TLS: Alert Alert:Alert was sent.
2015-02-09 20:21:54.953 INFO MyImap(3)[27] TLS: State StateChange:Closed
2015-02-09 20:21:54.953 DEBUG MyImap(3)[27] Info: Connection closed.
2015-02-09 20:21:54.960 ERROR MyImap(3)[27] Info: Rebex.Net.ImapException: The server has closed the connection.
at Rebex.Net.WM.JB(Byte[] A, Int32 B, Int32 C)
at Rebex.Net.WM.HB(Byte[] A, Int32 B, Int32 C)
at Rebex.Net.Imap.FU(String A, ArrayList B)
at Rebex.Net.Imap.CM(String A, VM B, String C, Boolean D)
at Rebex.Net.Imap.LU(ImapMessageSet A, Int32 B, UInt32 C, Boolean D, String E)
at Rebex.Net.Imap.MU(ImapMessageCollection A, ImapMessageSet B, Int32 C, UInt32 D, Boolean E, String H, Int64 I)
at Rebex.Net.Imap.LV(ImapMessageSet A, Int32 B, Boolean C, Int64 D, Int32 E)
2015-02-09 20:23:38.078 DEBUG MyImap(3)[27] TLS: Closing TLS socket.
2015-02-09 20:23:38.078 DEBUG MyImap(3)[27] Info: State changed from 'Reading' to 'Disconnected'.