diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index 2818c09b..71b7cd0d 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -2359,6 +2359,19 @@ public class ExchangeSession { if (patchStatus != HttpStatus.SC_MULTI_STATUS) { LOGGER.warn("Unable to patch event to trigger activeSync push"); } else { + // Yet another patch: restore message custom body, all custom lines are removed by PROPPATCH + PutMethod restorePutMethod = new PutMethod(messageUrl); + restorePutMethod.setRequestHeader("Translate", "f"); + restorePutMethod.setRequestHeader("Overwrite", "f"); + restorePutMethod.setRequestEntity(new ByteArrayRequestEntity(baos.toByteArray(), "message/rfc822")); + try { + status = httpClient.executeMethod(restorePutMethod); + if (status == HttpURLConnection.HTTP_OK) { + LOGGER.warn("Unable to create or update message " + status + ' ' + restorePutMethod.getStatusLine()); + } + } finally { + putmethod.releaseConnection(); + } // Need to get event again to get updated etag Event event = getEvent(messageUrl); if (event.getEtag() != null) {