mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-14 03:32:22 -05:00
Add cc support to headers rebuild
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@15 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
f9b1321101
commit
45ce559cd6
@ -72,7 +72,6 @@ public class ExchangeSession {
|
|||||||
messageRequestProperties.add("urn:schemas:calendar:meetingstatus");
|
messageRequestProperties.add("urn:schemas:calendar:meetingstatus");
|
||||||
messageRequestProperties.add("urn:schemas:calendar:alldayevent");
|
messageRequestProperties.add("urn:schemas:calendar:alldayevent");
|
||||||
messageRequestProperties.add("urn:schemas:calendar:responserequested");
|
messageRequestProperties.add("urn:schemas:calendar:responserequested");
|
||||||
// TODO : full headers rebuild with cc
|
|
||||||
messageRequestProperties.add("urn:schemas:mailheader:cc");
|
messageRequestProperties.add("urn:schemas:mailheader:cc");
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -237,7 +236,6 @@ public class ExchangeSession {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO : catch exception
|
|
||||||
// get user mail URL from html body (multi frame)
|
// get user mail URL from html body (multi frame)
|
||||||
String body = method.getResponseBodyAsString();
|
String body = method.getResponseBodyAsString();
|
||||||
int beginIndex = body.indexOf(url);
|
int beginIndex = body.indexOf(url);
|
||||||
@ -385,6 +383,8 @@ public class ExchangeSession {
|
|||||||
message.from = prop.getPropertyAsString();
|
message.from = prop.getPropertyAsString();
|
||||||
} else if ("to".equals(prop.getLocalName())) {
|
} else if ("to".equals(prop.getLocalName())) {
|
||||||
message.to = prop.getPropertyAsString();
|
message.to = prop.getPropertyAsString();
|
||||||
|
} else if ("cc".equals(prop.getLocalName())) {
|
||||||
|
message.cc = prop.getPropertyAsString();
|
||||||
} else if ("subject".equals(prop.getLocalName())) {
|
} else if ("subject".equals(prop.getLocalName())) {
|
||||||
message.subject = prop.getPropertyAsString();
|
message.subject = prop.getPropertyAsString();
|
||||||
} else if ("priority".equals(prop.getLocalName())) {
|
} else if ("priority".equals(prop.getLocalName())) {
|
||||||
@ -402,7 +402,7 @@ public class ExchangeSession {
|
|||||||
|
|
||||||
public Message getMessage(String messageUrl) throws IOException {
|
public Message getMessage(String messageUrl) throws IOException {
|
||||||
|
|
||||||
// // TODO switch according to Log4J log level
|
// TODO switch according to Log4J log level
|
||||||
|
|
||||||
wdr.setDebug(4);
|
wdr.setDebug(4);
|
||||||
wdr.propfindMethod(messageUrl, 0);
|
wdr.propfindMethod(messageUrl, 0);
|
||||||
@ -443,7 +443,6 @@ public class ExchangeSession {
|
|||||||
public void sendMessage(BufferedReader reader) throws IOException {
|
public void sendMessage(BufferedReader reader) throws IOException {
|
||||||
String subject = "davmailtemp";
|
String subject = "davmailtemp";
|
||||||
String line = reader.readLine();
|
String line = reader.readLine();
|
||||||
// TODO : use reader directly instead of buffer
|
|
||||||
StringBuffer mailBuffer = new StringBuffer();
|
StringBuffer mailBuffer = new StringBuffer();
|
||||||
while (!".".equals(line)) {
|
while (!".".equals(line)) {
|
||||||
mailBuffer.append(line);
|
mailBuffer.append(line);
|
||||||
@ -526,6 +525,7 @@ public class ExchangeSession {
|
|||||||
public String contentClass;
|
public String contentClass;
|
||||||
public boolean hasAttachment;
|
public boolean hasAttachment;
|
||||||
public String to;
|
public String to;
|
||||||
|
public String cc;
|
||||||
public String date;
|
public String date;
|
||||||
public String messageId;
|
public String messageId;
|
||||||
public String received;
|
public String received;
|
||||||
@ -551,7 +551,6 @@ public class ExchangeSession {
|
|||||||
|
|
||||||
protected void preProcessHeaders() {
|
protected void preProcessHeaders() {
|
||||||
// only handle exchange messages
|
// only handle exchange messages
|
||||||
// TODO : handle calendar messages
|
|
||||||
if (!"urn:content-classes:message".equals(contentClass) &&
|
if (!"urn:content-classes:message".equals(contentClass) &&
|
||||||
!"urn:content-classes:calendarmessage".equals(contentClass)
|
!"urn:content-classes:calendarmessage".equals(contentClass)
|
||||||
) {
|
) {
|
||||||
@ -581,6 +580,9 @@ public class ExchangeSession {
|
|||||||
if (priority != null) {
|
if (priority != null) {
|
||||||
fullHeaders += "X-Priority: " + priority + "\n";
|
fullHeaders += "X-Priority: " + priority + "\n";
|
||||||
}
|
}
|
||||||
|
if (cc != null) {
|
||||||
|
fullHeaders += "CC: " + cc + "\n";
|
||||||
|
}
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
throw new RuntimeException("Unable to rebuild header " + e.getMessage());
|
throw new RuntimeException("Unable to rebuild header " + e.getMessage());
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user