diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index e0e60c73..75b3f936 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -545,7 +545,7 @@ public class ExchangeSession { message.draft = "9".equals(prop.getPropertyAsString()); } else if ("x10810003".equals(localName)) { message.answered = prop.getPropertyAsString().length() > 0; - } else if ("ishidden".equals(localName)) { + } else if ("isdeleted".equals(localName)) { message.deleted = "1".equals(prop.getPropertyAsString()); } else if ("message-id".equals(prop.getLocalName())) { message.messageId = prop.getPropertyAsString(); @@ -588,7 +588,7 @@ public class ExchangeSession { } else if ("draft".equals(entry.getKey())) { patchMethod.addPropertyToSet("x0E070003", entry.getValue(), "f", "http://schemas.microsoft.com/mapi/proptag/"); } else if ("deleted".equals(entry.getKey())) { - patchMethod.addPropertyToSet("ishidden", entry.getValue(), "d", "DAV:"); + patchMethod.addPropertyToSet("isdeleted", entry.getValue(), "d", "DAV:"); } } } @@ -613,9 +613,9 @@ public class ExchangeSession { String searchRequest = "Select \"DAV:uid\", \"http://schemas.microsoft.com/mapi/proptag/x0e080003\"" + " ,\"http://schemas.microsoft.com/mapi/proptag/x10830003\", \"http://schemas.microsoft.com/mapi/proptag/x10900003\"" + " ,\"http://schemas.microsoft.com/mapi/proptag/x0E070003\", \"http://schemas.microsoft.com/mapi/proptag/x10810003\"" + - " ,\"urn:schemas:mailheader:message-id\", \"urn:schemas:httpmail:read\", \"DAV:ishidden\"" + + " ,\"urn:schemas:mailheader:message-id\", \"urn:schemas:httpmail:read\", \"DAV:isdeleted\"" + " FROM Scope('SHALLOW TRAVERSAL OF \"" + folderUrl + "\"')\n" + - " WHERE \"DAV:isfolder\" = False\n" + + " WHERE \"DAV:ishidden\" = False AND \"DAV:isfolder\" = False\n" + " ORDER BY \"urn:schemas:httpmail:date\" ASC"; Enumeration folderEnum = DavGatewayHttpClientFacade.executeSearchMethod(wdr.retrieveSessionInstance(), folderUrl, searchRequest); diff --git a/src/java/davmail/imap/ImapConnection.java b/src/java/davmail/imap/ImapConnection.java index 65293df5..ebcc4784 100644 --- a/src/java/davmail/imap/ImapConnection.java +++ b/src/java/davmail/imap/ImapConnection.java @@ -206,7 +206,7 @@ public class ImapConnection extends AbstractConnection { } while (rangeIterator.hasNext()) { ExchangeSession.Message message = rangeIterator.next(); - if (parameters == null) { + if (parameters == null || "FLAGS".equals(parameters)) { sendClient("* " + (rangeIterator.currentIndex ) + " FETCH (UID " + message.getUidAsLong() + " FLAGS (" + (message.getImapFlags()) + "))"); } else if ("BODYSTRUCTURE".equals(parameters)) { sendClient("* " + (rangeIterator.currentIndex ) + " FETCH (BODYSTRUCTURE (\"TEXT\" \"PLAIN\" (\"CHARSET\" \"windows-1252\") NIL NIL \"QUOTED-PRINTABLE\" " + message.size + " 50 NIL NIL NIL NIL))");