mirror of
https://github.com/moparisthebest/davmail
synced 2025-03-04 03:09:40 -05:00
IMAP: another fix for 3297849, ENVELOPE formating error/bogus quotes
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1678 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
c1f6161c7b
commit
a830470398
@ -936,7 +936,7 @@ public class ImapConnection extends AbstractConnection {
|
|||||||
buffer.append(')');
|
buffer.append(')');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void appendEnvelopeHeader(StringBuilder buffer, String[] value) {
|
protected void appendEnvelopeHeader(StringBuilder buffer, String[] value) throws UnsupportedEncodingException {
|
||||||
if (buffer.charAt(buffer.length() - 1) != '(') {
|
if (buffer.charAt(buffer.length() - 1) != '(') {
|
||||||
buffer.append(' ');
|
buffer.append(' ');
|
||||||
}
|
}
|
||||||
@ -958,7 +958,7 @@ public class ImapConnection extends AbstractConnection {
|
|||||||
buffer.append('(');
|
buffer.append('(');
|
||||||
String personal = address.getPersonal();
|
String personal = address.getPersonal();
|
||||||
if (personal != null) {
|
if (personal != null) {
|
||||||
buffer.append('"').append(MimeUtility.encodeText(personal)).append('"');
|
appendEnvelopeHeaderValue(buffer, personal);
|
||||||
} else {
|
} else {
|
||||||
buffer.append("NIL");
|
buffer.append("NIL");
|
||||||
}
|
}
|
||||||
@ -987,15 +987,15 @@ public class ImapConnection extends AbstractConnection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void appendEnvelopeHeaderValue(StringBuilder buffer, String unfoldedValue) {
|
protected void appendEnvelopeHeaderValue(StringBuilder buffer, String value) throws UnsupportedEncodingException {
|
||||||
if (unfoldedValue.indexOf('"') >= 0) {
|
if (value.indexOf('"') >= 0) {
|
||||||
buffer.append('{');
|
buffer.append('{');
|
||||||
buffer.append(unfoldedValue.length());
|
buffer.append(value.length());
|
||||||
buffer.append("}\r\n");
|
buffer.append("}\r\n");
|
||||||
buffer.append(unfoldedValue);
|
buffer.append(value);
|
||||||
} else {
|
} else {
|
||||||
buffer.append('"');
|
buffer.append('"');
|
||||||
buffer.append(unfoldedValue);
|
buffer.append(MimeUtility.encodeText(value));
|
||||||
buffer.append('"');
|
buffer.append('"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user