imap: Moved the calculation of SASL login details into a separate function
pop3: Moved the calculation of SASL login details into a separate function
smtp: Moved the calculation of SASL login details into a separate function