Try ssl first, and then network for IMAP connections.