Fallback when a "Well known folders" cannot be found
Brought to you by:
mguessan
Davmail cannot find my Draft folder although I can see it in Outlook and in the OWA web interface.
Investigations shows that the response in DavExchangeSession.getWellKnownFolders does not contains any "drafts" entry. I don't know why.
As a workaround I added
davmail.drafts.fallback=Drafts
to my davmail.properties file, and patched davmail this way:
--- src/java/davmail/exchange/dav/DavExchangeSession.java +++ src/java/davmail/exchange/dav/DavExchangeSession.java @@ -718,7 +718,11 @@ public class DavExchangeSession extends ExchangeSession { protected String getURIPropertyIfExists(DavPropertySet properties, String alias) throws URIException { DavProperty property = properties.get(Field.getPropertyName(alias)); if (property == null) { - return null; + String fallback = Settings.getProperty("davmail."+alias+".fallback"); + if(fallback != null) + return httpClient.getHostConfiguration().getHostURL() + mailPath + fallback; + else + return null; } else { return URIUtil.decode((String) property.getValue()); }
You could also try to fix your mailbox with Outlook command line options, maybe /resetfoldernames
I tried it but it did not work. I also tried to understand why the draft folder was not listed using MAPI editor but I was not to understand the data structure.
Root cause is a broken mailbox