Ok, so I managed to fix it. I used $config['default_host'] = 'ssl://example.com'; and // TCP port used for IMAP connections $config['default_port'] = 993; No need for FQDN, just used same host as my mailservers certificate is pointing at. Could not get it to work with my offline testinviroment(where I got the error:Could not connect to ssl://example.com:993: Unknown reason) but now it is working live so I am happy