mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 18:58:02 -05:00
IMAP: fix 3297849, ENVELOPE formating error/bogus quotes
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1676 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
eb912da404
commit
0c01e83c3c
@ -941,17 +941,7 @@ public class ImapConnection extends AbstractConnection {
|
|||||||
buffer.append(' ');
|
buffer.append(' ');
|
||||||
}
|
}
|
||||||
if (value != null && value.length > 0) {
|
if (value != null && value.length > 0) {
|
||||||
String unfoldedValue = MimeUtility.unfold(value[0]);
|
appendEnvelopeHeaderValue(buffer, MimeUtility.unfold(value[0]));
|
||||||
if (unfoldedValue.indexOf('"') >= 0) {
|
|
||||||
buffer.append('{');
|
|
||||||
buffer.append(unfoldedValue.length());
|
|
||||||
buffer.append("}\r\n");
|
|
||||||
buffer.append(unfoldedValue);
|
|
||||||
} else {
|
|
||||||
buffer.append('"');
|
|
||||||
buffer.append(unfoldedValue);
|
|
||||||
buffer.append('"');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
buffer.append("NIL");
|
buffer.append("NIL");
|
||||||
}
|
}
|
||||||
@ -997,6 +987,20 @@ public class ImapConnection extends AbstractConnection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void appendEnvelopeHeaderValue(StringBuilder buffer, String unfoldedValue) {
|
||||||
|
if (unfoldedValue.indexOf('"') >= 0) {
|
||||||
|
buffer.append('{');
|
||||||
|
buffer.append(unfoldedValue.length());
|
||||||
|
buffer.append("}\r\n");
|
||||||
|
buffer.append(unfoldedValue);
|
||||||
|
} else {
|
||||||
|
buffer.append('"');
|
||||||
|
buffer.append(unfoldedValue);
|
||||||
|
buffer.append('"');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected void appendBodyStructure(StringBuilder buffer, ExchangeSession.Message message) throws IOException {
|
protected void appendBodyStructure(StringBuilder buffer, ExchangeSession.Message message) throws IOException {
|
||||||
|
|
||||||
buffer.append(" BODYSTRUCTURE ");
|
buffer.append(" BODYSTRUCTURE ");
|
||||||
|
Loading…
Reference in New Issue
Block a user