Working connection to imap with externalized configuration