Return port and factory from the imap launch method
Merge remote-tracking branch 'chiiph/bug/imap_return_factory_and_port' into develop