We were using an interface id instead of a class id in the call to create instance for the protocol so I fixed that. We don't need netService so I removed the code for that. We were also confusing an imap4service with the core netlib service (nsINetService). Release the protocol instead of deleting it in the protocol. Insert breaks in the switch statements for ::ReadAndDispatchCommand. Release the event queue service when we are done with it.
use new intialize method from the interface which takes an event queue. The constructor for a component that supports an interface must always be empty so remove the dependency on the event queue. Rename old Initialize method to SetupwithUrl.