 Account::imap_fetchMails = (limitByBox, onlyFavorites = false, callback) ->
     log.debug "account#imap_fetchMails", limitByBox, onlyFavorites
     account = this
+    @setRefreshing true
 
     @imap_refreshBoxes (err, toFetch, toDestroy) ->
 

        async.eachSeries accounts, (account, cb) ->
            log.debug "refreshing account #{account.label}"
            return cb null if account.isTest()
            account.imap_fetchMails limit, onlyFavorites, cb
        , callback




Account::doASAP = (operation, callback) ->
    ImapPool.get(@id).doASAP operation, callback

Account::isTest = ->
    @accountType is 'TEST'

Account::isRefreshing = ->
    ImapPool.get(@id).isRefreshing

Account::setRefreshing = (value) ->
    ImapPool.get(@id).isRefreshing = value

# Public: refresh all accounts
#
