snipsco / Postal

A Swift framework for working with emails
MIT License
652 stars 81 forks source link

How do you check if I have a session connected? #63

Open dai-cb opened 7 years ago

dai-cb commented 7 years ago

Related: How can I logout?

jeremiegirault commented 7 years ago

Hi @dai-cb,

First I'm very happy that coinbase is interested by Postal :-)

The Postal instance is keeping alive an IMAPSession which itself keeps an instance of libetpan mailimap. I don't know about the internals but libetpan seem to maintain an open socket.

There is currently no method in Postal class to obtain this state. It may be available from libetpan but actually it may be easy to implement without it. If you release the Postal instance, the session will be disconnected.