bertjohnson / OpaqueMail

.NET email library and proxy supporting IMAP, POP3, and SMTP with S/MIME and PGP.

Home Page:https://opaquemail.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timeout on ImapClient.Connect

Maritims opened this issue · comments

When attempting to connect with ImapClient.Connect and SSL set to false the connection will hang indefinitely. No exception is thrown.

I attempted to connect to outlook.office365.com, port 993 with a wrong username and password to provoke an exception, but nothing happens. It just hangs.

It would be useful to have the possibility to configure a timeout aswell as have an exception thrown if a connection cannot be established.

Thanks for the report, Maritims. You're absolutely right -- connecting without SSL on servers expecting SSL led to an indefinite hang.

I've added a timeout parameter (number of milliseconds to wait for a response before failing) to the ImapClient and Pop3Client Connect() methods in OpaqueMail 2.3.0. An exception is thrown if unable to connect.

Thanks!