My question is different. Should destroy() be enough already? In the context of the node-imap ticket I linked to. IMHO it should be enough - but the process hangs! Test app: a batch node.js app that connects to an IMAP server (gmail) with deliberately wrong credentials, causing an error on login, causing this line to be executed:
NOTE THAT THIS HAS JUST BEEN PATCHED because of my bug report, using my solution - until an hour ago that line said "destroy()" which left the node.js process hanging. With end() I get my command line back, after all, the node.js app has finished, nothing left to do.
I think it is a bug that destroy() does not work?