I am having a bit of trouble getting imap streams to persist.
I am working on a web email application, and I would like to avoid opening a new imap connection for every time I need information from the imap server. I tried storing the imap stream as a global variable, and once its instantiated, use that stream instead of opening a new one.
the problem is that when a different function attempts to open an imap connection the global stream is reported as to not contain a valid stream pointer.
is there a way to get the stream will remain available for the other functions?