1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-08-13 16:53:51 -04:00

Enable Webdav/Galfind failover on Exchange 2007

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1446 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-09-14 20:33:06 +00:00
parent 6d1b4e384a
commit 488b01756c

View File

@ -497,6 +497,15 @@ public class DavExchangeSession extends ExchangeSession {
disableGalLookup = true; disableGalLookup = true;
getEmailAndAliasFromOptions(); getEmailAndAliasFromOptions();
// failover: try to get email through Webdav and Galfind
if (mailPath == null || email == null) {
try {
buildEmail(method.getURI().getHost());
} catch (URIException uriException) {
LOGGER.warn(uriException);
}
}
// build standard mailbox link with email // build standard mailbox link with email
mailPath = "/exchange/" + email + '/'; mailPath = "/exchange/" + email + '/';
} }
@ -1345,7 +1354,7 @@ public class DavExchangeSession extends ExchangeSession {
davPropertyNameSet.add(Field.getPropertyName("alldayevent")); davPropertyNameSet.add(Field.getPropertyName("alldayevent"));
davPropertyNameSet.add(Field.getPropertyName("busystatus")); davPropertyNameSet.add(Field.getPropertyName("busystatus"));
davPropertyNameSet.add(Field.getPropertyName("reminderset")); davPropertyNameSet.add(Field.getPropertyName("reminderset"));
davPropertyNameSet.add(Field.getPropertyName("reminderdelta")); davPropertyNameSet.add(Field.getPropertyName("reminderdelta"));
PropFindMethod propFindMethod = new PropFindMethod(permanentUrl, davPropertyNameSet, 0); PropFindMethod propFindMethod = new PropFindMethod(permanentUrl, davPropertyNameSet, 0);
try { try {
@ -1372,7 +1381,7 @@ public class DavExchangeSession extends ExchangeSession {
String exdates = getPropertyIfExists(davPropertySet, "exdate"); String exdates = getPropertyIfExists(davPropertySet, "exdate");
if (exdates != null) { if (exdates != null) {
String[] exdatearray = exdates.split(","); String[] exdatearray = exdates.split(",");
for (String exdate:exdatearray) { for (String exdate : exdatearray) {
vEvent.addPropertyValue("EXDATE", vEvent.addPropertyValue("EXDATE",
StringUtil.convertZuluDateTimeToAllDay(convertDateFromExchange(exdate))); StringUtil.convertZuluDateTimeToAllDay(convertDateFromExchange(exdate)));
} }
@ -1419,7 +1428,7 @@ public class DavExchangeSession extends ExchangeSession {
vAlarm.setPropertyValue("ACTION", "DISPLAY"); vAlarm.setPropertyValue("ACTION", "DISPLAY");
vAlarm.setPropertyValue("DISPLAY", "Reminder"); vAlarm.setPropertyValue("DISPLAY", "Reminder");
String reminderdelta = getPropertyIfExists(davPropertySet, "reminderdelta"); String reminderdelta = getPropertyIfExists(davPropertySet, "reminderdelta");
VProperty vProperty = new VProperty("TRIGGER", "-PT"+reminderdelta+ 'M'); VProperty vProperty = new VProperty("TRIGGER", "-PT" + reminderdelta + 'M');
vProperty.addParam("VALUE", "DURATION"); vProperty.addParam("VALUE", "DURATION");
vAlarm.addProperty(vProperty); vAlarm.addProperty(vProperty);
vEvent.addVObject(vAlarm); vEvent.addVObject(vAlarm);