2010-07-01 09:27:49 -04:00
|
|
|
/*
|
|
|
|
* DavMail POP/IMAP/SMTP/CalDav/LDAP Exchange Gateway
|
|
|
|
* Copyright (C) 2010 Mickael Guessant
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
package davmail.imap;
|
|
|
|
|
|
|
|
import davmail.Settings;
|
|
|
|
|
2010-07-02 02:37:18 -04:00
|
|
|
import javax.mail.MessagingException;
|
|
|
|
import javax.mail.Session;
|
|
|
|
import javax.mail.internet.MimeMessage;
|
2011-02-02 16:20:10 -05:00
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.IOException;
|
2010-08-24 05:28:40 -04:00
|
|
|
import java.util.Random;
|
2010-07-01 09:27:49 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* IMAP tests, an instance of DavMail Gateway must be available
|
|
|
|
*/
|
2010-10-14 17:40:00 -04:00
|
|
|
@SuppressWarnings({"JavaDoc", "UseOfSystemOutOrSystemErr"})
|
2011-02-02 16:20:10 -05:00
|
|
|
public class TestImap extends AbstractImapTestCase {
|
2010-07-01 09:27:49 -04:00
|
|
|
|
2010-07-29 11:42:07 -04:00
|
|
|
public void testListFolders() throws IOException {
|
|
|
|
writeLine(". LSUB \"\" \"*\"");
|
|
|
|
assertEquals(". OK LSUB completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
2010-11-24 04:40:36 -05:00
|
|
|
public void testListSubFolders() throws IOException {
|
|
|
|
writeLine(". LIST \"\" \"INBOX*\"");
|
|
|
|
assertEquals(". OK LIST completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
2010-07-01 09:27:49 -04:00
|
|
|
public void testSelectInbox() throws IOException {
|
|
|
|
writeLine(". SELECT INBOX");
|
|
|
|
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
2010-07-01 11:07:16 -04:00
|
|
|
public void testFetchFlags() throws IOException {
|
|
|
|
writeLine(". UID FETCH 1:* (FLAGS)");
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
2010-08-21 19:40:24 -04:00
|
|
|
public void testUidSearchUnDeleted() throws IOException {
|
2010-07-01 09:27:49 -04:00
|
|
|
writeLine(". UID SEARCH UNDELETED");
|
2010-07-01 10:23:31 -04:00
|
|
|
assertEquals(". OK SEARCH completed", readFullAnswer("."));
|
2010-08-21 19:40:24 -04:00
|
|
|
writeLine(". UID SEARCH NOT DELETED");
|
|
|
|
assertEquals(". OK SEARCH completed", readFullAnswer("."));
|
2010-07-01 10:23:31 -04:00
|
|
|
}
|
|
|
|
|
2010-08-21 19:40:24 -04:00
|
|
|
public void testUidSearchdeleted() throws IOException {
|
2010-07-01 10:23:31 -04:00
|
|
|
writeLine(". UID SEARCH DELETED");
|
|
|
|
assertEquals(". OK SEARCH completed", readFullAnswer("."));
|
2010-07-01 09:27:49 -04:00
|
|
|
}
|
|
|
|
|
2010-07-01 11:07:16 -04:00
|
|
|
public void testStoreUndelete() throws IOException {
|
|
|
|
writeLine(". UID STORE 10 -FLAGS (\\Deleted)");
|
|
|
|
readFullAnswer(".");
|
|
|
|
}
|
|
|
|
|
2010-07-02 02:37:18 -04:00
|
|
|
public void testCreateFolder() throws IOException {
|
|
|
|
writeLine(". DELETE testfolder");
|
|
|
|
readFullAnswer(".");
|
|
|
|
writeLine(". CREATE testfolder");
|
|
|
|
assertEquals(". OK folder created", readFullAnswer("."));
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". SELECT testfolder");
|
|
|
|
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
|
|
|
public void testFetchBigMessage() throws IOException, MessagingException {
|
|
|
|
testCreateFolder();
|
|
|
|
// create 10MB message
|
|
|
|
MimeMessage mimeMessage = new MimeMessage((Session) null);
|
|
|
|
mimeMessage.addHeader("to", Settings.getProperty("davmail.to"));
|
|
|
|
mimeMessage.addHeader("bcc", Settings.getProperty("davmail.bcc"));
|
|
|
|
Random random = new Random();
|
|
|
|
StringBuilder randomText = new StringBuilder();
|
2011-02-02 16:20:10 -05:00
|
|
|
for (int i = 0; i < 10 * 1024 * 1024; i++) {
|
|
|
|
randomText.append((char) ('a' + random.nextInt(26)));
|
2010-08-24 05:28:40 -04:00
|
|
|
}
|
|
|
|
mimeMessage.setText(randomText.toString());
|
|
|
|
mimeMessage.setSubject("Big subject");
|
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
|
|
mimeMessage.writeTo(baos);
|
|
|
|
byte[] content = baos.toByteArray();
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
writeLine(". APPEND testfolder (\\Seen \\Draft) {" + content.length + '}');
|
|
|
|
assertEquals("+ send literal data", readLine());
|
|
|
|
writeLine(new String(content));
|
|
|
|
assertEquals(". OK APPEND completed", readFullAnswer("."));
|
2011-02-02 16:20:10 -05:00
|
|
|
System.out.println("Create time: " + (System.currentTimeMillis() - start) + " ms");
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". NOOP");
|
|
|
|
assertEquals(". OK NOOP completed", readFullAnswer("."));
|
|
|
|
start = System.currentTimeMillis();
|
|
|
|
writeLine(". UID FETCH 1:* (RFC822.SIZE BODY.TEXT)");
|
|
|
|
readFullAnswer(".");
|
2011-02-02 16:20:10 -05:00
|
|
|
System.out.println("Fetch time: " + (System.currentTimeMillis() - start) + " ms");
|
2010-08-24 05:28:40 -04:00
|
|
|
|
2010-07-02 02:37:18 -04:00
|
|
|
}
|
|
|
|
|
2010-08-24 05:28:40 -04:00
|
|
|
|
2010-07-02 02:37:18 -04:00
|
|
|
public void testSelectFolder() throws IOException {
|
|
|
|
writeLine(". SELECT testfolder");
|
|
|
|
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
|
|
|
public void testCreateMessage() throws IOException, MessagingException {
|
2010-08-24 05:28:40 -04:00
|
|
|
|
2010-07-02 02:37:18 -04:00
|
|
|
MimeMessage mimeMessage = new MimeMessage((Session) null);
|
2010-07-12 02:42:09 -04:00
|
|
|
mimeMessage.addHeader("to", Settings.getProperty("davmail.to"));
|
|
|
|
mimeMessage.addHeader("bcc", Settings.getProperty("davmail.bcc"));
|
2010-07-02 02:37:18 -04:00
|
|
|
mimeMessage.setText("Test message");
|
|
|
|
mimeMessage.setSubject("Test subject");
|
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
|
|
mimeMessage.writeTo(baos);
|
|
|
|
byte[] content = baos.toByteArray();
|
2010-07-21 06:41:13 -04:00
|
|
|
writeLine(". APPEND testfolder (\\Seen \\Draft) {" + content.length + '}');
|
2010-07-02 02:37:18 -04:00
|
|
|
assertEquals("+ send literal data", readLine());
|
|
|
|
writeLine(new String(content));
|
|
|
|
assertEquals(". OK APPEND completed", readFullAnswer("."));
|
|
|
|
writeLine(". NOOP");
|
|
|
|
assertEquals(". OK NOOP completed", readFullAnswer("."));
|
|
|
|
|
|
|
|
// fetch message uid
|
|
|
|
writeLine(". UID FETCH 1:* (FLAGS)");
|
|
|
|
String messageLine = readLine();
|
|
|
|
int uidIndex = messageLine.indexOf("UID ") + 4;
|
|
|
|
messageUid = messageLine.substring(uidIndex, messageLine.indexOf(' ', uidIndex));
|
2010-08-24 05:28:40 -04:00
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
assertNotNull(messageUid);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void testUidStoreDeletedFlag() throws IOException {
|
|
|
|
|
|
|
|
// test deleted flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " +FLAGS (\\Deleted)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Seen \\Deleted \\Draft))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
|
|
|
|
// remove deleted flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " -FLAGS (\\Deleted)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Seen \\Draft))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-07-09 08:54:00 -04:00
|
|
|
public void testUidRemoveSeenFlag() throws IOException {
|
2010-07-02 02:37:18 -04:00
|
|
|
// remove seen flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " FLAGS (\\Draft)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Draft))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void testUidStoreForwardedFlag() throws IOException {
|
|
|
|
// add forwarded flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " +FLAGS ($Forwarded)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Draft $Forwarded))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
|
|
|
|
// remove forwarded flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " -FLAGS ($Forwarded)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Draft))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void testUidStoreAnsweredFlag() throws IOException {
|
|
|
|
// add answered flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " +FLAGS (\\Answered)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Draft \\Answered))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
|
|
|
|
// remove answered flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " -FLAGS (\\Answered)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Draft))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void testUidStoreJunkFlag() throws IOException {
|
|
|
|
// add Junk flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " +FLAGS (Junk)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (Junk \\Draft))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
|
|
|
|
// remove Junk flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " -FLAGS (Junk)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Draft))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
}
|
|
|
|
|
2010-07-09 08:54:00 -04:00
|
|
|
public void testUidStoreSeenFlag() throws IOException {
|
|
|
|
// add Junk flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " +FLAGS (\\Seen)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Seen \\Draft))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-09 08:54:00 -04:00
|
|
|
|
|
|
|
// remove Junk flag
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID STORE " + messageUid + " -FLAGS (\\Seen)");
|
|
|
|
assertEquals(". OK STORE completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (FLAGS)");
|
|
|
|
assertEquals("* 1 FETCH (UID " + messageUid + " FLAGS (\\Draft))", readLine());
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-09 08:54:00 -04:00
|
|
|
}
|
|
|
|
|
2010-07-02 02:45:12 -04:00
|
|
|
public void testPartialFetch() throws IOException {
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID FETCH " + messageUid + " (BODY.PEEK[1.MIME])");
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-02 02:45:12 -04:00
|
|
|
}
|
|
|
|
|
2010-09-13 18:19:25 -04:00
|
|
|
public void testHeaderFetch() throws IOException {
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (BODY[HEADER.FIELDS (DATE SUBJECT FROM CONTENT-TYPE TO CC BCC MESSAGE-ID IN-REPLY-TO REFERENCES)])");
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
2010-11-10 16:21:41 -05:00
|
|
|
public void testHeaderBodyFetch() throws IOException {
|
|
|
|
writeLine(". UID FETCH " + messageUid + " (UID BODY.PEEK[HEADER.FIELDS (Content-Type Content-Transfer-Encoding)] BODY.PEEK[TEXT]<0.2048>)");
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
2010-07-09 17:25:18 -04:00
|
|
|
public void testFetchInternalDate() throws IOException {
|
2010-08-24 05:28:40 -04:00
|
|
|
writeLine(". UID FETCH " + messageUid + " (INTERNALDATE)");
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
2010-07-09 17:25:18 -04:00
|
|
|
}
|
|
|
|
|
2010-07-02 02:37:18 -04:00
|
|
|
|
|
|
|
public void testDeleteFolder() throws IOException {
|
|
|
|
writeLine(". DELETE testfolder");
|
2010-08-24 05:28:40 -04:00
|
|
|
assertEquals(". OK folder deleted", readFullAnswer("."));
|
2010-07-02 02:37:18 -04:00
|
|
|
}
|
|
|
|
|
2010-07-01 09:27:49 -04:00
|
|
|
public void testLogout() throws IOException {
|
|
|
|
writeLine(". LOGOUT");
|
|
|
|
assertEquals("* BYE Closing connection", socketReader.readLine());
|
2011-03-07 17:30:25 -05:00
|
|
|
assertEquals(". OK LOGOUT completed", socketReader.readLine());
|
2010-09-02 16:21:41 -04:00
|
|
|
clientSocket = null;
|
2010-07-01 09:27:49 -04:00
|
|
|
}
|
2010-08-24 05:28:40 -04:00
|
|
|
|
2010-10-02 12:16:27 -04:00
|
|
|
public void testCopyMessage() throws IOException, InterruptedException, MessagingException {
|
|
|
|
testCreateFolder();
|
|
|
|
testCreateMessage();
|
|
|
|
writeLine(". UID FETCH 1:* (FLAGS)");
|
|
|
|
String messageLine = readLine();
|
|
|
|
int uidIndex = messageLine.indexOf("UID ") + 4;
|
|
|
|
messageUid = messageLine.substring(uidIndex, messageLine.indexOf(' ', uidIndex));
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
|
|
|
|
2011-02-02 16:20:10 -05:00
|
|
|
writeLine(". UID COPY " + messageUid + " Trash");
|
2010-10-02 12:16:27 -04:00
|
|
|
assertEquals(". OK copy completed", readFullAnswer("."));
|
|
|
|
|
|
|
|
writeLine(". COPY 1 Trash");
|
|
|
|
assertEquals(". OK copy completed", readFullAnswer("."));
|
|
|
|
|
|
|
|
testDeleteFolder();
|
|
|
|
}
|
2010-10-14 17:40:00 -04:00
|
|
|
|
|
|
|
public void testFetchInboxEnvelope() throws IOException {
|
|
|
|
testSelectInbox();
|
|
|
|
writeLine(". UID FETCH 1:* (ENVELOPE)");
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
|
|
|
public void testFetchInboxBodyStructure() throws IOException {
|
|
|
|
testSelectInbox();
|
|
|
|
writeLine(". UID FETCH 1:* (BODYSTRUCTURE)");
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
2010-11-22 04:46:19 -05:00
|
|
|
public void testFetchRfc822Header() throws IOException {
|
|
|
|
testSelectInbox();
|
|
|
|
writeLine(". UID FETCH 1:* (UID RFC822.HEADER RFC822.SIZE FLAGS)");
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
|
|
|
public void testThunderbirdHeaderFetch() throws IOException {
|
|
|
|
testSelectInbox();
|
|
|
|
writeLine(". UID FETCH 1:* (UID RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS (From To Cc Bcc Subject Date Message-ID Priority X-Priority References Newsgroups In-Reply-To Content-Type)])");
|
|
|
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
|
|
|
}
|
2011-02-02 16:20:10 -05:00
|
|
|
|
2011-06-07 16:42:25 -04:00
|
|
|
public void testSearchHeader() throws IOException {
|
|
|
|
testSelectInbox();
|
|
|
|
writeLine(". UID SEARCH HEADER X-TUID testvalue");
|
|
|
|
assertEquals(". OK SEARCH completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID SEARCH HEADER X-OfflineIMAP \"testvalue\"");
|
|
|
|
assertEquals(". OK SEARCH completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
2011-08-29 17:04:30 -04:00
|
|
|
public void testSearchUndraft() throws IOException {
|
|
|
|
testSelectInbox();
|
|
|
|
writeLine(". UID SEARCH UNDRAFT");
|
|
|
|
assertEquals(". OK SEARCH completed", readFullAnswer("."));
|
|
|
|
writeLine(". UID SEARCH DRAFT");
|
|
|
|
assertEquals(". OK SEARCH completed", readFullAnswer("."));
|
|
|
|
}
|
|
|
|
|
2011-02-02 16:20:10 -05:00
|
|
|
public void testBrokenPipe() throws IOException, InterruptedException {
|
|
|
|
testSelectInbox();
|
|
|
|
writeLine(". UID FETCH 1:* (RFC822.SIZE BODY.TEXT)");
|
|
|
|
socketReader.readLine();
|
|
|
|
// force close connection
|
|
|
|
clientSocket.close();
|
|
|
|
Thread.sleep(5000);
|
|
|
|
}
|
2010-07-01 09:27:49 -04:00
|
|
|
}
|