private void collectMails()  {
        int count;
        String line;

        sendToMailbox("STAT ");
        String[] request = readFromMailbox().split(" ");


        if (request[0].startsWith("+OK") && request[1] != null) {
            count = Integer.parseInt(request[1]);
            line = "";
        } else {
            return;
        }

        String messageFromServer;
        for (int i = 1; i <= count; i++) {
            sendToMailbox("RETR " + i);
            messageFromServer = readFromMailbox();

            //if RETR accept - Save Mail to HDD and delete from Mailbox
            if (messageFromServer.trim().startsWith("+OK")) {

                while (!(messageFromServer = readFromMailbox()).equals(".")) {
                    line = line + messageFromServer + CRLF;
                }

                line = line + messageFromServer + CRLF;

                //Save mail to HDD
                mailManager.saveNeuMail(konto.getUser(), konto.getHost(), line);

                //Delete mail from Mailbox
                sendToMailbox("DELE " + i);
                messageFromServer = readFromMailbox();
                if (!messageFromServer.startsWith("+OK")) {
                    try {
                        logfile.update(" !!! Message " + count + "couldn't be deleted");
                    } catch (FileNotFoundException e) {
                        System.out.println("Logfile not found");
                    }
                }
            }
        }
    }