亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? imap4.java

?? 手機(jī)郵箱撒的方式方式方式的
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
            }
            reply = execute("LOGIN " + '"' + account.getUserName() + '"' + " " + '"' + account.getPassword() + '"', true);
            if (!reply.startsWith("OK")) {
                getReportBox().report("100: " + Lang.get(Lang.PL_NOTAUTHORIZED), SOURCE_FILE);
                return false;
            }

            if (task != null) { task.setTitle(Lang.get(Lang.ALRT_PL_CONNECTING) + account.getEmail() + Lang.get(Lang.SUCCESS)); }
            if (getTargetBox() != null && !getTargetBox().isPushActive()){
                connectionKeeper = new Timer();
                connectionKeeper.scheduleAtFixedRate(new Keeper(), Settings.noopIMAPPeriod, Settings.noopIMAPPeriod);
            }

            //#ifdef MUJMAIL_COMPRESSED_CONNECTION
            //if (isMujMailServer)
                //((ConnectionCompressed)connection).changeCompression( ConnectionCompressed.COMPRESSION_TYPE_GZIP);
            //#endif
            return true;

        } catch (MyException e) {
            e.printStackTrace();
            if (task != null) { task.setTitle(Lang.get(Lang.ALRT_PL_CONNECTING) + account.getEmail() + Lang.get(Lang.FAILED)); }
            throw e;
        } catch (Exception e) {
            e.printStackTrace();
            if (task != null) { task.setTitle(Lang.get(Lang.ALRT_PL_CONNECTING) + account.getEmail() + Lang.get(Lang.FAILED)); }
            e.printStackTrace();
            throw new MyException(MyException.COM_UNKNOWN, "100: " + e);
        }
    }

    private boolean selectMailBox(String box) throws MyException {
        String tag = execute("SELECT \"" + box + "\"", false);
        sld_mailBox_uidval = null; //SELECT automatically deselects currently selected mailbox
        String reply, uidvalidity = "";
        while (!(reply = connection.getLine()).startsWith(tag)) {
            if (reply.indexOf("[UIDVALIDITY") != -1) {
                uidvalidity = reply.substring(reply.indexOf("[UIDVALIDITY") + 13).trim();
                uidvalidity = uidvalidity.substring(0, uidvalidity.indexOf(']')).trim();
            }
        }
        if (reply.startsWith(tag + "OK")) {
            sld_mailBox_uidval = box + MessageHeader.MSG_ID_SEPARATOR_STR + uidvalidity + MessageHeader.MSG_ID_SEPARATOR_STR;
            return true;
        }
        return false;
    }

        // Note task can be null (background Keeper task)
    protected synchronized void _close(BackgroundTask task, boolean waitForReply) {
        if (!connection.isConnected()) {
            return;
        }
        if (task != null) { task.setTitle(Lang.get(Lang.ALRT_PL_CLOSING) + account.getEmail()); }
        if (connectionKeeper != null) {
            connectionKeeper.cancel();
        }
        connectionKeeper = null;
        forcedDisc = false;
        sld_mailBox_uidval = null;
        try {
            execute("CLOSE", waitForReply);
            execute("LOGOUT", waitForReply);
        } catch (MyException e) {
            if (task != null) { task.setTitle(Lang.get(Lang.ALRT_PL_CLOSING) + account.getEmail() + ": " + e.getDetails()); }
        }
        try {
            connection.close();
        } catch (Exception e) {
            if (task != null) { task.setTitle(Lang.get(Lang.ALRT_PL_CLOSING) + account.getEmail() + ": " + e); }
        }
        isMujMailServer = false;
        if (task != null) { task.setTitle(Lang.get(Lang.ALRT_PL_CLOSING) + account.getEmail() + Lang.get(Lang.SUCCESS)); }
    }

    protected void findFirstNewMailWhilePolling() throws MyException {
        Vector newMails = searchMailsMatching("UNSEEN");
        for (int i = newMails.size(); i > 0; --i) {
            String ID = (String) newMails.elementAt(i - 1);
            if (handleMailDiscoveredByPolling(ID)) break;
        }
    }

    protected void getNewMails() {
        // TODO: data overheads when we want to receive only X new mails?
        // check out countNew(), while (actual < max) {...} and
        //  while (actual > 0) {..}
        // the same is in POP3

        try {
            long startTime = System.currentTimeMillis();
              if (DEBUG) { System.out.println("STARTING GET_NEW_MAILS"); }
            if (!open(inProtocolTask)) { //in case of server->inbox sync we need to notify about this error
                //otherwise the synchronization will think that no mails are on the server
                //throw new MyException(MyException.PROTOCOL_CANNOT_CONNECT);
            	return;
            }
              if (DEBUG) { System.out.println("OPEN FINISHED"); }
            if (getTargetBox().isSyncRunning()) {
                mailsOnServer.clear();
            }//we need to recreate a new mailsOnServer lists
            //if its server->inbox sync is called then we want all mails
            //otherwise we just want to check new mails
            String criterium = getTargetBox().isSyncRunning() ? "ALL" : "UNSEEN";
            inProtocolTask.setTitle(Lang.get(Lang.ALRT_INPL_CHECK_MAILS) + account.getEmail());
            MessageHeader header;
            String mailBoxes = account.getIMAPPprimaryBox();
            if (!mailBoxes.endsWith(",")) {
                mailBoxes += ",";
            }

            Vector tempStorage = new Vector();
            while (mailBoxes.length() != 0) {
                //choose next mailbox
                String sld_box = mailBoxes.substring(0, mailBoxes.indexOf(','));
                //define what's the next mailbox
                mailBoxes = mailBoxes.substring(sld_box.length() + 1);
                //if selecting a mailbox is unsuccessful skip to the next one
                if (!selectMailBox(sld_box)) {
                	inProtocolTask.setTitle(Lang.get(Lang.ALRT_PL_CONNECTING) + account.getEmail() + ": " + sld_box + Lang.get(Lang.FAILED));
                    continue;
                }
                Vector newMails = new Vector();
                Vector fetchTags = new Vector();
                String fetchTag;
                //let's find UIDs of mails
                Vector tmp = searchMailsMatching(criterium);
                for (int i = 0; i < tmp.size(); ++i) {

                	if (!targetBox.isSyncRunning() &&
                		Settings.maxMailsRetrieve > 0 && i >= Settings.maxMailsRetrieve) //limit exceeded
                    {
                        break;
                    }

                    header = new MessageHeader(getTargetBox());
                    header.setMessageID(sld_mailBox_uidval + tmp.elementAt(i));
                    header.setIMAPFolder(sld_box);
                    newMails.addElement(header); //mark it to potentially new mails

                    if (inProtocolTask.stopped()) {
                    	_close(inProtocolTask, false);
                        return;
                    }
                }
                /* Memory management */
                tmp = null;
                System.gc();
                
                int n = 0;
                inProtocolTask.updateProgress(newMails.size(), 0);
                //for all potentially new mails, the newest first
                for (int actual = newMails.size() - 1; actual >= 0; --actual) {
                    header = (MessageHeader) newMails.elementAt(actual);
                    //let's remember that this mail is stored on the server
                    mailsOnServer.put(header.getMessageID(), String.valueOf(actual));
                    getTargetBox().newMailOnServer(); //increase synchronization counter

                    if (!targetBox.wasOnceDownloaded(account.getEmail(), header.getMessageID())) {
                        fetchTag = execute("UID FETCH " + parseUID(header.getMessageID()) + " (RFC822.SIZE FLAGS)", false);
                        if (!Settings.downWholeMail || Settings.safeMode) {
                            execute("UID FETCH " + parseUID(header.getMessageID()) + " (RFC822.HEADER)", false);
                        } else {
                            execute("UID FETCH " + parseUID(header.getMessageID()) + " (RFC822)", false);
                        }
                        fetchTags.addElement(fetchTag);
                        ++n;
                        if (Settings.maxMailsRetrieve > 0 && n >= Settings.maxMailsRetrieve) //limit exceeded
                        {
                            break;
                        }
                    }
                    else {
                    	newMails.removeElementAt(actual);
                        inProtocolTask.incActual(1);
                    }

                    if (inProtocolTask.stopped()) {
                        break;
                    }

                }
                int j = fetchTags.size() - 1;
                n = newMails.size() - n; //we will parse only mails whose size and header were required
                for (int actual = newMails.size() - 1; actual >= n; --actual) { //now lets parse new mails' headers
                    header = (MessageHeader) newMails.elementAt(actual);
                    fetchTag = (String) fetchTags.elementAt(j--);
                    String line = "";
                    do {
                        //skip useless lines of previous iteration or of fetch response
                        //until we get tagged BAD or NO response or good UID response
                        line = connection.getLine();
                          if (DEBUG) System.out.println( "DEBUG IMAP4.getNewMails() - line: " + line ); 
                    } while (!(line.startsWith(fetchTag) || line.indexOf("UID " + parseUID(header.getMessageID())) != -1));
                    if (line.startsWith(fetchTag)) { //bad response
                    	inProtocolTask.setTitle(account.getEmail() + ": " + line);
                        continue;
                    }

                    //Check for '\Seen', '\Answered', '\Flagged' and '\Deleted' flags
                    flags = line.substring(line.indexOf("FLAGS (") + 7);
                    flags = flags.substring(0, flags.indexOf(")"));
                    handleFlags(header, flags);

                    int i = line.indexOf("RFC822.SIZE") + 12;
                    line = line.substring(i);
                    for (i = 0; i < line.length(); ++i) {
                        if ( !('0' <= line.charAt(i) && line.charAt(i) <= '9')) {
                            break;
                        }
                    }
                    final String headerSize = line.substring(0, i);
                    if (DEBUG) System.out.println( "DEBUG IMAP4.getNewMails() - header size: " + headerSize);
                    header.setSize( Integer.parseInt( headerSize ) );
                    parseHeaders(header);

                    if (Settings.downWholeMail && !Settings.safeMode) {
                    	inProtocolTask.setTitle(Lang.get(Lang.ALRT_INPL_DOWN_MAIL) + header.getSubject());
                        try {
                            parseBody(header, inProtocolTask);
                            inProtocolTask.setTitle(Lang.get(Lang.ALRT_INPL_DOWN_MAIL) + header.getSubject() + Lang.get(Lang.SUCCESS));
                        } catch (MyException me) {
                        	inProtocolTask.setTitle(Lang.get(Lang.ALRT_INPL_DOWN_MAIL) + header.getSubject() + " " + Lang.get(Lang.FAILED) + " " + me.getDetails());
                        }
                    }
                    try {
                        header.saveHeader();
                        //getBox().getMailDB().saveHeader(header);
                        //cache the mail so next time we can quickly recognize it as already downloaded
                        getTargetBox().addToOnceDownloaded(header);
                        //also mark this mail as checked
                        getTargetBox().addToMsgIDs(header);
                        tempStorage.addElement( header ); // store the mail to temporary storage
                        if (!header.wasRead()) {
                            getTargetBox().changeUnreadMails(1);
                        }
                    } catch (MyException exp) {
                        clear(header); //markAsDeleted partially downloaded bodies
                        inProtocolTask.setTitle(Lang.get(Lang.ALRT_SAVING) + header.getSubject() + " " + Lang.get(Lang.FAILED) + " " + exp.getDetails());
                        if (getTargetBox().isSyncRunning()) //something's gone wrong, now we have to stop sync
                        {
                            throw exp;
                        }
                    }

                    inProtocolTask.incActual(1);
                    if (inProtocolTask.stopped()) {
                        break;
                    }
                }

                if (inProtocolTask.stopped()) {
                	break;
                }
            }
            
            if (inProtocolTask.stopped()) {
            	_close(inProtocolTask, false);
            }

              if (DEBUG) System.out.println( "DEBUG GetMailsTask.doRunWork() - storing mails to the box: " + getTargetBox().getName() );

            // In case this method is called from serversSync() method
            // addMailsInStorageToVector() and setStorage() methods
            // have to be atomic, otherwise TheBox.storage can be
            // overwritten by the last thread running getNewMails() method
            synchronized (getTargetBox().getStorage()) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区爽爽爽爽爽| 亚洲国产aⅴ成人精品无吗| 日韩欧美第一区| 国产精品无人区| 亚洲特级片在线| 青娱乐精品在线视频| 成人午夜看片网址| 欧美大尺度电影在线| 亚洲猫色日本管| 成人av免费在线观看| 欧美日韩国产高清一区二区| 国产欧美日韩一区二区三区在线观看| 五月天视频一区| 成人app软件下载大全免费| 精品福利一二区| 奇米影视一区二区三区| 色婷婷综合久久久中文字幕| 欧美经典一区二区| 久久成人av少妇免费| 欧美夫妻性生活| 亚洲国产精品久久一线不卡| 色视频成人在线观看免| 亚洲同性同志一二三专区| 国产69精品久久99不卡| 欧美www视频| 蜜臀av一区二区在线免费观看| 欧美网站大全在线观看| 一区二区三区四区视频精品免费| 91一区二区在线| 亚洲免费伊人电影| av不卡在线观看| 亚洲欧美自拍偷拍| 成人晚上爱看视频| 国产精品污网站| av电影天堂一区二区在线| 国产精品激情偷乱一区二区∴| 丰满亚洲少妇av| 亚洲视频一区在线观看| 色综合欧美在线视频区| 亚洲与欧洲av电影| 欧美日韩日日骚| 老司机精品视频在线| wwwwxxxxx欧美| 成人国产精品视频| 亚洲天堂2014| 欧美日韩一区三区四区| 日韩国产精品91| 精品国产免费人成电影在线观看四季| 国产一区二区看久久| 久久精品一区二区三区不卡| 成人高清免费观看| 一区二区三区四区五区视频在线观看 | 亚洲精品老司机| 欧美人与z0zoxxxx视频| 久久99精品久久久久久国产越南 | 国产日本欧洲亚洲| www.成人网.com| 偷拍一区二区三区| 精品奇米国产一区二区三区| 成人久久18免费网站麻豆| 国产精品乱人伦| 欧美精品久久一区| 国产a视频精品免费观看| 亚洲裸体xxx| 欧美xxxxxxxx| 91国产福利在线| 国产真实乱偷精品视频免| 国产精品乱人伦中文| 777亚洲妇女| 成人综合在线观看| 亚洲大片在线观看| 久久九九99视频| 69久久夜色精品国产69蝌蚪网| 国产精品亚洲第一区在线暖暖韩国| 亚洲人成影院在线观看| 日韩精品最新网址| 99久久综合国产精品| 青青青伊人色综合久久| 国产精品国产三级国产aⅴ原创| 欧美色精品天天在线观看视频| 国产成人午夜精品影院观看视频 | 一区二区三区免费看视频| 日韩一区二区三| 色狠狠综合天天综合综合| 国产综合色视频| 丝袜国产日韩另类美女| 最新久久zyz资源站| 亚洲精品一线二线三线| 欧美日韩三级一区二区| av一区二区三区四区| 精品制服美女久久| 亚洲成人激情自拍| 亚洲日本护士毛茸茸| 国产欧美日韩精品一区| 日韩情涩欧美日韩视频| 欧美色电影在线| 91成人在线精品| 成人av资源在线观看| 国产一区免费电影| 美女性感视频久久| 亚洲午夜一区二区| 亚洲美女区一区| 亚洲男人电影天堂| 中文字幕免费观看一区| wwwwxxxxx欧美| 精品国产区一区| 精品福利一区二区三区免费视频| 欧美一区二区三区播放老司机 | 91麻豆福利精品推荐| 国产成人啪免费观看软件| 久久激情五月婷婷| 久久99国产乱子伦精品免费| 久久精品国产一区二区三区免费看| 日韩成人dvd| 蜜臀久久99精品久久久久宅男| 婷婷开心激情综合| 洋洋av久久久久久久一区| 一区二区三区久久| 一区二区三区不卡在线观看| 一区二区三区欧美日韩| 亚洲一区二区三区在线| 亚洲电影在线免费观看| 天堂久久一区二区三区| 日本视频免费一区| 久久超碰97中文字幕| 激情文学综合插| 国产精品自拍网站| 成人免费高清视频在线观看| 国产jizzjizz一区二区| 国产精品中文字幕欧美| 成人国产视频在线观看| 在线观看国产日韩| 91精品久久久久久蜜臀| 精品区一区二区| 亚洲天堂福利av| 视频一区在线视频| 精品一区二区三区香蕉蜜桃 | 欧美成va人片在线观看| 2020国产精品自拍| 国产欧美日韩久久| 日韩毛片视频在线看| 亚洲成av人片在线| 精一区二区三区| 99re热这里只有精品免费视频| 欧美女孩性生活视频| 精品国产人成亚洲区| 亚洲欧洲日产国码二区| 婷婷中文字幕综合| 国产精品羞羞答答xxdd| 欧美性生交片4| 国产婷婷色一区二区三区| 亚洲人成影院在线观看| 蜜臀av一区二区三区| 99re视频精品| 久久亚洲影视婷婷| 一区二区三区小说| 国产精品正在播放| 精品视频在线免费| 久久久久亚洲综合| 亚洲777理论| av资源站一区| 欧美精品一区二区三区在线播放| 亚洲素人一区二区| 捆绑调教美女网站视频一区| 色婷婷国产精品| 国产日韩三级在线| 亚洲成a人片在线观看中文| 丰满亚洲少妇av| 欧美精品一区二区在线观看| 亚洲香肠在线观看| 精品一区二区三区香蕉蜜桃| 欧美日韩国产电影| 亚洲女爱视频在线| 国产东北露脸精品视频| 欧美一区二区三区思思人| 最新欧美精品一区二区三区| 国产麻豆午夜三级精品| 91 com成人网| 亚洲成va人在线观看| 一本大道久久a久久综合| 久久午夜免费电影| 蜜桃免费网站一区二区三区| 在线视频国内一区二区| 久久久激情视频| 国产一区二区三区免费观看| 欧美裸体一区二区三区| 亚洲最新在线观看| aa级大片欧美| 中文字幕一区二区三区在线观看| 国产主播一区二区| 精品美女一区二区| 日本午夜精品一区二区三区电影| 精品电影一区二区| 日本免费新一区视频| 欧美久久久一区| 五月综合激情婷婷六月色窝| 欧美日韩的一区二区| 亚洲第一会所有码转帖| 欧美日韩一区三区| 香蕉久久一区二区不卡无毒影院 |