1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 19:22:22 -05:00

Fix sendMail regression after IMAP implementation

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@326 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-02-04 20:38:07 +00:00
parent db381db85b
commit e9f138238a
2 changed files with 15 additions and 11 deletions

View File

@ -507,17 +507,19 @@ public class ExchangeSession {
} }
// add bcc and other properties // add bcc and other properties
patchMethod = new PropPatchMethod(messageUrl); if (properties.size() > 0) {
try { patchMethod = new PropPatchMethod(messageUrl);
// update message with blind carbon copy and other flags try {
addProperties(patchMethod, properties); // update message with blind carbon copy and other flags
int statusCode = wdr.retrieveSessionInstance().executeMethod(patchMethod); addProperties(patchMethod, properties);
if (statusCode != HttpStatus.SC_MULTI_STATUS) { int statusCode = wdr.retrieveSessionInstance().executeMethod(patchMethod);
throw new IOException("Unable to patch message " + messageUrl + ": " + statusCode + " " + patchMethod.getStatusLine()); if (statusCode != HttpStatus.SC_MULTI_STATUS) {
} throw new IOException("Unable to patch message " + messageUrl + ": " + statusCode + " " + patchMethod.getStatusLine());
}
} finally { } finally {
patchMethod.releaseConnection(); patchMethod.releaseConnection();
}
} }
} }

View File

@ -41,6 +41,7 @@ public class ImapConnection extends AbstractConnection {
String commandId = null; String commandId = null;
StringTokenizer tokens; StringTokenizer tokens;
try { try {
ExchangeSessionFactory.checkConfig();
sendClient("* OK [CAPABILITY IMAP4REV1 AUTH=LOGIN] IMAP4rev1 DavMail server ready"); sendClient("* OK [CAPABILITY IMAP4REV1 AUTH=LOGIN] IMAP4rev1 DavMail server ready");
for (; ;) { for (; ;) {
line = readClient(); line = readClient();
@ -368,6 +369,7 @@ public class ImapConnection extends AbstractConnection {
} }
} }
// skip optional date // skip optional date
// TODO : replace datereceived
String dateOrSize = tokens.nextToken(); String dateOrSize = tokens.nextToken();
if (tokens.hasMoreTokens()) { if (tokens.hasMoreTokens()) {
dateOrSize = tokens.nextToken(); dateOrSize = tokens.nextToken();
@ -428,7 +430,7 @@ public class ImapConnection extends AbstractConnection {
if (commandId != null) { if (commandId != null) {
sendClient(commandId + " BAD unable to handle request: " + e.getMessage()); sendClient(commandId + " BAD unable to handle request: " + e.getMessage());
} else { } else {
sendClient("* BAD unable to handle request: " + e.getMessage()); sendClient("* BYE unable to handle request: " + e.getMessage());
} }
} catch (IOException e2) { } catch (IOException e2) {
DavGatewayTray.warn("Exception sending error to client", e2); DavGatewayTray.warn("Exception sending error to client", e2);