From e7fdf4dcbaa772ab824b281987305a08298aeeb0 Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 9 Nov 2011 10:13:03 +0000 Subject: [PATCH] IMAP: new davmail.imapIncludeSpecialFolders setting to access all folders including calendar and tasks over IMAP git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1853 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index 605bb6dd..98008b26 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -288,7 +288,6 @@ public abstract class ExchangeSession { * @param url exchange base URL * @param httpClient httpClient instance * @return true if basic authentication detected - * @throws IOException unable to connect to exchange */ protected boolean isBasicAuthentication(HttpClient httpClient, String url) { return DavGatewayHttpClientFacade.getHttpStatus(httpClient, url) == HttpStatus.SC_UNAUTHORIZED; @@ -1092,7 +1091,11 @@ public abstract class ExchangeSession { * @throws IOException on error */ public List getSubFolders(String folderName, boolean recursive) throws IOException { - List results = getSubFolders(folderName, or(isEqualTo("folderclass", "IPF.Note"), isNull("folderclass")), + Condition folderCondition = null; + if (!Settings.getBooleanProperty("davmail.imapIncludeSpecialFolders", false)) { + folderCondition = or(isEqualTo("folderclass", "IPF.Note"), isNull("folderclass")); + } + List results = getSubFolders(folderName, folderCondition, recursive); // need to include base folder in recursive search, except on root if (recursive && folderName.length() > 0) { @@ -1230,6 +1233,7 @@ public abstract class ExchangeSession { * * @param mimeMessage MIME message * @throws IOException on error + * @throws MessagingException on error */ public abstract void sendMessage(MimeMessage mimeMessage) throws IOException, MessagingException; @@ -1238,7 +1242,7 @@ public abstract class ExchangeSession { * Folder name can be logical names INBOX, Drafts, Trash or calendar, * or a path relative to user base folder or absolute path. * - * @param folderName folder name + * @param folderPath folder path * @return Folder object * @throws IOException on error */