     return options
 
 
-
+# create a node-imap config for this account
 module.exports.makeIMAPConfig = (account, callback) ->
 
     if account.oauthProvider is "GMAIL"

            accessToken: account.oauthAccessToken
            timeout: timeout

        generator.on 'token', ({user, accessToken, timeout}) ->
            account.updateAttributes
                oauthAccessToken: accessToken


    return xOAuthCache[account.id]


# force the generator to create a new access token
# used when the connection fail in imap
# (smtp calls the generateToken function directly)
module.exports.forceOauthRefresh = (account, callback) ->
    log.info "FORCE OAUTH REFRESH"
    getXoauth2Generator(account).generateToken callback


# create a nodemailer config for this account
module.exports.makeSMTPConfig = (account) ->
    options =
        port: account.smtpPort
