Once a listener is started and the subscription is started, lets say via
in your sample code
How do I retrieve the subscriptionid in order to unscubscribe when I have to?
In your sample code you made a perfect sample how to setup and construct the adapter, listener and subscription.
You also assume that when then code is stopped you still want to capture newmail messages on the CAS server and when you start the code you will retrieve them again.
This might not always be the case and causes the well - known 'unable to send...' error on the CAS server because the listener is destroyed, whether have you've saved in a stream capture like you did or did not save it to a file. If you have 200 subscriptions
your System Administrator would go crazy with this error. 7 attempts times 200!
Could you give some insight in a good destructor methodology for this?
Thanks in advance.