                                 job.progress mailsDone, results.length
 
                                 if mailsDone is results.length
-                                    callback()
+                                    localCallback()
                                 else
                                     fetchOne(server, i + 1, results, mailsDone)
 

            unless results.length
                @log "Nothing to download"
                server.logout (err) ->
                    callback err
            else
                @log "#{results.length} mails to download"
                LogMessage.createImportInfo results, @, ->

    # global vars
    mailbox = @
 
    @openInbox (err, server) ->
        return emitOnErr server, err if err
        loadInboxMails server
              
    emitOnErr = (server, err) ->
        if err
